Clarify import sequence of child FULL

This commit is contained in:
dapplion
2026-06-01 07:14:30 +02:00
parent a70a120d55
commit efa02ede46
7 changed files with 89 additions and 84 deletions

View File

@@ -70,7 +70,7 @@ use bls::{PublicKey, PublicKeyBytes};
use educe::Educe;
use eth2::types::{BlockGossip, EventKind};
use execution_layer::PayloadStatus;
pub use fork_choice::{AttestationFromBlock, PayloadVerificationStatus};
pub use fork_choice::{AttestationFromBlock, ParentImportedStatus, PayloadVerificationStatus};
use metrics::TryExt;
use parking_lot::RwLockReadGuard;
use proto_array::Block as ProtoBlock;
@@ -882,13 +882,6 @@ impl<T: BeaconChainTypes> GossipVerifiedBlock<T> {
});
}
// TODO(gloas) The following validation can only be completed once fork choice has been implemented:
// The block's parent execution payload (defined by bid.parent_block_hash) has been seen
// (via gossip or non-gossip sources) (a client MAY queue blocks for processing
// once the parent payload is retrieved). If execution_payload verification of block's execution
// payload parent by an execution node is complete, verify the block's execution payload
// parent (defined by bid.parent_block_hash) passes all validation.
drop(fork_choice_read_lock);
// Track the number of skip slots between the block and its parent.
@@ -1869,12 +1862,18 @@ fn verify_parent_block_is_known<T: BeaconChainTypes>(
fork_choice_read_lock: &RwLockReadGuard<BeaconForkChoice<T>>,
block: Arc<SignedBeaconBlock<T::EthSpec>>,
) -> Result<(ProtoBlock, Arc<SignedBeaconBlock<T::EthSpec>>), BlockError> {
if let Some(proto_block) = fork_choice_read_lock.get_block(&block.parent_root()) {
Ok((proto_block, block))
} else {
Err(BlockError::ParentUnknown {
parent_root: block.parent_root(),
})
// The block's parent execution payload (defined by bid.parent_block_hash) has been seen
// (via gossip or non-gossip sources) (a client MAY queue blocks for processing
// once the parent payload is retrieved). If execution_payload verification of block's execution
// payload parent by an execution node is complete, verify the block's execution payload
// parent (defined by bid.parent_block_hash) passes all validation.
match fork_choice_read_lock.is_parent_imported(&block) {
ParentImportedStatus::Imported(parent) => Ok((parent, block)),
ParentImportedStatus::UnknownBlock | ParentImportedStatus::UnimportedPayload => {
Err(BlockError::ParentUnknown {
parent_root: block.parent_root(),
})
}
}
}

View File

@@ -85,7 +85,7 @@ pub use beacon_fork_choice_store::{
};
pub use block_verification::{
BlockError, ExecutionPayloadError, ExecutionPendingBlock, GossipVerifiedBlock,
IntoExecutionPendingBlock, IntoGossipVerifiedBlock, InvalidSignature,
IntoExecutionPendingBlock, IntoGossipVerifiedBlock, InvalidSignature, ParentImportedStatus,
PayloadVerificationOutcome, PayloadVerificationStatus, build_blob_data_column_sidecars,
get_block_root, signature_verify_chain_segment,
};