address changes

This commit is contained in:
Eitan Seri- Levi
2026-02-25 23:45:42 -08:00
parent afbba87a64
commit 76109327bc
3 changed files with 25 additions and 34 deletions

View File

@@ -248,7 +248,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
///
/// ## Errors
///
/// Returns an `Err` if the given envelope was invalid, or an error was encountered during
/// Returns an `Err` if the given envelope was invalid, or an error was encountered during verification.
pub async fn verify_envelope_for_gossip(
self: &Arc<Self>,
envelope: Arc<SignedExecutionPayloadEnvelope<T::EthSpec>>,

View File

@@ -256,6 +256,9 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
return Err(EnvelopeError::BlockRootUnknown { block_root });
}
// TODO(gloas) when the code below is implemented we can delete this drop
drop(fork_choice_reader);
// TODO(gloas) no fork choice logic yet
// Take an exclusive write-lock on fork choice. It's very important to prevent deadlocks by
// avoiding taking other locks whilst holding this lock.
@@ -323,6 +326,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
error = ?e,
"Database write failed!"
);
return Err(e.into());
// TODO(gloas) handle db write failure
// return Err(self
// .handle_import_block_db_write_error(fork_choice)

View File

@@ -54,7 +54,7 @@ pub struct AvailableEnvelope<E: EthSpec> {
execution_block_hash: ExecutionBlockHash,
envelope: Arc<SignedExecutionPayloadEnvelope<E>>,
columns: DataColumnSidecarList<E>,
/// Timestamp at which this block first became available (UNIX timestamp, time since 1970).
/// Timestamp at which this envelope first became available (UNIX timestamp, time since 1970).
columns_available_timestamp: Option<std::time::Duration>,
pub spec: Arc<ChainSpec>,
}
@@ -86,7 +86,7 @@ pub enum MaybeAvailableEnvelope<E: EthSpec> {
},
}
/// This snapshot is to be used for verifying a envelope of the block.
/// This snapshot is to be used for verifying a payload envelope.
#[derive(Debug, Clone)]
pub struct EnvelopeProcessingSnapshot<E: EthSpec> {
/// This state is equivalent to the `self.beacon_block.state_root()` before applying the envelope.
@@ -158,54 +158,41 @@ impl<E: EthSpec> AvailableExecutedEnvelope<E> {
#[derive(Debug)]
pub enum EnvelopeError {
/// The envelope's block root is unknown.
BlockRootUnknown {
block_root: Hash256,
},
BlockRootUnknown { block_root: Hash256 },
/// The signature is invalid.
BadSignature,
/// The builder index doesn't match the committed bid
BuilderIndexMismatch {
committed_bid: u64,
envelope: u64,
},
// The envelope slot doesn't match the block
SlotMismatch {
block: Slot,
envelope: Slot,
},
// The validator index is unknown
UnknownValidator {
builder_index: u64,
},
// The block hash doesn't match the committed bid
BuilderIndexMismatch { committed_bid: u64, envelope: u64 },
/// The envelope slot doesn't match the block
SlotMismatch { block: Slot, envelope: Slot },
/// The validator index is unknown
UnknownValidator { builder_index: u64 },
/// The block hash doesn't match the committed bid
BlockHashMismatch {
committed_bid: ExecutionBlockHash,
envelope: ExecutionBlockHash,
},
// The block's proposer_index does not match the locally computed proposer
IncorrectBlockProposer {
block: u64,
local_shuffling: u64,
},
// The slot belongs to a block that is from a slot prior than
// the most recently finalized slot
/// The block's proposer_index does not match the locally computed proposer
IncorrectBlockProposer { block: u64, local_shuffling: u64 },
/// The slot belongs to a block that is from a slot prior than
/// to most recently finalized slot
PriorToFinalization {
payload_slot: Slot,
latest_finalized_slot: Slot,
},
// Some Beacon Chain Error
/// Some Beacon Chain Error
BeaconChainError(Arc<BeaconChainError>),
// Some Beacon State error
/// Some Beacon State error
BeaconStateError(BeaconStateError),
// Some BlockProcessingError (for electra operations)
/// Some BlockProcessingError (for electra operations)
BlockProcessingError(BlockProcessingError),
// Some EnvelopeProcessingError
/// Some EnvelopeProcessingError
EnvelopeProcessingError(EnvelopeProcessingError),
// Error verifying the execution payload
/// Error verifying the execution payload
ExecutionPayloadError(ExecutionPayloadError),
// An error from block-level checks reused during envelope import
/// An error from block-level checks reused during envelope import
BlockError(BlockError),
// Internal error
/// Internal error
InternalError(String),
}