mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 12:47:05 +00:00
Hack for checkpoint sync
This commit is contained in:
@@ -3041,7 +3041,29 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
// In the case of (2), skipping the block is valid since we should never import it.
|
||||
// However, we will potentially get a `ParentUnknown` on a later block. The sync
|
||||
// protocol will need to ensure this is handled gracefully.
|
||||
Err(BlockError::WouldRevertFinalizedSlot { .. }) => continue,
|
||||
Err(BlockError::WouldRevertFinalizedSlot { .. }) => {
|
||||
// For Gloas blocks, persist the envelope even though we're skipping
|
||||
// the block. This is needed after checkpoint sync: the checkpoint
|
||||
// block's envelope must be in the store so that `load_parent` can
|
||||
// verify it when importing the first post-checkpoint block.
|
||||
if let RangeSyncBlock::Gloas {
|
||||
envelope: Some(ref available_envelope),
|
||||
..
|
||||
} = block
|
||||
{
|
||||
let (signed_envelope, _columns) = available_envelope.clone().deconstruct();
|
||||
if let Err(e) = self
|
||||
.store
|
||||
.put_payload_envelope(&block_root, &signed_envelope)
|
||||
{
|
||||
return Err(Box::new(ChainSegmentResult::Failed {
|
||||
imported_blocks,
|
||||
error: BlockError::BeaconChainError(Box::new(e.into())),
|
||||
}));
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// The block has a known parent that does not descend from the finalized block.
|
||||
// There is no need to process this block or any children.
|
||||
Err(BlockError::NotFinalizedDescendant { block_parent_root }) => {
|
||||
|
||||
@@ -2017,10 +2017,11 @@ fn load_parent<T: BeaconChainTypes, B: AsBlock<T::EthSpec>>(
|
||||
// If the parent's execution payload envelope hasn't arrived yet,
|
||||
// return an unknown parent error so the block gets sent to the
|
||||
// reprocess queue.
|
||||
if chain
|
||||
.spec
|
||||
.fork_name_at_slot::<T::EthSpec>(parent_block.slot())
|
||||
.gloas_enabled()
|
||||
if parent_block.slot() != 0
|
||||
&& chain
|
||||
.spec
|
||||
.fork_name_at_slot::<T::EthSpec>(parent_block.slot())
|
||||
.gloas_enabled()
|
||||
{
|
||||
let _envelope = chain
|
||||
.store
|
||||
|
||||
Reference in New Issue
Block a user