This commit is contained in:
hopinheimer
2026-03-16 07:00:51 -04:00
parent 0df749f0a2
commit 916d9fb018
5 changed files with 50 additions and 23 deletions

View File

@@ -1961,12 +1961,13 @@ fn load_parent<T: BeaconChainTypes, B: AsBlock<T::EthSpec>>(
{
if block.as_block().is_parent_block_full(parent_bid_block_hash) {
// TODO(gloas): loading the envelope here is not very efficient
let envelope = chain.store.get_payload_envelope(&root)?.ok_or_else(|| {
BeaconChainError::DBInconsistent(format!(
"Missing envelope for parent block {root:?}",
))
})?;
(StatePayloadStatus::Full, envelope.message.state_root)
if let Some(envelope) = chain.store.get_payload_envelope(&root)? {
(StatePayloadStatus::Full, envelope.message.state_root)
} else {
// The envelope hasn't been stored yet (e.g. genesis block, or payload
// not yet delivered). Fall back to the pending/empty state.
(StatePayloadStatus::Pending, parent_block.state_root())
}
} else {
(StatePayloadStatus::Pending, parent_block.state_root())
}