feat(autobahn): Add epoch.Registry to maintain committee/stake (CON-358)#3632
feat(autobahn): Add epoch.Registry to maintain committee/stake (CON-358)#3632wen-coding wants to merge 3 commits into
Conversation
PR SummaryMedium Risk Overview
Avail initializes lanes across the epoch window, resolves lane QCs per epoch (votes weighted per committee in Reviewed by Cursor Bugbot for commit f1f1d55. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
d764443 to
705d8c9
Compare
130227a to
ab4c67c
Compare
…r committee/stake - Add epoch.Registry holding the genesis committee, firstBlock, and genesisTimestamp - Wire Registry into data.State, avail.State, and consensus.State, replacing the ad-hoc committee/election fields - Drop EpochWindowCommittee in favour of direct EpochWindow() usage - Drop Activate and the committees map; Registry holds a single genesis committee for now — dynamic committee support deferred until execution layer is ready - Add EpochFor(RoadIndex) and VerifyInWindow for epoch-transition message acceptance - Per-epoch vote accumulation in avail: laneQCs returns one QC per epoch in window; WaitForLaneQCs takes an epoch.Index so consensus always gets the matching QC - Fix sei-db blocksim and block_db_test to match updated autobahn type signatures (GlobalRange, NewProposal, NewRoundRobinElection) introduced by concurrent main commits Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ab4c67c to
9cce5d2
Compare
…olute everywhere - Remove firstBlock parameter from GlobalRange(), BlockTimestamp(), and related Verify() methods; store it in Proposal at construction time - Add global_first (optional uint64, field 6) to pb.Proposal so the epoch offset survives encode/decode round-trips; regenerate pb files - Add ViewSpec.FirstBlock and NextGlobalBlock() so callers no longer pass firstBlock at every call site — oncall reads absolute numbers - Remove GlobalRangeOpt (footgun: returned 0 when CommitQC absent, wrong for non-genesis epochs); replace call sites with explicit .Get() - Add types.BuildCommitQC test helper; remove BuildFullCommitQC (each caller owns its own block generation) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6b591bc. Configure here.
4b08607 to
f1f1d55
Compare
…).First GlobalRange().First is sum(lane.First)+firstBlock. Passing it as the firstBlock argument to newProposal would add it on top of the lane sum again, doubling the offset. Use p.firstBlock (the raw epoch offset) instead. Reproposals happen when the chain is recovering after a halt — the path exercised by TestAutobahn/Recovery — so a wrong GlobalRange caused FullProposal.Verify to reject every reproposal, preventing recovery. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
f1f1d55 to
09e677e
Compare

Summary
epoch.Registrywhich consolidatesfirstBlockandgenesisTimestamp— genesis config that doesn't change across epochs — alongside the committeefirstBlockintoProposalsoGlobalRange()returns absolute block numbers directly, removing it as a call-site parameter throughout the stack. The proto message is now self-contained on the wire, making it much easier to interpret during emergency debugging. Also fixes a reproposal bug whereTimeoutQC.reproposal()was double-countingfirstBlockregistry.CommitteeFor(roadIndex). The registry currently returns the genesis committee for all RoadIndexes — we wire the read side first so that any bug introduced when implementing dynamic epochs in follow-up PRs is immediately visible at the call sites rather than requiring a cascading refactor to find it🤖 Generated with Claude Code