rpc(autobahn): return the committee that certified /validators height (CON-358) - #4083
rpc(autobahn): return the committee that certified /validators height (CON-358)#4083wen-coding wants to merge 2 commits into
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
fb811a2 to
aba1714
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4083 +/- ##
==========================================
- Coverage 61.30% 60.26% -1.05%
==========================================
Files 2178 2070 -108
Lines 190788 178331 -12457
==========================================
- Hits 116968 107474 -9494
+ Misses 62796 60872 -1924
+ Partials 11024 9985 -1039
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Replacing the genesis-set stub in Autobahn's /validators with a CommitQC → epoch-registry lookup is correct: the QC covering the global height picks the certifying committee, the pre-first-QC fallback to nextCommitEpoch is sound, and the router-level test covers the resolved height, omitted height, uncertified height, power ordering and pruned-epoch cases. No blocking issues; the notes below concern the availability window the epoch registry imposes and a duplicated error mapping.
Findings: 0 blocking | 3 non-blocking | 2 posted inline
Blockers
- None at the file/PR level.
Non-blocking
- [suggestion] Voting powers reported by
/validatorsnow change shape at the epoch-2 boundary: epochs 0/1 use the genesis committee built inBuildDataState, which assigns weight 1 per entry inValidatorAddrs, while epochs ≥2 usecommitteeWeights(app.GetValidators())(real stake). Previously the endpoint always echoedGenDocpowers. This is faithful to the committee that actually certified each block, but it is an externally visible response change the PR description doesn't mention — worth calling out for downstream consumers that compute stake fractions. - 2 suggestion(s)/nit(s) flagged inline on specific lines.
| } | ||
|
|
||
| // heightLookupError returns the RPC error for a data lookup at global height n. | ||
| func heightLookupError(n atypes.GlobalBlockNumber, err error) error { |
There was a problem hiding this comment.
[suggestion] BlockByNumber (line ~126) still maps atypes.ErrPruned → WrapErrHeightNotAvailable inline; its comment even claims "both call sites format through the same helper". Now that heightLookupError exists, routing BlockByNumber through it keeps the /block and /validators error shapes from drifting apart. The only wrinkle is the default arm: BlockByNumber wraps with data.GlobalBlock(%v): %w context while this helper returns the raw error — worth preserving that wrap at the call site if you consolidate.
47d5ae1 to
2cd026a
Compare
/validators still served the genesis validator list. Height is a global block number; the set comes from the covering CommitQC's epoch. Co-authored-by: Cursor <cursoragent@cursor.com>
2cd026a to
833db38
Compare
Summary
/validatorscurrently returns the genesisGenDocset at every height. After epoch 0 that is the wrong committee./block). The covering CommitQC supplies the road; the epoch registry supplies the committee. Before the first QC, omitted/first height resolve to genesis.ErrHeightNotAvailable; uncertified heights returnErrHeightExceedsChainHead.Test plan
go test ./internal/p2p/ ./internal/autobahn/data/ ./internal/rpc/core/in sei-tendermint/validators?height=hand omitted-height/validators(asserted inassertTmRPCEndpoints)Made with Cursor