Repository navigation
Conversation
…iew change When the write ahead log ends with a view change record, setViewAndSeq restores the view change and the node starts in the view it left. It now also calls Controller.LeaveView for that view before the controller starts. startView then doesn't run the view: it still builds it, which restores the state from the write ahead log, but puts a stopped view in its place. The restored view change moves the node on as before. Part of hyperledger#765. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Hagar Meir <hagar.meir@ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Written by Claude (Anthropic's AI assistant) on behalf of Hagar Meir.
Part of #765.
setViewAndSeqalready restores the view change, and the node starts in the view it left. It now also callsController.LeaveViewfor that view before the controller starts, the same way the view changer does before it sends its view data.Controller.startViewdoesn't run a view the node left. It still builds the view, because building the first view restores the node's state from the write ahead log, such as the in-flight proposal it reports in its view data. But it puts a view in its place that doesn't run: it is stopped, drops its messages, and takes the follower role. The restored view change then moves the node on as before: it sends its view data again, and the node enters the next view through a new view message or a sync.Tests:
TestControllerDoesNotRunALeftStartView: a controller that starts in a view it left builds the view but doesn't start it, marks its sequence as inactive, and starts the next view when it gets to it.TestSetViewAndSeqDoesNotStartALeftView: a view change record gives the start view and the restore.TestRestartInTheMiddleOfAViewChange: node 4 restarts after it sent its view data, while its write ahead log still ends with the view change record. It doesn't run the view it left, and it gets to the next view. Onmain, it runs the view it left again.🤖 Generated with Claude Code