Skip to content

Act on at most one new view message per view - #770

Merged
tock-ibm merged 1 commit into
hyperledger:mainfrom
HagarMeir:one-new-view-per-view
Nov 16, 2026
Merged

tock-ibm merged 1 commit into
hyperledger:mainfrom
HagarMeir:one-new-view-per-view

Conversation

@HagarMeir

Copy link
Copy Markdown
Contributor

Written by Claude (Anthropic's AI assistant) on behalf of Hagar Meir.

Fixes #769.

  • processNewViewMsg sets acceptedNewView as 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.
  • The assignment after the new view record is saved is now redundant, so it's removed. The field comment and the log message say "acted on" instead of "accepted".

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. On main it changes the view.

🤖 Generated with Claude Code

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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
tock-ibm merged commit b1628a5 into hyperledger:main Nov 16, 2026
6 checks passed
@HagarMeir
HagarMeir deleted the one-new-view-per-view branch November 16, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A node can act on two new view messages for the same view

4 participants