Repository navigation
Conversation
e412beb to
9e1fa26
Compare
…find a parent block root
9e1fa26 to
403bf62
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The narrow change uses the existing backoff mechanism, preserves corruption handling, and includes focused regression coverage.
No open issues 🎉
What changed in this PR
This PR addresses #25239 by routing missing parent-block index entries into the antiquary’s existing historical-state backoff path. It builds on #25211 without attempting to rebuild the block index.
Changes:
- Adds
ErrMissingParentBlockwhile preserving hard errors for malformed genesis-root rows. - Makes the antiquary recognize the sentinel as a reason to back off.
- Adds regression coverage for sentinel propagation, corruption handling, and backoff classification.
| File | Description |
|---|---|
cl/persistence/state/historical_states_reader/historical_states_reader.go |
Defines and returns the missing-parent sentinel; distinguishes malformed genesis roots. |
cl/persistence/state/historical_states_reader/historical_states_reader_test.go |
Tests missing-parent errors, wrapping, and malformed genesis-root handling. |
cl/antiquary/state_antiquary.go |
Adds the sentinel to the existing backoff classifier. |
cl/antiquary/state_antiquary_test.go |
Extends backoff classification coverage to missing-parent errors. |
Review effort: Balanced
|
Closing. A missing |
Fixes #25239. Stacked on #25211.
Problem
ReadParticipationsresolves the parent of every Gloas block that has attestations throughkv.BlockRootToSlot. When that entry is missing and the parent is not the genesis block, it returned a plain error.initializeStateAntiquaryIfNeededtreated it as fatal, so the state antiquary could not start from that resume point.Change
ReadParticipationsreturns the newErrMissingParentBlocksentinel when the parent root is neither in the block index nor the genesis block root. A genesis root row that is present but not 32 bytes long stays a hard error (invalid genesis block root length), the same as other corrupt root rows.initializeStateAntiquaryIfNeededbacks off onErrMissingParentBlock, the same as onErrMissingGloasDataandErrMissingHistoryVectorData. The check moved intoshouldBackoffHistoricalStateRead.Backing off only moves the resume point to a state before the gap. The antiquary does not write
kv.BlockRootToSlot, so this does not rebuild the block index.Tests
TestReadParticipationsReturnsMissingParentBlockError: missing index entry with a non-genesis parent returns the sentinel.TestReadParticipationsReturnsMalformedGenesisRootError: a 31-byte genesis root returns the length error, not the sentinel.TestReadHistoricalStateReturnsMissingParentBlockError: the sentinel survives the%wwrap inReadHistoricalState.TestShouldBackoffHistoricalStateRead: classification, including a wrapped sentinel.There is no end-to-end test through
initializeStateAntiquaryIfNeeded: the Gloas fixtures are a few slots long and cannot reach the first backoff step of 10 *SlotsPerDumpslots.Not in this PR
The backoff loop in
initializeStateAntiquaryIfNeededdoes not checkctxbetween attempts. This is the same for every backoff sentinel and predates this change.