-
-
Notifications
You must be signed in to change notification settings - Fork 457
fix: revert anchor block PTC vote override #9244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b86b6b2
6e59a7b
1681b0d
0d92ce8
47f27f4
7477fb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -109,30 +109,6 @@ export class ProtoArray { | |
| null | ||
| ); | ||
|
|
||
| // Anchor block PTC votes must be all-true per spec get_forkchoice_store: | ||
| // payload_timeliness_vote={anchor_root: Vector[boolean, PTC_SIZE](True for _ in range(PTC_SIZE))} | ||
| // Spec: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.4/specs/gloas/fork-choice.md#modified-get_forkchoice_store | ||
| if (protoArray.ptcVotes.has(block.blockRoot)) { | ||
| protoArray.ptcVotes.set(block.blockRoot, BitArray.fromBoolArray(Array.from({length: PTC_SIZE}, () => true))); | ||
|
|
||
| // In the spec, we have payload_states = {anchor_root: anchor_state.copy()} | ||
| // which means the anchor's "payload" is considered received | ||
| // Without FULL, blocks extending FULL from the anchor would be orphaned. | ||
| // TODO GLOAS: This is a bug in the spec. Keep this to pass the current spec test | ||
| // for now. Need to remove this when we work on v1.7.0-alpha.5 | ||
| if (block.executionPayloadBlockHash !== null) { | ||
| protoArray.onExecutionPayload( | ||
| block.blockRoot, | ||
| currentSlot, | ||
| block.executionPayloadBlockHash, | ||
| (block as {executionPayloadNumber?: number}).executionPayloadNumber ?? 0, | ||
| block.stateRoot, | ||
| null, | ||
| ExecutionStatus.Valid | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| return protoArray; | ||
|
Comment on lines
109
to
112
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
By returning immediately after Useful? React with 👍 / 👎.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed — traced the call chain and this is a real regression. Pushed 6e59a7b restoring the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this needs to be handled by sync
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed — reverted in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Walking this back — pushed |
||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While reverting the PTC vote override is correct per the updated spec (commit
c7a0a8527), removing theonExecutionPayloadcall for the anchor block introduces a regression.According to the Gloas spec for
get_forkchoice_store,payload_statesmust be initialized with{anchor_root: PAYLOAD_STATUS_FULL}. In the context ofProtoArray, this means the anchor block must have aFULLvariant. If it only hasPENDINGandEMPTYvariants (the default fromonBlock), any subsequent block that attempts to extend the anchor'sFULLvariant will fail to find its parent ingetBlockHexAndBlockHashand will be treated as an orphan.The
onExecutionPayloadcall should be preserved to ensure the anchor block is correctly initialized with its payload state.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch — you're right, pushed 6e59a7b restoring the
onExecutionPayload(anchor, …)seeding. Upstreamc7a0a8527only removes the PTC vote seeding (payload_timeliness_vote={}/payload_data_availability_vote={}); it doesn't change the semantics of the anchor's payload being considered executed. The anchor state'slatestBlockHashis the hash of the executed payload, so marking the anchor's FULL variant here still matches the spec's intent ofpayload_states = {anchor_root: anchor_state.copy()}.Scope of this PR is now narrowed back to exactly what the upstream spec fix requires: dropping the 8-line PTC vote override only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Walking this back — pushed
1681b0dreverting the seeding. Pernflaig's follow-up and re-readingconsensus-specsmaster:get_forkchoice_storenow haspayloads={},is_payload_verifiedis literallyroot in store.payloads, andshould_extend_payloadshort-circuits onnot is_payload_verified. So the anchor is deliberately unseeded by spec; our!hasPayload()guard already matches that. The block-production consequence is expected to be resolved by sync building up FULL variants as envelopes arrive for post-anchor blocks. Sorry for the initial direction flip.