process_execution_envelope

This commit is contained in:
Mark Mackey
2024-11-14 11:23:10 -06:00
parent fd140038c5
commit cd7b3cfa2d
8 changed files with 244 additions and 8 deletions

View File

@@ -482,7 +482,7 @@ where
)]
#[metastruct(exclude_from(tree_lists))]
pub latest_execution_payload_header: ExecutionPayloadHeaderElectra<E>,
#[superstruct(only(EIP7732), partial_getter(rename = "latest_execution_bid_eip7732"))]
#[superstruct(only(EIP7732))]
#[metastruct(exclude_from(tree_lists))]
pub latest_execution_bid: ExecutionBid,
@@ -1982,6 +1982,19 @@ impl<E: EthSpec> BeaconState<E> {
}
}
pub fn is_parent_block_full(&self) -> bool {
match self {
BeaconState::Base(_) | BeaconState::Altair(_) => false,
BeaconState::Bellatrix(_)
| BeaconState::Capella(_)
| BeaconState::Deneb(_)
| BeaconState::Electra(_) => true,
BeaconState::EIP7732(state) => {
state.latest_execution_bid.block_hash == state.latest_block_hash
}
}
}
/// Get the committee cache for some `slot`.
///
/// Return an error if the cache for the slot's epoch is not initialized.

View File

@@ -48,3 +48,5 @@ pub struct ExecutionEnvelope<E: EthSpec> {
pub payment_withheld: bool,
pub state_root: Hash256,
}
impl<E: EthSpec> SignedRoot for ExecutionEnvelopeEIP7732<E> {}