Fix post-Bellatrix checkpoint sync (#4014)
* Recognise execution in post-merge blocks * Remove `.body()` * Fix typo * Use `is_default_with_empty_roots`.
This commit is contained in:
parent
eed7d65ce7
commit
1bce7a02c8
@ -413,18 +413,18 @@ where
|
|||||||
AttestationShufflingId::new(anchor_block_root, anchor_state, RelativeEpoch::Next)
|
AttestationShufflingId::new(anchor_block_root, anchor_state, RelativeEpoch::Next)
|
||||||
.map_err(Error::BeaconStateError)?;
|
.map_err(Error::BeaconStateError)?;
|
||||||
|
|
||||||
// Default any non-merge execution block hashes to 0x000..000.
|
let execution_status = anchor_block.message().execution_payload().map_or_else(
|
||||||
let execution_status = anchor_block.message_merge().map_or_else(
|
// If the block doesn't have an execution payload then it can't have
|
||||||
|()| ExecutionStatus::irrelevant(),
|
// execution enabled.
|
||||||
|message| {
|
|_| ExecutionStatus::irrelevant(),
|
||||||
let execution_payload = &message.body.execution_payload;
|
|execution_payload| {
|
||||||
if execution_payload == &<_>::default() {
|
if execution_payload.is_default_with_empty_roots() {
|
||||||
// A default payload does not have execution enabled.
|
// A default payload does not have execution enabled.
|
||||||
ExecutionStatus::irrelevant()
|
ExecutionStatus::irrelevant()
|
||||||
} else {
|
} else {
|
||||||
// Assume that this payload is valid, since the anchor should be a trusted block and
|
// Assume that this payload is valid, since the anchor should be a trusted block and
|
||||||
// state.
|
// state.
|
||||||
ExecutionStatus::Valid(message.body.execution_payload.block_hash())
|
ExecutionStatus::Valid(execution_payload.block_hash())
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user