Skip to content

Commit 6e59a7b

Browse files
committed
fix: preserve anchor FULL variant seeding in ProtoArray.initialize
Per bot review feedback on PR: removing the `onExecutionPayload(anchor, ...)` call alongside the PTC vote override broke block production after restart from a post-Gloas anchor. `shouldExtendPayload(anchorRoot)` (used in #9209) short- circuits to false via `!hasPayload()`, so `produceBlockBody`/`prepareNextSlot` pick `latestExecutionPayloadBid.parentBlockHash` instead of `.blockHash`, producing bids that fail `processExecutionPayloadBid`'s parent-hash check. Upstream consensus-specs `c7a0a8527` removes only the PTC vote seeding (`payload_timeliness_vote={}`, `payload_data_availability_vote={}`) — it does not remove the FULL-payload semantics of the anchor. The anchor state's `latestBlockHash` is the executed payload hash, so `onExecutionPayload(anchor)` still matches the spec's intent of `payload_states = {anchor_root: ...}`. Keep the PTC vote override removal (the actual subject of this PR); restore the FULL-variant seeding with a focused comment. 🤖 Generated with AI assistance
1 parent b86b6b2 commit 6e59a7b

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

packages/fork-choice/src/protoArray/protoArray.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,21 @@ export class ProtoArray {
109109
null
110110
);
111111

112+
// Gloas: seed the anchor's FULL variant so `shouldExtendPayload(anchor)` is true
113+
// for block production; otherwise bids after restart use `bid.parentBlockHash`
114+
// and fail `processExecutionPayloadBid`'s parent-hash check.
115+
if (isGloasBlock(block as ProtoBlock) && block.executionPayloadBlockHash !== null) {
116+
protoArray.onExecutionPayload(
117+
block.blockRoot,
118+
currentSlot,
119+
block.executionPayloadBlockHash,
120+
(block as {executionPayloadNumber?: number}).executionPayloadNumber ?? 0,
121+
block.stateRoot,
122+
null,
123+
ExecutionStatus.Valid
124+
);
125+
}
126+
112127
return protoArray;
113128
}
114129

0 commit comments

Comments
 (0)