Skip to content

feat(consensus): cluster supermajority root tracking#1230

Draft
prestonsn wants to merge 11 commits intoadamw/implement-getSlot-in-rpcfrom
prestonsn/feat-cluster-supermajority-root-tracking
Draft

feat(consensus): cluster supermajority root tracking#1230
prestonsn wants to merge 11 commits intoadamw/implement-getSlot-in-rpcfrom
prestonsn/feat-cluster-supermajority-root-tracking

Conversation

@prestonsn
Copy link
Contributor

@prestonsn prestonsn commented Feb 13, 2026

The way we track the finalized slot for RPC differs from Agave.

Currently, Sig returns the local tower root for getSlot with finalized commitment. Agave instead returns the highest slot that >2/3 of cluster stake has rooted, computed by aggregating root_slot from all vote accounts weighted by stake.

This gets calculated every time a bank is deemed "votable" (in handleVotableBank, after selectVoteAndResetForks).

This PR ports this functionality to Sig by:

  • Adding HighestSuperMajorityRoot tracker to SlotTracker
  • Implementing getHighestSuperMajorityRoot() algorithm in replay_tower.zig
  • Wiring the aggregation into handleVotableBank()

Agave References:

ajw221 and others added 10 commits February 12, 2026 22:07
- Add SlotTree.tip() to get highest slot among fork leaves (bypass mode)
- Update latest_processed_slot inside vote handling to match Agave behavior
- Update latest_processed_slot in bypassConsensus() from SlotTree.tip()
- Change ForkChoiceProcessedSlot to use store() since slot can decrease
Note: Bypass mode uses highest fork tip, while consensus mode matches
Agave's semantics where processed slot only updates when voting.
Condense nested if statements into single-line conditional return.
@github-project-automation github-project-automation bot moved this to 🏗 In progress in Sig Feb 13, 2026
@prestonsn prestonsn force-pushed the prestonsn/feat-cluster-supermajority-root-tracking branch from 0059060 to 899c221 Compare February 13, 2026 18:48
@prestonsn prestonsn marked this pull request as draft February 13, 2026 18:49
@prestonsn prestonsn self-assigned this Feb 13, 2026
- Add RootedStake struct and collectRootedStake to gather root slots from vote accounts
- Add getHighestSuperMajorityRoot to find slot rooted by >2/3 stake
- Add HighestSuperMajorityRoot tracker with atomic updates
- Update SlotTracker to use highest_super_majority_root for finalized commitment
- Compute and update super majority root in handleVotableBank after voting
@prestonsn prestonsn force-pushed the prestonsn/feat-cluster-supermajority-root-tracking branch from 899c221 to 7ea7cde Compare February 13, 2026 19:14
@ajw221 ajw221 force-pushed the adamw/implement-getSlot-in-rpc branch from 7d84370 to 8279fe0 Compare February 14, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

2 participants