This commit is contained in:
Eitan Seri-Levi
2026-05-04 16:33:31 +03:00
3 changed files with 39 additions and 6 deletions

View File

@@ -3076,7 +3076,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 }) => {

View File

@@ -850,12 +850,13 @@ where
It is highly recommended to purge your db and checkpoint sync. For more information please \
read this blog post: https://blog.ethereum.org/2014/11/25/proof-stake-learned-love-weak-subjectivity"
)
} else {
return Err(
"The current head state is outside the weak subjectivity period. A node in this state is susceptible to long range attacks. You should purge your db and \
checkpoint sync. For more information please read this blog post: https://blog.ethereum.org/2014/11/25/proof-stake-learned-love-weak-subjectivity \
If you understand the risks, it is possible to ignore this error with the --ignore-ws-check flag.".to_string()
);
}
return Err(
"The current head state is outside the weak subjectivity period. A node in this state is susceptible to long range attacks. You should purge your db and \
checkpoint sync. For more information please read this blog post: https://blog.ethereum.org/2014/11/25/proof-stake-learned-love-weak-subjectivity \
If you understand the risks, it is possible to ignore this error with the --ignore-ws-check flag.".to_string()
);
}
let validator_pubkey_cache = self

View File

@@ -866,6 +866,16 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
peer_action: Some(PeerAction::LowToleranceError),
})
}
BlockError::ParentEnvelopeUnknown { parent_root } => {
Err(ChainSegmentFailed {
message: format!(
"Block's parent envelope has not been received: {}",
parent_root
),
// Don't penalize the peer, the envelope may arrive later.
peer_action: None,
})
}
BlockError::DuplicateFullyImported(_)
| BlockError::DuplicateImportStatusUnknown(..) => {
// This can happen for many reasons. Head sync's can download multiples and parent