mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +00:00
Revert changes in load_parent
This commit is contained in:
@@ -1961,13 +1961,13 @@ fn load_parent<T: BeaconChainTypes, B: AsBlock<T::EthSpec>>(
|
|||||||
{
|
{
|
||||||
if block.as_block().is_parent_block_full(parent_bid_block_hash) {
|
if block.as_block().is_parent_block_full(parent_bid_block_hash) {
|
||||||
// TODO(gloas): loading the envelope here is not very efficient
|
// TODO(gloas): loading the envelope here is not very efficient
|
||||||
if let Some(envelope) = chain.store.get_payload_envelope(&root)? {
|
// TODO(gloas): check parent payload existence prior to this point?
|
||||||
(StatePayloadStatus::Full, envelope.message.state_root)
|
let envelope = chain.store.get_payload_envelope(&root)?.ok_or_else(|| {
|
||||||
} else {
|
BeaconChainError::DBInconsistent(format!(
|
||||||
// The envelope hasn't been stored yet (e.g. genesis block, or payload
|
"Missing envelope for parent block {root:?}",
|
||||||
// not yet delivered). Fall back to the pending/empty state.
|
))
|
||||||
(StatePayloadStatus::Pending, parent_block.state_root())
|
})?;
|
||||||
}
|
(StatePayloadStatus::Full, envelope.message.state_root)
|
||||||
} else {
|
} else {
|
||||||
(StatePayloadStatus::Pending, parent_block.state_root())
|
(StatePayloadStatus::Pending, parent_block.state_root())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user