test: enable `light_client/data_collection` spec tests #10792
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.40) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 278 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.337
Real PR Conversation Timeline
1 comments
"Review active on #10792"
general
weight: 0.35
JackCC703
Part of #7348
working on decentralized CL sync with Etan (@etan-status), which needs Lodestar to pass the light_client/data_collection spec tests
Motivation
light_client/data_collectionhas been skipped since the tests were introduced by consensus-specs#3553 (canonical-only light client data collection, shipped in v1.5.0-beta.0). The suite imports blocks, moves the head across branches, and checks the bootstraps, the best update per sync committee period, the latest finality and optimistic updates, and the latest finalized checkpoint after every head change.LightClientServercould not be driven that way: it derived and stored data as blocks were imported, and had no notion of the head moving to another branch.Changes
refactor(lightclient): split collection from canonical selection. Collection keeps a per block cache, including the best update derivable along each block's branch. A newupdateHead(headBlockRoot, finalizedCheckpoint)reconciles the served best update per period, which may now also be removed, and recomputes the latest finality and optimistic updates from the given head. A newinitAnchorregisters a block that is never imported, such as genesis.updateHeadandinitAnchorhave no caller outside the tests yet, so served data on a linear chain is the same as before. The per block cache that replaces the previous 32 entry map is pruned on import below the highest finalized block seen, with a cap of 4 sync committee periods while finality stalls.test: add thedata_collectionhandler and remove the skip. The handler replays the vectors throughstateTransitionon a real database, drivesupdateHeadfrom thenew_headsteps, and registers genesis throughinitAnchor. The chain config parsing is shared with thesynchandler.test: build the genesis block with the existingcreateGenesisBlock.Wiring
updateHeadandinitAnchorinto the node, so that served data actually follows fork choice in production, is left for a follow-up PR that closes #7348.Testing
light_clientspec tests, minimal preset: 97/97, includingdata_collection11/11light_clientspec tests, mainnet preset: 27/27test/unit/chain/lightclient: 84/84