-
-
Notifications
You must be signed in to change notification settings - Fork 457
refactor: revert dual-state from regen, block production, and metrics #9218
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
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 |
|---|---|---|
|
|
@@ -70,7 +70,7 @@ import {ChainEvent, CommonBlockBody} from "../../../chain/index.js"; | |
| import {PREPARE_NEXT_SLOT_BPS} from "../../../chain/prepareNextSlot.js"; | ||
| import {BlockType, ProduceFullDeneb, ProduceFullGloas} from "../../../chain/produceBlock/index.js"; | ||
| import {RegenCaller} from "../../../chain/regen/index.js"; | ||
| import {CheckpointHexPayload} from "../../../chain/stateCache/types.js"; | ||
| import {CheckpointHex} from "../../../chain/stateCache/types.js"; | ||
| import {validateApiAggregateAndProof} from "../../../chain/validation/index.js"; | ||
| import {validateSyncCommitteeGossipContributionAndProof} from "../../../chain/validation/syncCommitteeContributionAndProof.js"; | ||
| import {ZERO_HASH} from "../../../constants/index.js"; | ||
|
|
@@ -301,7 +301,7 @@ export function getValidatorApi( | |
| * | | ||
| * prepareNextSlot (4s before next slot) | ||
| */ | ||
| async function waitForCheckpointState(cpHex: CheckpointHexPayload): Promise<IBeaconStateView | null> { | ||
| async function waitForCheckpointState(cpHex: CheckpointHex): Promise<IBeaconStateView | null> { | ||
| const cpState = chain.regen.getCheckpointStateSync(cpHex); | ||
| if (cpState) { | ||
| return cpState; | ||
|
|
@@ -1113,7 +1113,6 @@ export function getValidatorApi( | |
| const cpState = await waitForCheckpointState({ | ||
| rootHex: head.blockRoot, | ||
| epoch, | ||
| payloadPresent: head.payloadStatus === PayloadStatus.FULL, | ||
| }); | ||
| if (cpState) { | ||
| state = cpState; | ||
|
|
@@ -1642,15 +1641,17 @@ export function getValidatorApi( | |
| throw Error("Cached block production result is not full block"); | ||
| } | ||
|
|
||
| const {executionPayload, executionRequests, payloadEnvelopeStateRoot} = produceResult as ProduceFullGloas; | ||
| const {executionPayload, executionRequests} = produceResult as ProduceFullGloas; | ||
|
|
||
| const envelope: gloas.ExecutionPayloadEnvelope = { | ||
| payload: executionPayload, | ||
| executionRequests: executionRequests, | ||
| builderIndex: BUILDER_INDEX_SELF_BUILD, | ||
| beaconBlockRoot, | ||
| slot, | ||
| stateRoot: payloadEnvelopeStateRoot, | ||
| // TODO GLOAS: stateRoot is no longer computed during block production. | ||
| // This field will be removed when we implement defer payload processing | ||
| stateRoot: ZERO_HASH, | ||
|
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.
Useful? React with 👍 / 👎. |
||
| }; | ||
|
|
||
| logger.info("Produced execution payload envelope", { | ||
|
|
||
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.
Setting
stateRoottoZERO_HASHin theExecutionPayloadEnvelopewill cause validation failures during payload import on other nodes (or even the same node if re-imported). TheimportExecutionPayloadfunction still performs a strict check comparing the envelope'sstateRootagainst the computedpostPayloadStateRoot. If the intention is to defer payload processing and avoid computing the state root during production, the importer must also be updated to skip this verification for Gloas blocks, otherwise this change breaks Gloas block production and import.