-
-
Notifications
You must be signed in to change notification settings - Fork 451
feat: unskip gloas fork choice spec tests #9222
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
base: unstable
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -641,10 +641,7 @@ export class ForkChoice implements IForkChoice { | |
| // Check block is a descendant of the finalized block at the checkpoint finalized slot. | ||
| const blockAncestorNode = this.getAncestor(parentRootHex, finalizedSlot); | ||
| const fcStoreFinalized = this.fcStore.finalizedCheckpoint; | ||
| if ( | ||
| blockAncestorNode.blockRoot !== fcStoreFinalized.rootHex || | ||
| blockAncestorNode.payloadStatus !== fcStoreFinalized.payloadStatus | ||
|
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. We remove the payload status comparison because we don't know the payload status of the finalized checkpoint (both before and after deferring payload processing). We should just compare the root only. |
||
| ) { | ||
| if (blockAncestorNode.blockRoot !== fcStoreFinalized.rootHex) { | ||
|
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.
The finalized-descendant gate in Useful? React with 👍 / 👎. |
||
| throw new ForkChoiceError({ | ||
| code: ForkChoiceErrorCode.INVALID_BLOCK, | ||
| err: { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,6 +114,22 @@ export class ProtoArray { | |
| // 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))); | ||
|
|
||
| // Anchor block must have FULL variant per spec get_forkchoice_store: | ||
| // payload_states = {anchor_root: anchor_state.copy()} | ||
| // This means the anchor's "payload" is considered received (the anchor state IS the post-payload state). | ||
| // Without FULL, blocks extending FULL from the anchor would be orphaned. | ||
| if (block.executionPayloadBlockHash !== null) { | ||
|
Contributor
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.
Contributor
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. we can merge for the sake of passing spec tests |
||
| protoArray.onExecutionPayload( | ||
| block.blockRoot, | ||
| currentSlot, | ||
| block.executionPayloadBlockHash, | ||
| (block as {executionPayloadNumber?: number}).executionPayloadNumber ?? 0, | ||
| block.stateRoot, | ||
| null, | ||
| ExecutionStatus.Valid | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| return protoArray; | ||
|
|
||

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.
There's some code duplication here for determining
justifiedPayloadStatusandfinalizedPayloadStatus. You can introduce a helper function to centralize the logic, which improves maintainability by avoiding repetition of theisForkPostGloascheck.