This commit is contained in:
Eitan Seri-Levi
2026-06-15 14:25:27 +03:00
parent 180aee1fdc
commit 3dd6be37b0
3 changed files with 13 additions and 14 deletions

View File

@@ -3001,16 +3001,15 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
}
}
let is_envelope_relevant = if let Some(envelope) = block.as_envelope() {
// If the envelope is relevant we skip the duplicate import check in
// `check_block_relevancy`
match check_envelope_relevancy(block.as_block(), envelope, self) {
Ok(_) => true,
Err(_) => false,
}
} else {
false
};
// If the envelope is relevant we skip the duplicate import check in
// `check_block_relevancy`. A verification error or an already-received payload
// both leave the envelope irrelevant.
let is_envelope_relevant = block
.as_envelope()
.and_then(|envelope| {
check_envelope_relevancy(block.as_block(), envelope, self).ok()
})
.unwrap_or(false);
match check_block_relevancy(block.as_block(), block_root, is_envelope_relevant, self) {
// If the block is relevant, add it to the filtered chain segment.

View File

@@ -1881,7 +1881,7 @@ pub fn check_block_relevancy<T: BeaconChainTypes>(
// Check if the block is already known. We know it is post-finalization, so it is
// sufficient to check the fork choice. This check can optionally be skipped.
if skip_import_check
if !skip_import_check
&& chain
.canonical_head
.fork_choice_read_lock()

View File

@@ -293,10 +293,10 @@ pub(crate) fn load_snapshot_from_state_root<T: BeaconChainTypes>(
/// Performs simple, cheap checks to ensure that the envelope is relevant to be imported.
///
/// `Ok(block_root` is returned if the envelope passes these checks and should progress with
/// verification.
/// Returns `Ok(true)` if the envelope passes these checks and should progress with verification,
/// or `Ok(false)` if its payload has already been received and is no longer relevant.
///
/// Returns an error if the envelope is not relevant or if an error occurs during a verification step.
/// Returns an error if a verification step fails.
pub fn check_envelope_relevancy<T: BeaconChainTypes>(
block: &SignedBeaconBlock<T::EthSpec>,
signed_envelope: &SignedExecutionPayloadEnvelope<T::EthSpec>,