Skip to content

Tighten gc_round invariant checks in FlexCommitter's build_commit - #27759

Open
lexfrl wants to merge 3 commits into
MystenLabs:mainfrom
lexfrl:flex-committer-gc-round-cleanup
Open

Tighten gc_round invariant checks in FlexCommitter's build_commit#27759
lexfrl wants to merge 3 commits into
MystenLabs:mainfrom
lexfrl:flex-committer-gc-round-cleanup

Conversation

@lexfrl

@lexfrl lexfrl commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Description

build_commit's gc_round check ran once, in aggregate, after the DFS finished. This moves the leader check to before dag_state is mutated, drops the now-redundant aggregate check, and folds the ancestor is_committed pre-check into set_committed's existing check-and-set.

Test plan

Added try_commit_multi_leader_shared_ancestor_visited_once, covering shared ancestors discovered by multiple leaders within one build_commit call — not covered by existing tests, whose shared ancestors are always genesis blocks excluded before dag_state is touched. Full consensus-core suite passes (337 tests).


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • Indexing Framework:

@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-docs Ready Ready Preview Aug 21, 2026 1:25pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Preview Aug 21, 2026 1:25pm
sui-kiosk Ignored Ignored Preview Aug 21, 2026 1:25pm

Request Review

lexfrl added 2 commits August 19, 2026 15:54
No behavior change — replaces assert!(!is_empty(), ...) with if/panic! on
is_empty() directly.
Check leader.round() > gc_round before mutating dag_state, instead of
asserting it in aggregate after the DFS finishes. Fold the ancestor
is_committed check into set_committed's existing check-and-set.

Behavior unchanged: full consensus-core suite passes (337 tests), and
try_commit_multi_leader_shared_ancestor_visited_once confirms shared
ancestors are still deduplicated correctly.
@lexfrl
lexfrl force-pushed the flex-committer-gc-round-cleanup branch from a7c5bcf to 1122865 Compare August 19, 2026 18:56
@lexfrl
lexfrl marked this pull request as ready for review August 19, 2026 18:59
@lexfrl
lexfrl requested a review from a team as a code owner August 19, 2026 18:59

@mwtian mwtian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm except one comment!

Comment thread consensus/core/src/flex_committer.rs Outdated
@lexfrl
lexfrl temporarily deployed to sui-typescript-aws-kms-test-env August 20, 2026 04:47 — with GitHub Actions Inactive
@lexfrl
lexfrl temporarily deployed to sui-typescript-aws-kms-test-env August 20, 2026 04:47 — with GitHub Actions Inactive
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.

2 participants