Repository navigation
Act on at most one new view message per view - #770
Merged
Merged
Conversation
processNewViewMsg sets acceptedNewView as soon as the new view message passes its checks, before it commits the in-flight proposal, so a later new view message for the same view is ignored even if the commit fails. The node moves on when its view change times out. Fixes hyperledger#769. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Hagar Meir <hagar.meir@ibm.com>
pfi79
approved these changes
Nov 16, 2026
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the change limiting SmartBFT to one acted-on new-view message per view.
No open issues 🎉
What changed in this PR
Addresses #769 by ensuring SmartBFT acts on at most one new-view message per view, even if committing its in-flight proposal fails.
Changes:
- Marks a new-view message as acted on before attempting the in-flight commit, preventing subsequent messages for that view from being processed.
- Updates the field comment and log message to reflect this behavior.
- Adds a regression test covering a failed commit followed by a second new-view message.
| File | Description |
|---|---|
internal/bft/viewchanger.go |
Moves the acted-on flag before the commit attempt and clarifies related wording. |
internal/bft/viewchanger_test.go |
Verifies that a second new-view message is ignored after an in-flight commit fails. |
Review effort: Balanced
tock-ibm
approved these changes
Nov 16, 2026
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.
Fixes #769.
processNewViewMsgsetsacceptedNewViewas soon as the new view message passes its checks, before it commits the in-flight proposal. A later new view message for the same view is then ignored, even if the commit fails. The node moves on when its view change times out.Tests:
TestNoOtherNewViewAfterTheInFlightCommitFails: a new view message whose in-flight proposal fails to commit, because the node already decided a different proposal at that sequence, is followed by a new view message for the same view with nothing in flight. The node doesn't act on the second one. Onmainit changes the view.🤖 Generated with Claude Code