Verify terminal PoW block after call to state_transition #2595
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's done?
Switches the order of terminal PoW block verification and the
state_transition
call in theon_block
handler of the fork choice.This change has the following implications:
state_transition
call either all dependencies of the execution payload must be resolved (meaning that ancestors of the execution payload must be pulled from the network and processed) or the block processing is delayedstate_transition
call, when the terminal PoW block verification reached all the ancestors of the execution payload must be deemed as valid, otherwise, the state transition function would deem the beacon block as invalidengine_executePayload
methodis_processed
andis_valid
statuses of the PoW blocketh_getBlockByHash
JSON-RPC call is sufficiently enough to get the PoW block data, no need to implement extra methodThanks to @djrtwo and @MicahZoltu for the idea of this change