diff --git a/beacon_node/beacon_chain/src/block_production/gloas.rs b/beacon_node/beacon_chain/src/block_production/gloas.rs index 74a9ddf419..b61f1583b6 100644 --- a/beacon_node/beacon_chain/src/block_production/gloas.rs +++ b/beacon_node/beacon_chain/src/block_production/gloas.rs @@ -29,10 +29,12 @@ use types::{ Address, Attestation, AttestationElectra, AttesterSlashing, AttesterSlashingElectra, BeaconBlock, BeaconBlockBodyGloas, BeaconBlockBodyHeze, BeaconBlockGloas, BeaconBlockHeze, BeaconState, BeaconStateError, BuilderIndex, ChainSpec, Deposit, Eth1Data, EthSpec, - ExecutionBlockHash, ExecutionPayloadBid, ExecutionPayloadEnvelope, ExecutionPayloadGloas, + ExecutionBlockHash, ExecutionPayloadBidGloas, ExecutionPayloadBidHeze, + ExecutionPayloadEnvelope, ExecutionPayloadGloas, ExecutionRequests, FullPayload, Graffiti, Hash256, PayloadAttestation, ProposerSlashing, - RelativeEpoch, SignedBeaconBlock, SignedBlsToExecutionChange, SignedExecutionPayloadBid, - SignedExecutionPayloadEnvelope, SignedVoluntaryExit, Slot, SyncAggregate, Withdrawal, + RelativeEpoch, SignedBeaconBlock, SignedBlsToExecutionChange, SignedExecutionPayloadBidGloas, + SignedExecutionPayloadBidHeze, SignedExecutionPayloadEnvelope, SignedVoluntaryExit, Slot, + SyncAggregate, Withdrawal, Withdrawals, }; @@ -512,7 +514,7 @@ impl BeaconChain { fn complete_partial_beacon_block_gloas( &self, partial_beacon_block: PartialBeaconBlock, - signed_execution_payload_bid: SignedExecutionPayloadBid, + signed_execution_payload_bid: SignedExecutionPayloadBidGloas, parent_execution_requests: ExecutionRequests, payload_data: Option>, mut state: BeaconState, @@ -584,42 +586,63 @@ impl BeaconChain { _phantom: PhantomData::>, }, }), - BeaconState::Heze(_) => BeaconBlock::Heze(BeaconBlockHeze { - slot, - proposer_index, - parent_root, - state_root: Hash256::ZERO, - body: BeaconBlockBodyHeze { - randao_reveal, - eth1_data, - graffiti, - proposer_slashings: proposer_slashings - .try_into() - .map_err(BlockProductionError::SszTypesError)?, - attester_slashings: attester_slashings - .try_into() - .map_err(BlockProductionError::SszTypesError)?, - attestations: attestations - .try_into() - .map_err(BlockProductionError::SszTypesError)?, - deposits: deposits - .try_into() - .map_err(BlockProductionError::SszTypesError)?, - voluntary_exits: voluntary_exits - .try_into() - .map_err(BlockProductionError::SszTypesError)?, - sync_aggregate, - bls_to_execution_changes: bls_to_execution_changes - .try_into() - .map_err(BlockProductionError::SszTypesError)?, - parent_execution_requests, - signed_execution_payload_bid, - payload_attestations: payload_attestations - .try_into() - .map_err(BlockProductionError::SszTypesError)?, - _phantom: PhantomData::>, - }, - }), + BeaconState::Heze(_) => { + let gloas_bid = signed_execution_payload_bid; + let heze_bid = SignedExecutionPayloadBidHeze { + message: ExecutionPayloadBidHeze { + parent_block_hash: gloas_bid.message.parent_block_hash, + parent_block_root: gloas_bid.message.parent_block_root, + block_hash: gloas_bid.message.block_hash, + prev_randao: gloas_bid.message.prev_randao, + fee_recipient: gloas_bid.message.fee_recipient, + gas_limit: gloas_bid.message.gas_limit, + builder_index: gloas_bid.message.builder_index, + slot: gloas_bid.message.slot, + value: gloas_bid.message.value, + execution_payment: gloas_bid.message.execution_payment, + blob_kzg_commitments: gloas_bid.message.blob_kzg_commitments, + execution_requests_root: gloas_bid.message.execution_requests_root, + inclusion_list_bits: Default::default(), + }, + signature: gloas_bid.signature, + }; + BeaconBlock::Heze(BeaconBlockHeze { + slot, + proposer_index, + parent_root, + state_root: Hash256::ZERO, + body: BeaconBlockBodyHeze { + randao_reveal, + eth1_data, + graffiti, + proposer_slashings: proposer_slashings + .try_into() + .map_err(BlockProductionError::SszTypesError)?, + attester_slashings: attester_slashings + .try_into() + .map_err(BlockProductionError::SszTypesError)?, + attestations: attestations + .try_into() + .map_err(BlockProductionError::SszTypesError)?, + deposits: deposits + .try_into() + .map_err(BlockProductionError::SszTypesError)?, + voluntary_exits: voluntary_exits + .try_into() + .map_err(BlockProductionError::SszTypesError)?, + sync_aggregate, + bls_to_execution_changes: bls_to_execution_changes + .try_into() + .map_err(BlockProductionError::SszTypesError)?, + parent_execution_requests, + signed_execution_payload_bid: heze_bid, + payload_attestations: payload_attestations + .try_into() + .map_err(BlockProductionError::SszTypesError)?, + _phantom: PhantomData::>, + }, + }) + } }; let signed_beacon_block = SignedBeaconBlock::from_block( @@ -750,7 +773,7 @@ impl BeaconChain { builder_index: BuilderIndex, ) -> Result< ( - SignedExecutionPayloadBid, + SignedExecutionPayloadBidGloas, BeaconState, LocalBuildResult, ), @@ -798,10 +821,10 @@ impl BeaconChain { let parent_block_hash = if parent_payload_status == PayloadStatus::Full || parent_is_pre_gloas { // Build on parent bid's payload. - parent_bid.block_hash + parent_bid.block_hash() } else { // Skip parent bid's payload. For genesis this is the EL genesis hash. - parent_bid.parent_block_hash + parent_bid.parent_block_hash() }; // TODO(gloas) this should be BlockProductionVersion::V4 @@ -833,7 +856,7 @@ impl BeaconChain { // TODO(gloas) since we are defaulting to local building, execution payment is 0 // execution payment should only be set to > 0 for trusted building. - let bid = ExecutionPayloadBid:: { + let bid = ExecutionPayloadBidGloas:: { parent_block_hash, parent_block_root: parent_root, block_hash: payload.block_hash, @@ -858,7 +881,7 @@ impl BeaconChain { }; Ok(( - SignedExecutionPayloadBid { + SignedExecutionPayloadBidGloas { message: bid, signature: Signature::infinity().map_err(BlockProductionError::BlsError)?, }, @@ -875,11 +898,11 @@ impl BeaconChain { /// parent_block_root)` of the local bid, then choose the winner. fn select_payload_bid( &self, - local_signed_bid: SignedExecutionPayloadBid, + local_signed_bid: SignedExecutionPayloadBidGloas, local_build: LocalBuildResult, builder_boost_factor: Option, ) -> ( - SignedExecutionPayloadBid, + SignedExecutionPayloadBidGloas, Option>, ) { let cached_bid = self.gossip_verified_payload_bid_cache.get_highest_bid( @@ -907,12 +930,12 @@ impl BeaconChain { /// /// `cached_bid.value` is in gwei (`u64`); `payload_value` is in wei (`Uint256`); compared in wei. pub(crate) fn select_payload_bid_pure( - local_signed_bid: SignedExecutionPayloadBid, + local_signed_bid: SignedExecutionPayloadBidGloas, local_build: LocalBuildResult, - cached_bid: Option>>, + cached_bid: Option>>, builder_boost_factor: Option, ) -> ( - SignedExecutionPayloadBid, + SignedExecutionPayloadBidGloas, Option>, ) { let LocalBuildResult { @@ -993,9 +1016,9 @@ fn get_execution_payload_gloas( // TODO(gloas): this gas limit calc is not necessarily right let parent_bid = state.latest_execution_payload_bid()?; - let latest_gas_limit = parent_bid.gas_limit; + let latest_gas_limit = parent_bid.gas_limit(); - let is_parent_block_full = parent_block_hash == parent_bid.block_hash; + let is_parent_block_full = parent_block_hash == parent_bid.block_hash(); let withdrawals = if is_parent_block_full { if let Some(envelope) = parent_envelope { @@ -1306,9 +1329,9 @@ mod tests { types::Uint256::from(n).saturating_mul(types::Uint256::from(1_000_000_000u64)) } - fn local_bid() -> SignedExecutionPayloadBid { - SignedExecutionPayloadBid { - message: ExecutionPayloadBid { + fn local_bid() -> SignedExecutionPayloadBidGloas { + SignedExecutionPayloadBidGloas { + message: ExecutionPayloadBidGloas { builder_index: BUILDER_INDEX_SELF_BUILD, ..Default::default() }, @@ -1316,9 +1339,9 @@ mod tests { } } - fn cached_bid(value_gwei: u64) -> Arc> { - Arc::new(SignedExecutionPayloadBid { - message: ExecutionPayloadBid { + fn cached_bid(value_gwei: u64) -> Arc> { + Arc::new(SignedExecutionPayloadBidGloas { + message: ExecutionPayloadBidGloas { builder_index: REMOTE_BUILDER, value: value_gwei, ..Default::default() diff --git a/beacon_node/beacon_chain/src/block_verification.rs b/beacon_node/beacon_chain/src/block_verification.rs index 9a43147233..6dbcbd0b83 100644 --- a/beacon_node/beacon_chain/src/block_verification.rs +++ b/beacon_node/beacon_chain/src/block_verification.rs @@ -889,10 +889,10 @@ impl GossipVerifiedBlock { // [New in Gloas]: Verify bid.parent_block_root matches block.parent_root. if let Ok(bid) = block.message().body().signed_execution_payload_bid() - && bid.message.parent_block_root != block.message().parent_root() + && bid.message().parent_block_root() != block.message().parent_root() { return Err(BlockError::BidParentRootMismatch { - bid_parent_root: bid.message.parent_block_root, + bid_parent_root: bid.message().parent_block_root(), block_parent_root: block.message().parent_root(), }); } diff --git a/beacon_node/beacon_chain/src/payload_bid_verification/gossip_verified_bid.rs b/beacon_node/beacon_chain/src/payload_bid_verification/gossip_verified_bid.rs index 1f3f074598..80ffb72f26 100644 --- a/beacon_node/beacon_chain/src/payload_bid_verification/gossip_verified_bid.rs +++ b/beacon_node/beacon_chain/src/payload_bid_verification/gossip_verified_bid.rs @@ -13,14 +13,14 @@ use state_processing::signature_sets::{ }; use tracing::debug; use types::{ - BeaconState, ChainSpec, EthSpec, ExecutionPayloadBid, SignedExecutionPayloadBid, - SignedProposerPreferences, Slot, + BeaconState, ChainSpec, EthSpec, ExecutionPayloadBidGloas, SignedExecutionPayloadBidGloas, + SignedExecutionPayloadBidRef, SignedProposerPreferences, Slot, }; /// Verify that an execution payload bid is consistent with the current chain state /// and proposer preferences. pub(crate) fn verify_bid_consistency( - bid: &ExecutionPayloadBid, + bid: &ExecutionPayloadBidGloas, current_slot: Slot, proposer_preferences: &SignedProposerPreferences, head_state: &BeaconState, @@ -85,7 +85,7 @@ pub struct GossipVerificationContext<'a, T: BeaconChainTypes> { pub spec: &'a ChainSpec, } -/// A wrapper around a `SignedExecutionPayloadBid` that indicates it has been approved for re-gossiping on +/// A wrapper around a `SignedExecutionPayloadBidGloas` that indicates it has been approved for re-gossiping on /// the p2p network. #[derive(Educe)] #[educe( @@ -93,12 +93,12 @@ pub struct GossipVerificationContext<'a, T: BeaconChainTypes> { Clone(bound = "T: BeaconChainTypes") )] pub struct GossipVerifiedPayloadBid { - pub signed_bid: Arc>, + pub signed_bid: Arc>, } impl GossipVerifiedPayloadBid { pub fn new( - signed_bid: Arc>, + signed_bid: Arc>, ctx: &GossipVerificationContext<'_, T>, ) -> Result { let bid_slot = signed_bid.message.slot; @@ -177,7 +177,7 @@ impl GossipVerifiedPayloadBid { execution_payload_bid_signature_set( head_state, |i| get_builder_pubkey_from_state(head_state, i), - &signed_bid, + SignedExecutionPayloadBidRef::Gloas(&signed_bid), ctx.spec, ) .map_err(|_| PayloadBidError::BadSignature)? @@ -219,7 +219,7 @@ impl BeaconChain { /// Returns an `Err` if the given bid was invalid, or an error was encountered during verification. pub fn verify_payload_bid_for_gossip( &self, - bid: Arc>, + bid: Arc>, ) -> Result, PayloadBidError> { let slot = bid.message.slot; let parent_block_root = bid.message.parent_block_root; @@ -269,7 +269,7 @@ mod tests { use kzg::KzgCommitment; use ssz_types::VariableList; use types::{ - Address, BeaconState, ChainSpec, EthSpec, ExecutionPayloadBid, MinimalEthSpec, + Address, BeaconState, ChainSpec, EthSpec, ExecutionPayloadBidGloas, MinimalEthSpec, ProposerPreferences, SignedProposerPreferences, Slot, }; @@ -278,13 +278,13 @@ mod tests { type E = MinimalEthSpec; - fn make_bid(slot: Slot, fee_recipient: Address, gas_limit: u64) -> ExecutionPayloadBid { - ExecutionPayloadBid { + fn make_bid(slot: Slot, fee_recipient: Address, gas_limit: u64) -> ExecutionPayloadBidGloas { + ExecutionPayloadBidGloas { slot, fee_recipient, gas_limit, value: 100, - ..ExecutionPayloadBid::default() + ..ExecutionPayloadBidGloas::default() } } diff --git a/beacon_node/beacon_chain/src/payload_bid_verification/payload_bid_cache.rs b/beacon_node/beacon_chain/src/payload_bid_verification/payload_bid_cache.rs index 1c98569bc5..0fc79840dd 100644 --- a/beacon_node/beacon_chain/src/payload_bid_verification/payload_bid_cache.rs +++ b/beacon_node/beacon_chain/src/payload_bid_verification/payload_bid_cache.rs @@ -7,7 +7,7 @@ use crate::{ BeaconChainTypes, payload_bid_verification::gossip_verified_bid::GossipVerifiedPayloadBid, }; use parking_lot::RwLock; -use types::{BuilderIndex, ExecutionBlockHash, Hash256, SignedExecutionPayloadBid, Slot}; +use types::{BuilderIndex, ExecutionBlockHash, Hash256, SignedExecutionPayloadBidGloas, Slot}; type HighestBidMap = BTreeMap>>; @@ -33,7 +33,7 @@ impl GossipVerifiedPayloadBidCache { slot: Slot, parent_block_hash: ExecutionBlockHash, parent_block_root: Hash256, - ) -> Option>> { + ) -> Option>> { self.highest_bid.read().get(&slot).and_then(|map| { map.get(&(parent_block_hash, parent_block_root)) .map(|b| b.signed_bid.clone()) @@ -52,6 +52,7 @@ impl GossipVerifiedPayloadBidCache { if let Some(existing) = slot_map.get(&key) && existing.signed_bid.message.value >= bid.signed_bid.message.value + { return; } @@ -93,8 +94,8 @@ mod tests { use bls::Signature; use types::{ - ExecutionBlockHash, ExecutionPayloadBid, Hash256, MinimalEthSpec, - SignedExecutionPayloadBid, Slot, + ExecutionBlockHash, ExecutionPayloadBidGloas, Hash256, MinimalEthSpec, + SignedExecutionPayloadBidGloas, Slot, }; use super::GossipVerifiedPayloadBidCache; @@ -114,14 +115,14 @@ mod tests { value: u64, ) -> GossipVerifiedPayloadBid { GossipVerifiedPayloadBid { - signed_bid: Arc::new(SignedExecutionPayloadBid { - message: ExecutionPayloadBid { + signed_bid: Arc::new(SignedExecutionPayloadBidGloas { + message: ExecutionPayloadBidGloas { slot, builder_index, parent_block_hash, parent_block_root, value, - ..ExecutionPayloadBid::default() + ..ExecutionPayloadBidGloas::default() }, signature: Signature::empty(), }), diff --git a/beacon_node/beacon_chain/src/payload_bid_verification/tests.rs b/beacon_node/beacon_chain/src/payload_bid_verification/tests.rs index b7b77d5d2a..2c5195548f 100644 --- a/beacon_node/beacon_chain/src/payload_bid_verification/tests.rs +++ b/beacon_node/beacon_chain/src/payload_bid_verification/tests.rs @@ -14,8 +14,8 @@ use state_processing::genesis::genesis_block; use store::{HotColdDB, StoreConfig}; use types::{ Address, ChainSpec, Checkpoint, Domain, Epoch, EthSpec, ExecutionBlockHash, - ExecutionPayloadBid, Hash256, MinimalEthSpec, ProposerPreferences, SignedBeaconBlock, - SignedExecutionPayloadBid, SignedProposerPreferences, SignedRoot, Slot, + ExecutionPayloadBidGloas, Hash256, MinimalEthSpec, ProposerPreferences, SignedBeaconBlock, + SignedExecutionPayloadBidGloas, SignedProposerPreferences, SignedRoot, Slot, }; use proto_array::{Block as ProtoBlock, ExecutionStatus, PayloadStatus}; @@ -154,7 +154,7 @@ impl TestContext { } } - fn sign_bid(&self, bid: ExecutionPayloadBid) -> Arc> { + fn sign_bid(&self, bid: ExecutionPayloadBidGloas) -> Arc> { let head = self.canonical_head.cached_head(); let state = &head.snapshot.beacon_state; let domain = self.spec.get_domain( @@ -165,7 +165,7 @@ impl TestContext { ); let message = bid.signing_root(domain); let signature = self.keypairs[bid.builder_index as usize].sk.sign(message); - Arc::new(SignedExecutionPayloadBid { + Arc::new(SignedExecutionPayloadBidGloas { message: bid, signature, }) @@ -229,16 +229,16 @@ fn make_signed_bid( gas_limit: u64, value: u64, parent_block_root: Hash256, -) -> Arc> { - Arc::new(SignedExecutionPayloadBid { - message: ExecutionPayloadBid { +) -> Arc> { + Arc::new(SignedExecutionPayloadBidGloas { + message: ExecutionPayloadBidGloas { slot, builder_index, fee_recipient, gas_limit, value, parent_block_root, - ..ExecutionPayloadBid::default() + ..ExecutionPayloadBidGloas::default() }, signature: Signature::empty(), }) @@ -420,13 +420,13 @@ fn execution_payment_nonzero() { let slot = Slot::new(0); seed_preferences(&ctx, slot, Address::ZERO, 30_000_000); - let bid = Arc::new(SignedExecutionPayloadBid { - message: ExecutionPayloadBid { + let bid = Arc::new(SignedExecutionPayloadBidGloas { + message: ExecutionPayloadBidGloas { slot, gas_limit: 30_000_000, execution_payment: 42, parent_block_root: ctx.genesis_block_root, - ..ExecutionPayloadBid::default() + ..ExecutionPayloadBidGloas::default() }, signature: Signature::empty(), }); @@ -576,8 +576,8 @@ fn invalid_blob_kzg_commitments() { .map(|_| KzgCommitment::empty_for_testing()) .collect(); - let bid = Arc::new(SignedExecutionPayloadBid { - message: ExecutionPayloadBid { + let bid = Arc::new(SignedExecutionPayloadBidGloas { + message: ExecutionPayloadBidGloas { slot, builder_index: 0, fee_recipient: Address::ZERO, @@ -585,7 +585,7 @@ fn invalid_blob_kzg_commitments() { value: 0, parent_block_root: ctx.genesis_block_root, blob_kzg_commitments: VariableList::new(commitments).unwrap(), - ..ExecutionPayloadBid::default() + ..ExecutionPayloadBidGloas::default() }, signature: Signature::empty(), }); @@ -635,14 +635,14 @@ fn valid_bid() { let slot = Slot::new(0); seed_preferences(&ctx, slot, Address::ZERO, 30_000_000); - let bid = ctx.sign_bid(ExecutionPayloadBid { + let bid = ctx.sign_bid(ExecutionPayloadBidGloas { slot, builder_index: 0, fee_recipient: Address::ZERO, gas_limit: 30_000_000, value: 0, parent_block_root: ctx.genesis_block_root, - ..ExecutionPayloadBid::default() + ..ExecutionPayloadBidGloas::default() }); let result = GossipVerifiedPayloadBid::new(bid, &gossip); assert!( @@ -662,14 +662,14 @@ fn two_builders_coexist_in_cache() { let slot = Slot::new(0); seed_preferences(&ctx, slot, Address::ZERO, 30_000_000); - let bid_0 = ctx.sign_bid(ExecutionPayloadBid { + let bid_0 = ctx.sign_bid(ExecutionPayloadBidGloas { slot, builder_index: 0, fee_recipient: Address::ZERO, gas_limit: 30_000_000, value: 0, parent_block_root: ctx.genesis_block_root, - ..ExecutionPayloadBid::default() + ..ExecutionPayloadBidGloas::default() }); let result_0 = GossipVerifiedPayloadBid::new(bid_0, &gossip); assert!( @@ -679,14 +679,14 @@ fn two_builders_coexist_in_cache() { ); // Builder 1 must bid strictly higher than builder 0's cached value. - let bid_1 = ctx.sign_bid(ExecutionPayloadBid { + let bid_1 = ctx.sign_bid(ExecutionPayloadBidGloas { slot, builder_index: 1, fee_recipient: Address::ZERO, gas_limit: 30_000_000, value: 1, parent_block_root: ctx.genesis_block_root, - ..ExecutionPayloadBid::default() + ..ExecutionPayloadBidGloas::default() }); let result_1 = GossipVerifiedPayloadBid::new(bid_1, &gossip); assert!( @@ -705,6 +705,7 @@ fn two_builders_coexist_in_cache() { .expect("should have highest bid"); assert_eq!(highest.message.value, 1); assert_eq!(highest.message.builder_index, 1); + } #[test] diff --git a/beacon_node/beacon_chain/src/payload_envelope_verification/gossip_verified_envelope.rs b/beacon_node/beacon_chain/src/payload_envelope_verification/gossip_verified_envelope.rs index a20963302b..ec01339d1f 100644 --- a/beacon_node/beacon_chain/src/payload_envelope_verification/gossip_verified_envelope.rs +++ b/beacon_node/beacon_chain/src/payload_envelope_verification/gossip_verified_envelope.rs @@ -6,7 +6,7 @@ use parking_lot::{Mutex, RwLock}; use store::DatabaseBlock; use tracing::debug; use types::{ - ChainSpec, EthSpec, ExecutionPayloadBid, ExecutionPayloadEnvelope, Hash256, SignedBeaconBlock, + ChainSpec, EthSpec, ExecutionPayloadBidRef, ExecutionPayloadEnvelope, Hash256, SignedBeaconBlock, SignedExecutionPayloadEnvelope, Slot, consts::gloas::BUILDER_INDEX_SELF_BUILD, }; @@ -37,7 +37,7 @@ pub struct GossipVerificationContext<'a, T: BeaconChainTypes> { pub(crate) fn verify_envelope_consistency( envelope: &ExecutionPayloadEnvelope, block: &SignedBeaconBlock, - execution_bid: &ExecutionPayloadBid, + execution_bid: ExecutionPayloadBidRef<'_, E>, latest_finalized_slot: Slot, ) -> Result<(), EnvelopeError> { // Check that the envelope's slot isn't from a slot prior @@ -58,17 +58,17 @@ pub(crate) fn verify_envelope_consistency( } // Builder index matches committed bid. - if envelope.builder_index != execution_bid.builder_index { + if envelope.builder_index != execution_bid.builder_index() { return Err(EnvelopeError::BuilderIndexMismatch { - committed_bid: execution_bid.builder_index, + committed_bid: execution_bid.builder_index(), envelope: envelope.builder_index, }); } // The block hash should match the block hash of the execution bid. - if envelope.payload.block_hash != execution_bid.block_hash { + if envelope.payload.block_hash != execution_bid.block_hash() { return Err(EnvelopeError::BlockHashMismatch { - committed_bid: execution_bid.block_hash, + committed_bid: execution_bid.block_hash(), envelope: envelope.payload.block_hash, }); } @@ -130,11 +130,11 @@ impl GossipVerifiedEnvelope { ))); } }; - let execution_bid = &block + let execution_bid = block .message() .body() .signed_execution_payload_bid()? - .message; + .message(); verify_envelope_consistency(envelope, &block, execution_bid, latest_finalized_slot)?; @@ -315,9 +315,9 @@ mod tests { use ssz_types::VariableList; use types::{ BeaconBlock, BeaconBlockBodyGloas, BeaconBlockGloas, Eth1Data, ExecutionBlockHash, - ExecutionPayloadBid, ExecutionPayloadEnvelope, ExecutionPayloadGloas, ExecutionRequests, - Graffiti, Hash256, MinimalEthSpec, SignedBeaconBlock, SignedExecutionPayloadBid, Slot, - SyncAggregate, + ExecutionPayloadBidGloas, ExecutionPayloadBidRef, ExecutionPayloadEnvelope, + ExecutionPayloadGloas, ExecutionRequests, Graffiti, Hash256, MinimalEthSpec, + SignedBeaconBlock, SignedExecutionPayloadBidGloas, Slot, SyncAggregate, }; use super::verify_envelope_consistency; @@ -365,7 +365,7 @@ mod tests { sync_aggregate: SyncAggregate::empty(), bls_to_execution_changes: VariableList::empty(), parent_execution_requests: ExecutionRequests::default(), - signed_execution_payload_bid: SignedExecutionPayloadBid::empty(), + signed_execution_payload_bid: SignedExecutionPayloadBidGloas::empty(), payload_attestations: VariableList::empty(), _phantom: PhantomData, }, @@ -373,11 +373,11 @@ mod tests { SignedBeaconBlock::from_block(block, Signature::empty()) } - fn make_bid(builder_index: u64, block_hash: ExecutionBlockHash) -> ExecutionPayloadBid { - ExecutionPayloadBid { + fn make_bid(builder_index: u64, block_hash: ExecutionBlockHash) -> ExecutionPayloadBidGloas { + ExecutionPayloadBidGloas { builder_index, block_hash, - ..ExecutionPayloadBid::default() + ..ExecutionPayloadBidGloas::default() } } @@ -391,7 +391,7 @@ mod tests { let block = make_block(slot); let bid = make_bid(builder_index, block_hash); - assert!(verify_envelope_consistency::(&envelope, &block, &bid, Slot::new(0)).is_ok()); + assert!(verify_envelope_consistency::(&envelope, &block, ExecutionPayloadBidRef::Gloas(&bid), Slot::new(0)).is_ok()); } #[test] @@ -406,7 +406,7 @@ mod tests { let latest_finalized_slot = Slot::new(10); let result = - verify_envelope_consistency::(&envelope, &block, &bid, latest_finalized_slot); + verify_envelope_consistency::(&envelope, &block, ExecutionPayloadBidRef::Gloas(&bid), latest_finalized_slot); assert!(matches!( result, Err(EnvelopeError::PriorToFinalization { .. }) @@ -422,7 +422,7 @@ mod tests { let block = make_block(Slot::new(20)); let bid = make_bid(builder_index, block_hash); - let result = verify_envelope_consistency::(&envelope, &block, &bid, Slot::new(0)); + let result = verify_envelope_consistency::(&envelope, &block, ExecutionPayloadBidRef::Gloas(&bid), Slot::new(0)); assert!(matches!(result, Err(EnvelopeError::SlotMismatch { .. }))); } @@ -435,7 +435,7 @@ mod tests { let block = make_block(slot); let bid = make_bid(2, block_hash); - let result = verify_envelope_consistency::(&envelope, &block, &bid, Slot::new(0)); + let result = verify_envelope_consistency::(&envelope, &block, ExecutionPayloadBidRef::Gloas(&bid), Slot::new(0)); assert!(matches!( result, Err(EnvelopeError::BuilderIndexMismatch { .. }) @@ -451,7 +451,7 @@ mod tests { let block = make_block(slot); let bid = make_bid(builder_index, ExecutionBlockHash::repeat_byte(0xff)); - let result = verify_envelope_consistency::(&envelope, &block, &bid, Slot::new(0)); + let result = verify_envelope_consistency::(&envelope, &block, ExecutionPayloadBidRef::Gloas(&bid), Slot::new(0)); assert!(matches!( result, Err(EnvelopeError::BlockHashMismatch { .. }) diff --git a/beacon_node/beacon_chain/src/payload_envelope_verification/payload_notifier.rs b/beacon_node/beacon_chain/src/payload_envelope_verification/payload_notifier.rs index 10fa86cffe..759e28ac79 100644 --- a/beacon_node/beacon_chain/src/payload_envelope_verification/payload_notifier.rs +++ b/beacon_node/beacon_chain/src/payload_envelope_verification/payload_notifier.rs @@ -72,15 +72,15 @@ impl PayloadNotifier { envelope: &'a SignedExecutionPayloadEnvelope, block: &'a SignedBeaconBlock, ) -> Result, BlockError> { - let bid = &block + let bid = block .message() .body() .signed_execution_payload_bid() - .map_err(|e| BlockError::BeaconChainError(Box::new(e.into())))? - .message; + .map_err(|e| BlockError::BeaconChainError(Box::new(e.into())))?; + let bid_message = bid.message(); - let versioned_hashes = bid - .blob_kzg_commitments + let versioned_hashes = bid_message + .blob_kzg_commitments() .iter() .map(kzg_commitment_to_versioned_hash) .collect(); diff --git a/beacon_node/beacon_chain/src/test_utils.rs b/beacon_node/beacon_chain/src/test_utils.rs index f3139db5be..f9d8c40d1c 100644 --- a/beacon_node/beacon_chain/src/test_utils.rs +++ b/beacon_node/beacon_chain/src/test_utils.rs @@ -2847,15 +2847,15 @@ where .expect("should read block from store") .expect("block should exist in store"); - let bid = &block + let bid = block .message() .body() .signed_execution_payload_bid() - .expect("Gloas block should have a payload bid") - .message; + .expect("Gloas block should have a payload bid"); + let bid_message = bid.message(); - let versioned_hashes = bid - .blob_kzg_commitments + let versioned_hashes = bid_message + .blob_kzg_commitments() .iter() .map(kzg_commitment_to_versioned_hash) .collect(); @@ -3878,13 +3878,12 @@ pub fn generate_data_column_sidecars_from_block( // Load the precomputed column sidecar to avoid computing them for every block in the tests. // Then repeat the cells and proofs for every blob if block.fork_name_unchecked().heze_enabled() { - let kzg_commitments = &block + let bid_ref = block .message() .body() .signed_execution_payload_bid() - .expect("Heze block should have a payload bid") - .message - .blob_kzg_commitments; + .expect("Heze block should have a payload bid"); + let kzg_commitments = bid_ref.message().blob_kzg_commitments(); if kzg_commitments.is_empty() { return vec![]; } @@ -3922,13 +3921,12 @@ pub fn generate_data_column_sidecars_from_block( ) .unwrap() } else if block.fork_name_unchecked().gloas_enabled() { - let kzg_commitments = &block + let bid_ref = block .message() .body() .signed_execution_payload_bid() - .expect("Gloas block should have a payload bid") - .message - .blob_kzg_commitments; + .expect("Gloas block should have a payload bid"); + let kzg_commitments = bid_ref.message().blob_kzg_commitments(); if kzg_commitments.is_empty() { return vec![]; } diff --git a/beacon_node/beacon_chain/tests/column_verification.rs b/beacon_node/beacon_chain/tests/column_verification.rs index 06a5f44e5f..ad9a863a5f 100644 --- a/beacon_node/beacon_chain/tests/column_verification.rs +++ b/beacon_node/beacon_chain/tests/column_verification.rs @@ -158,7 +158,7 @@ async fn gloas_envelope_blobs_produce_valid_columns() { .signed_execution_payload_bid() .expect("Gloas block should have a payload bid"); assert!( - !bid.message.blob_kzg_commitments.is_empty(), + !bid.message().blob_kzg_commitments().is_empty(), "Block should have blob KZG commitments" ); diff --git a/beacon_node/lighthouse_network/src/types/pubsub.rs b/beacon_node/lighthouse_network/src/types/pubsub.rs index 0ec7932109..7d947e2901 100644 --- a/beacon_node/lighthouse_network/src/types/pubsub.rs +++ b/beacon_node/lighthouse_network/src/types/pubsub.rs @@ -15,7 +15,7 @@ use types::{ SignedBeaconBlockAltair, SignedBeaconBlockBase, SignedBeaconBlockBellatrix, SignedBeaconBlockCapella, SignedBeaconBlockDeneb, SignedBeaconBlockElectra, SignedBeaconBlockFulu, SignedBeaconBlockGloas, SignedBeaconBlockHeze, - SignedBlsToExecutionChange, SignedContributionAndProof, SignedExecutionPayloadBid, + SignedBlsToExecutionChange, SignedContributionAndProof, SignedExecutionPayloadBidGloas, SignedExecutionPayloadEnvelope, SignedInclusionList, SignedProposerPreferences, SignedVoluntaryExit, SingleAttestation, SubnetId, SyncCommitteeMessage, SyncSubnetId, }; @@ -49,7 +49,7 @@ pub enum PubsubMessage { /// Gossipsub message providing notification of a payload attestation message. PayloadAttestation(Box), /// Gossipsub message providing notification of a signed execution payload bid. - ExecutionPayloadBid(Box>), + ExecutionPayloadBid(Box>), /// Gossipsub message providing notification of signed proposer preferences. ProposerPreferences(Box), /// Gossipsub message providing notification of a light client finality update. @@ -383,7 +383,7 @@ impl PubsubMessage { ))) } GossipKind::ExecutionPayloadBid => { - let execution_payload_bid = SignedExecutionPayloadBid::from_ssz_bytes(data) + let execution_payload_bid = SignedExecutionPayloadBidGloas::from_ssz_bytes(data) .map_err(|e| format!("{:?}", e))?; Ok(PubsubMessage::ExecutionPayloadBid(Box::new( execution_payload_bid, diff --git a/beacon_node/network/src/network_beacon_processor/gossip_methods.rs b/beacon_node/network/src/network_beacon_processor/gossip_methods.rs index 06acb3f92e..984c5f1e13 100644 --- a/beacon_node/network/src/network_beacon_processor/gossip_methods.rs +++ b/beacon_node/network/src/network_beacon_processor/gossip_methods.rs @@ -58,7 +58,7 @@ use types::{ LightClientFinalityUpdate, LightClientOptimisticUpdate, PartialDataColumn, PartialDataColumnHeader, PayloadAttestationMessage, ProposerSlashing, SignedAggregateAndProof, SignedBeaconBlock, SignedBlsToExecutionChange, SignedContributionAndProof, - SignedExecutionPayloadBid, SignedExecutionPayloadEnvelope, SignedInclusionList, + SignedExecutionPayloadBidGloas, SignedExecutionPayloadEnvelope, SignedInclusionList, SignedProposerPreferences, SignedVoluntaryExit, SingleAttestation, Slot, SubnetId, SyncCommitteeMessage, SyncSubnetId, block::BlockImportSource, }; @@ -4075,7 +4075,7 @@ impl NetworkBeaconProcessor { self: &Arc, message_id: MessageId, peer_id: PeerId, - bid: Arc>, + bid: Arc>, ) { let verification_result = self.chain.verify_payload_bid_for_gossip(bid.clone()); diff --git a/beacon_node/network/src/network_beacon_processor/mod.rs b/beacon_node/network/src/network_beacon_processor/mod.rs index 3c6f60b83c..f0d5d9f9bc 100644 --- a/beacon_node/network/src/network_beacon_processor/mod.rs +++ b/beacon_node/network/src/network_beacon_processor/mod.rs @@ -506,7 +506,7 @@ impl NetworkBeaconProcessor { self: &Arc, message_id: MessageId, peer_id: PeerId, - execution_payload_bid: Box>, + execution_payload_bid: Box>, ) -> Result<(), Error> { let processor = self.clone(); let process_fn = move || { diff --git a/common/eth2/src/types.rs b/common/eth2/src/types.rs index 42bb70676a..816143f6a6 100644 --- a/common/eth2/src/types.rs +++ b/common/eth2/src/types.rs @@ -1179,7 +1179,7 @@ pub struct SseExtendedPayloadAttributesGeneric { pub type SseExtendedPayloadAttributes = SseExtendedPayloadAttributesGeneric; pub type VersionedSsePayloadAttributes = ForkVersionedResponse; -pub type VersionedSseExecutionPayloadBid = ForkVersionedResponse>; +pub type VersionedSseExecutionPayloadBid = ForkVersionedResponse>; pub type VersionedSsePayloadAttestationMessage = ForkVersionedResponse; impl<'de> ContextDeserialize<'de, ForkName> for SsePayloadAttributes { diff --git a/consensus/fork_choice/src/fork_choice.rs b/consensus/fork_choice/src/fork_choice.rs index 1642bfb0cf..4c4b0f84c7 100644 --- a/consensus/fork_choice/src/fork_choice.rs +++ b/consensus/fork_choice/src/fork_choice.rs @@ -420,8 +420,8 @@ where // is decoupled from beacon blocks. ( ExecutionStatus::irrelevant(), - Some(signed_bid.message.parent_block_hash), - Some(signed_bid.message.block_hash), + Some(signed_bid.message().parent_block_hash()), + Some(signed_bid.message().block_hash()), ) } else if let Ok(execution_payload) = anchor_block.message().execution_payload() { // Pre-Gloas forks: do not set payload hashes, they are only used post-Gloas. @@ -991,8 +991,8 @@ where let (execution_payload_parent_hash, execution_payload_block_hash) = if let Ok(signed_bid) = block.body().signed_execution_payload_bid() { ( - Some(signed_bid.message.parent_block_hash), - Some(signed_bid.message.block_hash), + Some(signed_bid.message().parent_block_hash()), + Some(signed_bid.message().block_hash()), ) } else { (None, None) diff --git a/consensus/state_processing/src/envelope_processing.rs b/consensus/state_processing/src/envelope_processing.rs index 3da4d1e9d6..223d3800ab 100644 --- a/consensus/state_processing/src/envelope_processing.rs +++ b/consensus/state_processing/src/envelope_processing.rs @@ -150,16 +150,16 @@ pub fn verify_execution_payload_envelope( // Verify consistency with the committed bid let committed_bid = state.latest_execution_payload_bid()?; envelope_verify!( - envelope.builder_index == committed_bid.builder_index, + envelope.builder_index == committed_bid.builder_index(), EnvelopeProcessingError::BuilderIndexMismatch { - committed_bid: committed_bid.builder_index, + committed_bid: committed_bid.builder_index(), envelope: envelope.builder_index, } ); envelope_verify!( - committed_bid.prev_randao == payload.prev_randao, + committed_bid.prev_randao() == payload.prev_randao, EnvelopeProcessingError::PrevRandaoMismatch { - committed_bid: committed_bid.prev_randao, + committed_bid: committed_bid.prev_randao(), envelope: payload.prev_randao, } ); @@ -183,18 +183,18 @@ pub fn verify_execution_payload_envelope( // Verify the gas limit envelope_verify!( - committed_bid.gas_limit == payload.gas_limit, + committed_bid.gas_limit() == payload.gas_limit, EnvelopeProcessingError::GasLimitMismatch { - committed_bid: committed_bid.gas_limit, + committed_bid: committed_bid.gas_limit(), envelope: payload.gas_limit, } ); // Verify the block hash envelope_verify!( - committed_bid.block_hash == payload.block_hash, + committed_bid.block_hash() == payload.block_hash, EnvelopeProcessingError::BlockHashMismatch { - committed_bid: committed_bid.block_hash, + committed_bid: committed_bid.block_hash(), envelope: payload.block_hash, } ); @@ -221,9 +221,9 @@ pub fn verify_execution_payload_envelope( // Verify execution requests root matches committed bid let execution_requests_root = envelope.execution_requests.tree_hash_root(); envelope_verify!( - execution_requests_root == committed_bid.execution_requests_root, + execution_requests_root == committed_bid.execution_requests_root(), EnvelopeProcessingError::ExecutionRequestsRootMismatch { - committed_bid: committed_bid.execution_requests_root, + committed_bid: committed_bid.execution_requests_root(), envelope: execution_requests_root, } ); diff --git a/consensus/state_processing/src/genesis.rs b/consensus/state_processing/src/genesis.rs index 09617deb1f..88fade736f 100644 --- a/consensus/state_processing/src/genesis.rs +++ b/consensus/state_processing/src/genesis.rs @@ -170,10 +170,12 @@ pub fn initialize_beacon_state_from_eth1( // The genesis block's bid must have block_hash = 0x00 per spec (empty payload). // Retain the EL genesis hash in latest_block_hash and parent_block_hash so the // first post-genesis proposer can build on the correct EL head. - let el_genesis_hash = state.latest_execution_payload_bid()?.block_hash; - let bid = state.latest_execution_payload_bid_mut()?; - bid.parent_block_hash = el_genesis_hash; - bid.block_hash = ExecutionBlockHash::default(); + let el_genesis_hash = state.latest_execution_payload_bid()?.block_hash(); + { + let bid = state.latest_execution_payload_bid_gloas_mut()?; + bid.parent_block_hash = el_genesis_hash; + bid.block_hash = ExecutionBlockHash::default(); + } // Update the `latest_block_header.body_root` so that it matches the body of the // Gloas genesis block, which embeds `state.latest_execution_payload_bid` in its @@ -219,13 +221,13 @@ pub fn genesis_block( if let Ok(block) = block.as_gloas_mut() { let state_bid = state.latest_execution_payload_bid()?; let bid = &mut block.body.signed_execution_payload_bid.message; - bid.block_hash = state_bid.block_hash; - bid.execution_requests_root = state_bid.execution_requests_root; + bid.block_hash = state_bid.block_hash(); + bid.execution_requests_root = state_bid.execution_requests_root(); } else if let Ok(block) = block.as_heze_mut() { let state_bid = state.latest_execution_payload_bid()?; let bid = &mut block.body.signed_execution_payload_bid.message; - bid.block_hash = state_bid.block_hash; - bid.execution_requests_root = state_bid.execution_requests_root; + bid.block_hash = state_bid.block_hash(); + bid.execution_requests_root = state_bid.execution_requests_root(); } Ok(block) } diff --git a/consensus/state_processing/src/per_block_processing.rs b/consensus/state_processing/src/per_block_processing.rs index fc0456cff1..be7e959abf 100644 --- a/consensus/state_processing/src/per_block_processing.rs +++ b/consensus/state_processing/src/per_block_processing.rs @@ -559,12 +559,12 @@ pub fn process_parent_execution_payload( requests: &ExecutionRequests, spec: &ChainSpec, ) -> Result<(), BlockProcessingError> { - let parent_bid = state.latest_execution_payload_bid()?.clone(); - let parent_slot = parent_bid.slot; + let parent_bid = state.latest_execution_payload_bid()?; + let parent_slot = parent_bid.slot(); + let parent_value = parent_bid.value(); + let parent_fee_recipient = parent_bid.fee_recipient(); + let parent_builder_index = parent_bid.builder_index(); + let parent_block_hash = parent_bid.block_hash(); let parent_epoch = parent_slot.epoch(E::slots_per_epoch()); // Process execution requests from the parent's payload @@ -615,16 +619,16 @@ pub fn apply_parent_execution_payload( } else if parent_epoch == state.previous_epoch() { let payment_index = parent_slot.as_u64().safe_rem(E::slots_per_epoch())? as usize; settle_builder_payment(state, payment_index)?; - } else if parent_bid.value > 0 { + } else if parent_value > 0 { // Parent is older than previous epoch -- payment entry has already been // settled or evicted by process_builder_pending_payments at epoch boundaries. // Append the withdrawal directly from the bid. state .builder_pending_withdrawals_mut()? .push(BuilderPendingWithdrawal { - fee_recipient: parent_bid.fee_recipient, - amount: parent_bid.value, - builder_index: parent_bid.builder_index, + fee_recipient: parent_fee_recipient, + amount: parent_value, + builder_index: parent_builder_index, }) .map_err(|e| BlockProcessingError::BeaconStateError(e.into()))?; } @@ -639,7 +643,7 @@ pub fn apply_parent_execution_payload( .map_err(BlockProcessingError::BitfieldError)?; // Update latest_block_hash to the parent bid's block_hash - *state.latest_block_hash_mut()? = parent_bid.block_hash; + *state.latest_block_hash_mut()? = parent_block_hash; Ok(()) } @@ -681,9 +685,9 @@ pub fn process_execution_payload_bid // Verify the bid signature let signed_bid = block.body().signed_execution_payload_bid()?; - let bid = &signed_bid.message; - let amount = bid.value; - let builder_index = bid.builder_index; + let bid = signed_bid.message(); + let amount = bid.value(); + let builder_index = bid.builder_index(); // For self-builds, amount must be zero regardless of withdrawal credential prefix if builder_index == BUILDER_INDEX_SELF_BUILD { @@ -692,7 +696,7 @@ pub fn process_execution_payload_bid ExecutionPayloadBidInvalid::SelfBuildNonZeroAmount.into() ); block_verify!( - signed_bid.signature.is_infinity(), + signed_bid.signature().is_infinity(), ExecutionPayloadBidInvalid::BadSignature.into() ); } else { @@ -735,19 +739,19 @@ pub fn process_execution_payload_bid // Verify commitments are under limit let max_blobs_per_block = spec.max_blobs_per_block(state.current_epoch()) as usize; block_verify!( - bid.blob_kzg_commitments.len() <= max_blobs_per_block, + bid.blob_kzg_commitments().len() <= max_blobs_per_block, ExecutionPayloadBidInvalid::ExcessBlobCommitments { max: max_blobs_per_block, - bid: bid.blob_kzg_commitments.len(), + bid: bid.blob_kzg_commitments().len(), } .into() ); // Verify that the bid is for the current slot block_verify!( - bid.slot == block.slot(), + bid.slot() == block.slot(), ExecutionPayloadBidInvalid::SlotMismatch { - bid_slot: bid.slot, + bid_slot: bid.slot(), block_slot: block.slot(), } .into() @@ -756,29 +760,29 @@ pub fn process_execution_payload_bid // Verify that the bid is for the right parent block let latest_block_hash = state.latest_block_hash()?; block_verify!( - bid.parent_block_hash == *latest_block_hash, + bid.parent_block_hash() == *latest_block_hash, ExecutionPayloadBidInvalid::ParentBlockHashMismatch { state_block_hash: *latest_block_hash, - bid_parent_hash: bid.parent_block_hash, + bid_parent_hash: bid.parent_block_hash(), } .into() ); block_verify!( - bid.parent_block_root == block.parent_root(), + bid.parent_block_root() == block.parent_root(), ExecutionPayloadBidInvalid::ParentBlockRootMismatch { block_parent_root: block.parent_root(), - bid_parent_root: bid.parent_block_root, + bid_parent_root: bid.parent_block_root(), } .into() ); let expected_randao = *state.get_randao_mix(state.current_epoch())?; block_verify!( - bid.prev_randao == expected_randao, + bid.prev_randao() == expected_randao, ExecutionPayloadBidInvalid::PrevRandaoMismatch { expected: expected_randao, - bid: bid.prev_randao, + bid: bid.prev_randao(), } .into() ); @@ -788,14 +792,14 @@ pub fn process_execution_payload_bid let pending_payment = BuilderPendingPayment { weight: 0, withdrawal: BuilderPendingWithdrawal { - fee_recipient: bid.fee_recipient, + fee_recipient: bid.fee_recipient(), amount, builder_index, }, }; let payment_index = E::SlotsPerEpoch::to_usize() - .safe_add(bid.slot.as_usize().safe_rem(E::SlotsPerEpoch::to_usize())?)?; + .safe_add(bid.slot().as_usize().safe_rem(E::SlotsPerEpoch::to_usize())?)?; *state .builder_pending_payments_mut()? @@ -806,7 +810,14 @@ pub fn process_execution_payload_bid } // Cache the execution bid - *state.latest_execution_payload_bid_mut()? = bid.clone(); + match block.body().signed_execution_payload_bid()? { + SignedExecutionPayloadBidRef::Gloas(signed) => { + *state.latest_execution_payload_bid_gloas_mut()? = signed.message.clone(); + } + SignedExecutionPayloadBidRef::Heze(signed) => { + *state.latest_execution_payload_bid_heze_mut()? = signed.message.clone(); + } + } Ok(()) } diff --git a/consensus/state_processing/src/per_block_processing/signature_sets.rs b/consensus/state_processing/src/per_block_processing/signature_sets.rs index 0686c4d605..4e83ec95fe 100644 --- a/consensus/state_processing/src/per_block_processing/signature_sets.rs +++ b/consensus/state_processing/src/per_block_processing/signature_sets.rs @@ -13,7 +13,7 @@ use types::{ BuilderIndex, ChainSpec, DepositData, Domain, Epoch, EthSpec, Fork, Hash256, InconsistentFork, IndexedAttestation, IndexedAttestationRef, IndexedPayloadAttestation, ProposerSlashing, SignedAggregateAndProof, SignedBeaconBlock, SignedBeaconBlockHeader, - SignedBlsToExecutionChange, SignedContributionAndProof, SignedExecutionPayloadBid, + SignedBlsToExecutionChange, SignedContributionAndProof, SignedExecutionPayloadBidRef, SignedProposerPreferences, SignedRoot, SignedVoluntaryExit, SigningData, Slot, SyncAggregate, SyncAggregatorSelectionData, consts::gloas::BUILDER_INDEX_SELF_BUILD, }; @@ -424,15 +424,15 @@ where pub fn execution_payload_bid_signature_set<'a, E, F>( state: &'a BeaconState, get_builder_pubkey: F, - signed_execution_payload_bid: &'a SignedExecutionPayloadBid, + signed_execution_payload_bid: SignedExecutionPayloadBidRef<'a, E>, spec: &'a ChainSpec, ) -> Result>> where E: EthSpec, F: Fn(BuilderIndex) -> Option>, { - let execution_payload_bid = &signed_execution_payload_bid.message; - let builder_index = execution_payload_bid.builder_index; + let bid = signed_execution_payload_bid.message(); + let builder_index = bid.builder_index(); if builder_index == BUILDER_INDEX_SELF_BUILD { // No signatures to verify in case of a self-build, but consensus code MUST check that // the signature is the point at infinity. @@ -440,10 +440,7 @@ where return Ok(None); } - let bid_epoch = signed_execution_payload_bid - .message - .slot - .epoch(E::slots_per_epoch()); + let bid_epoch = bid.slot().epoch(E::slots_per_epoch()); let bid_fork = spec.fork_at_epoch(bid_epoch); let domain = spec.get_domain( bid_epoch, @@ -453,10 +450,10 @@ where ); let pubkey = get_builder_pubkey(builder_index).ok_or(Error::BuilderUnknown(builder_index))?; - let message = execution_payload_bid.signing_root(domain); + let message = bid.signing_root(domain); Ok(Some(SignatureSet::single_pubkey( - &signed_execution_payload_bid.signature, + signed_execution_payload_bid.signature(), pubkey, message, ))) diff --git a/consensus/state_processing/src/per_block_processing/withdrawals.rs b/consensus/state_processing/src/per_block_processing/withdrawals.rs index 8a09e35cdf..d698da44e4 100644 --- a/consensus/state_processing/src/per_block_processing/withdrawals.rs +++ b/consensus/state_processing/src/per_block_processing/withdrawals.rs @@ -495,7 +495,7 @@ pub mod gloas { spec: &ChainSpec, ) -> Result<(), BlockProcessingError> { // Return early if the parent block is empty. - if *state.latest_block_hash()? != state.latest_execution_payload_bid()?.block_hash { + if *state.latest_block_hash()? != state.latest_execution_payload_bid()?.block_hash() { return Ok(()); } diff --git a/consensus/state_processing/src/upgrade/gloas.rs b/consensus/state_processing/src/upgrade/gloas.rs index 84cdbf22c2..4a5b18b1df 100644 --- a/consensus/state_processing/src/upgrade/gloas.rs +++ b/consensus/state_processing/src/upgrade/gloas.rs @@ -11,7 +11,7 @@ use tree_hash::TreeHash; use typenum::Unsigned; use types::{ BeaconState, BeaconStateError as Error, BeaconStateGloas, BuilderPendingPayment, ChainSpec, - DepositData, EthSpec, ExecutionPayloadBid, ExecutionRequests, Fork, + DepositData, EthSpec, ExecutionPayloadBidGloas, ExecutionRequests, Fork, is_builder_withdrawal_credential, }; @@ -78,7 +78,7 @@ pub fn upgrade_state_to_gloas( current_sync_committee: pre.current_sync_committee.clone(), next_sync_committee: pre.next_sync_committee.clone(), // Execution Bid - latest_execution_payload_bid: ExecutionPayloadBid { + latest_execution_payload_bid: ExecutionPayloadBidGloas { block_hash: pre.latest_execution_payload_header.block_hash, execution_requests_root: ExecutionRequests::::default().tree_hash_root(), ..Default::default() diff --git a/consensus/state_processing/src/upgrade/heze.rs b/consensus/state_processing/src/upgrade/heze.rs index e9156418c1..ff601973fb 100644 --- a/consensus/state_processing/src/upgrade/heze.rs +++ b/consensus/state_processing/src/upgrade/heze.rs @@ -1,5 +1,9 @@ +use ssz_types::BitVector; use std::mem; -use types::{BeaconState, BeaconStateError as Error, BeaconStateHeze, ChainSpec, EthSpec, Fork}; +use types::{ + BeaconState, BeaconStateError as Error, BeaconStateHeze, ChainSpec, EthSpec, + ExecutionPayloadBidHeze, Fork, +}; /// Transform a `Gloas` state into a `Heze` state. pub fn upgrade_to_heze( @@ -64,7 +68,21 @@ pub fn upgrade_state_to_heze( current_sync_committee: pre.current_sync_committee.clone(), next_sync_committee: pre.next_sync_committee.clone(), // Execution Bid - latest_execution_payload_bid: pre.latest_execution_payload_bid.clone(), + latest_execution_payload_bid: ExecutionPayloadBidHeze { + parent_block_hash: pre.latest_execution_payload_bid.parent_block_hash, + parent_block_root: pre.latest_execution_payload_bid.parent_block_root, + block_hash: pre.latest_execution_payload_bid.block_hash, + prev_randao: pre.latest_execution_payload_bid.prev_randao, + fee_recipient: pre.latest_execution_payload_bid.fee_recipient, + gas_limit: pre.latest_execution_payload_bid.gas_limit, + builder_index: pre.latest_execution_payload_bid.builder_index, + slot: pre.latest_execution_payload_bid.slot, + value: pre.latest_execution_payload_bid.value, + execution_payment: pre.latest_execution_payload_bid.execution_payment, + blob_kzg_commitments: pre.latest_execution_payload_bid.blob_kzg_commitments.clone(), + execution_requests_root: pre.latest_execution_payload_bid.execution_requests_root, + inclusion_list_bits: BitVector::new(), + }, // Capella next_withdrawal_index: pre.next_withdrawal_index, next_withdrawal_validator_index: pre.next_withdrawal_validator_index, diff --git a/consensus/types/src/block/beacon_block.rs b/consensus/types/src/block/beacon_block.rs index cc4d4906c7..98d96a47b4 100644 --- a/consensus/types/src/block/beacon_block.rs +++ b/consensus/types/src/block/beacon_block.rs @@ -15,7 +15,7 @@ use tree_hash_derive::TreeHash; use typenum::Unsigned; use crate::{ - SignedExecutionPayloadBid, + SignedExecutionPayloadBidGloas, SignedExecutionPayloadBidHeze, attestation::{AttestationBase, AttestationData, IndexedAttestationBase}, block::{ BeaconBlockBodyAltair, BeaconBlockBodyBase, BeaconBlockBodyBellatrix, @@ -729,7 +729,7 @@ impl> EmptyBlock for BeaconBlockGloa sync_aggregate: SyncAggregate::empty(), bls_to_execution_changes: VariableList::empty(), parent_execution_requests: ExecutionRequests::default(), - signed_execution_payload_bid: SignedExecutionPayloadBid::empty(), + signed_execution_payload_bid: SignedExecutionPayloadBidGloas::empty(), payload_attestations: VariableList::empty(), _phantom: PhantomData, }, @@ -761,7 +761,7 @@ impl> EmptyBlock for BeaconBlockHeze sync_aggregate: SyncAggregate::empty(), bls_to_execution_changes: VariableList::empty(), parent_execution_requests: ExecutionRequests::default(), - signed_execution_payload_bid: SignedExecutionPayloadBid::empty(), + signed_execution_payload_bid: SignedExecutionPayloadBidHeze::empty(), payload_attestations: VariableList::empty(), _phantom: PhantomData, }, diff --git a/consensus/types/src/block/beacon_block_body.rs b/consensus/types/src/block/beacon_block_body.rs index d922611ad5..61a16bbea1 100644 --- a/consensus/types/src/block/beacon_block_body.rs +++ b/consensus/types/src/block/beacon_block_body.rs @@ -14,7 +14,7 @@ use tree_hash::TreeHash; use tree_hash_derive::TreeHash; use crate::{ - SignedExecutionPayloadBid, + SignedExecutionPayloadBidGloas, SignedExecutionPayloadBidHeze, SignedExecutionPayloadBidRef, attestation::{ AttestationBase, AttestationElectra, AttestationRef, AttestationRefMut, PayloadAttestation, }, @@ -169,8 +169,16 @@ pub struct BeaconBlockBody = FullPay pub blob_kzg_commitments: KzgCommitments, #[superstruct(only(Electra, Fulu))] pub execution_requests: ExecutionRequests, - #[superstruct(only(Gloas, Heze))] - pub signed_execution_payload_bid: SignedExecutionPayloadBid, + #[superstruct( + only(Gloas), + partial_getter(rename = "signed_execution_payload_bid_gloas") + )] + pub signed_execution_payload_bid: SignedExecutionPayloadBidGloas, + #[superstruct( + only(Heze), + partial_getter(rename = "signed_execution_payload_bid_heze") + )] + pub signed_execution_payload_bid: SignedExecutionPayloadBidHeze, #[superstruct(only(Gloas, Heze))] pub payload_attestations: VariableList, E::MaxPayloadAttestations>, #[superstruct(only(Gloas, Heze))] @@ -196,6 +204,20 @@ impl> BeaconBlockBody { } impl<'a, E: EthSpec, Payload: AbstractExecPayload> BeaconBlockBodyRef<'a, E, Payload> { + pub fn signed_execution_payload_bid( + &self, + ) -> Result, BeaconStateError> { + match self { + Self::Gloas(body) => Ok(SignedExecutionPayloadBidRef::Gloas( + &body.signed_execution_payload_bid, + )), + Self::Heze(body) => Ok(SignedExecutionPayloadBidRef::Heze( + &body.signed_execution_payload_bid, + )), + _ => Err(BeaconStateError::IncorrectStateVariant), + } + } + pub fn execution_payload(&self) -> Result, BeaconStateError> { match self { Self::Base(_) | Self::Altair(_) => Err(BeaconStateError::IncorrectStateVariant), diff --git a/consensus/types/src/block/signed_beacon_block.rs b/consensus/types/src/block/signed_beacon_block.rs index 8f3378e91d..c042cfb33a 100644 --- a/consensus/types/src/block/signed_beacon_block.rs +++ b/consensus/types/src/block/signed_beacon_block.rs @@ -383,7 +383,7 @@ impl> SignedBeaconBlock self.message() .body() .signed_execution_payload_bid() - .map(|bid| bid.message.block_hash) + .map(|bid| bid.message().block_hash()) } /// Convenience accessor for the block's bid's `parent_block_hash`. @@ -393,7 +393,7 @@ impl> SignedBeaconBlock self.message() .body() .signed_execution_payload_bid() - .map(|bid| bid.message.parent_block_hash) + .map(|bid| bid.message().parent_block_hash()) } /// Check if the `parent_hash` in this block's `signed_payload_bid` matches `parent_block_hash`. @@ -409,7 +409,7 @@ impl> SignedBeaconBlock // Prior to Gloas. return false; }; - signed_payload_bid.message.parent_block_hash == parent_block_hash + signed_payload_bid.message().parent_block_hash() == parent_block_hash } } diff --git a/consensus/types/src/execution/execution_payload_bid.rs b/consensus/types/src/execution/execution_payload_bid.rs index b2438681c1..ffdbf0ed6c 100644 --- a/consensus/types/src/execution/execution_payload_bid.rs +++ b/consensus/types/src/execution/execution_payload_bid.rs @@ -1,51 +1,106 @@ use crate::kzg_ext::KzgCommitments; +use crate::state::BeaconStateError; use crate::test_utils::TestRandom; use crate::{Address, EthSpec, ExecutionBlockHash, ForkName, Hash256, SignedRoot, Slot}; use context_deserialize::context_deserialize; use educe::Educe; use serde::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; +use ssz_types::BitVector; +use superstruct::superstruct; use test_random_derive::TestRandom; use tree_hash_derive::TreeHash; -#[derive( - Default, Debug, Clone, Serialize, Encode, Decode, Deserialize, TreeHash, Educe, TestRandom, +#[superstruct( + variants(Gloas, Heze), + variant_attributes( + derive( + Default, + Debug, + Clone, + Serialize, + Deserialize, + Encode, + Decode, + TreeHash, + TestRandom, + Educe, + ), + educe(PartialEq, Hash(bound(E: EthSpec))), + serde(bound = "E: EthSpec", deny_unknown_fields), + cfg_attr( + feature = "arbitrary", + derive(arbitrary::Arbitrary), + arbitrary(bound = "E: EthSpec"), + ), + context_deserialize(ForkName), + ), + ref_attributes( + derive(PartialEq, TreeHash, Debug), + tree_hash(enum_behaviour = "transparent") + ), + cast_error( + ty = "BeaconStateError", + expr = "BeaconStateError::IncorrectStateVariant" + ), + partial_getter_error( + ty = "BeaconStateError", + expr = "BeaconStateError::IncorrectStateVariant" + ), )] #[cfg_attr( feature = "arbitrary", derive(arbitrary::Arbitrary), arbitrary(bound = "E: EthSpec") )] -#[educe(PartialEq, Hash)] -#[serde(bound = "E: EthSpec")] -#[context_deserialize(ForkName)] -// https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/beacon-chain.md#executionpayloadbid +#[derive(Debug, Clone, Serialize, Deserialize, Encode, TreeHash, Educe)] +#[educe(PartialEq, Hash(bound(E: EthSpec)))] +#[serde(bound = "E: EthSpec", untagged)] +#[tree_hash(enum_behaviour = "transparent")] +#[ssz(enum_behaviour = "transparent")] pub struct ExecutionPayloadBid { + #[superstruct(getter(copy))] pub parent_block_hash: ExecutionBlockHash, + #[superstruct(getter(copy))] pub parent_block_root: Hash256, + #[superstruct(getter(copy))] pub block_hash: ExecutionBlockHash, + #[superstruct(getter(copy))] pub prev_randao: Hash256, + #[superstruct(getter(copy))] #[serde(with = "serde_utils::address_hex")] pub fee_recipient: Address, #[serde(with = "serde_utils::quoted_u64")] + #[superstruct(getter(copy))] pub gas_limit: u64, #[serde(with = "serde_utils::quoted_u64")] + #[superstruct(getter(copy))] pub builder_index: u64, + #[superstruct(getter(copy))] pub slot: Slot, #[serde(with = "serde_utils::quoted_u64")] + #[superstruct(getter(copy))] pub value: u64, #[serde(with = "serde_utils::quoted_u64")] + #[superstruct(getter(copy))] pub execution_payment: u64, pub blob_kzg_commitments: KzgCommitments, + #[superstruct(getter(copy))] pub execution_requests_root: Hash256, + #[superstruct(only(Heze))] + pub inclusion_list_bits: BitVector, } -impl SignedRoot for ExecutionPayloadBid {} +impl SignedRoot for ExecutionPayloadBidGloas {} +impl SignedRoot for ExecutionPayloadBidHeze {} +impl<'a, E: EthSpec> SignedRoot for ExecutionPayloadBidRef<'a, E> {} + #[cfg(test)] mod tests { use super::*; use crate::MainnetEthSpec; - ssz_and_tree_hash_tests!(ExecutionPayloadBid); + ssz_and_tree_hash_tests!(ExecutionPayloadBidGloas); + ssz_and_tree_hash_tests!(ExecutionPayloadBidHeze); } diff --git a/consensus/types/src/execution/mod.rs b/consensus/types/src/execution/mod.rs index 16040a358e..5dd5597cc7 100644 --- a/consensus/types/src/execution/mod.rs +++ b/consensus/types/src/execution/mod.rs @@ -22,7 +22,10 @@ pub use execution_payload::{ ExecutionPayloadElectra, ExecutionPayloadFulu, ExecutionPayloadGloas, ExecutionPayloadHeze, ExecutionPayloadRef, Transaction, Transactions, }; -pub use execution_payload_bid::ExecutionPayloadBid; +pub use execution_payload_bid::{ + ExecutionPayloadBid, ExecutionPayloadBidGloas, ExecutionPayloadBidHeze, + ExecutionPayloadBidRef, +}; pub use execution_payload_envelope::ExecutionPayloadEnvelope; pub use execution_payload_header::{ ExecutionPayloadHeader, ExecutionPayloadHeaderBellatrix, ExecutionPayloadHeaderCapella, @@ -43,5 +46,7 @@ pub use payload::{ FullPayloadElectra, FullPayloadFulu, FullPayloadRef, OwnedExecPayload, }; pub use signed_bls_to_execution_change::SignedBlsToExecutionChange; -pub use signed_execution_payload_bid::SignedExecutionPayloadBid; +pub use signed_execution_payload_bid::{ + SignedExecutionPayloadBidGloas, SignedExecutionPayloadBidHeze, SignedExecutionPayloadBidRef, +}; pub use signed_execution_payload_envelope::SignedExecutionPayloadEnvelope; diff --git a/consensus/types/src/execution/signed_execution_payload_bid.rs b/consensus/types/src/execution/signed_execution_payload_bid.rs index 48da445332..6f1e7f0c02 100644 --- a/consensus/types/src/execution/signed_execution_payload_bid.rs +++ b/consensus/types/src/execution/signed_execution_payload_bid.rs @@ -1,4 +1,4 @@ -use crate::execution::ExecutionPayloadBid; +use crate::execution::{ExecutionPayloadBidGloas, ExecutionPayloadBidHeze, ExecutionPayloadBidRef}; use crate::test_utils::TestRandom; use crate::{EthSpec, ForkName}; use bls::Signature; @@ -18,25 +18,69 @@ use tree_hash_derive::TreeHash; #[educe(PartialEq, Hash)] #[serde(bound = "E: EthSpec")] #[context_deserialize(ForkName)] -// https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/beacon-chain.md#signedexecutionpayloadbid -pub struct SignedExecutionPayloadBid { - pub message: ExecutionPayloadBid, +pub struct SignedExecutionPayloadBidGloas { + pub message: ExecutionPayloadBidGloas, pub signature: Signature, } -impl SignedExecutionPayloadBid { +impl SignedExecutionPayloadBidGloas { pub fn empty() -> Self { Self { - message: ExecutionPayloadBid::default(), + message: ExecutionPayloadBidGloas::default(), signature: Signature::empty(), } } } +#[derive(TestRandom, TreeHash, Debug, Clone, Encode, Decode, Serialize, Deserialize, Educe)] +#[cfg_attr( + feature = "arbitrary", + derive(arbitrary::Arbitrary), + arbitrary(bound = "E: EthSpec") +)] +#[educe(PartialEq, Hash)] +#[serde(bound = "E: EthSpec")] +#[context_deserialize(ForkName)] +pub struct SignedExecutionPayloadBidHeze { + pub message: ExecutionPayloadBidHeze, + pub signature: Signature, +} + +impl SignedExecutionPayloadBidHeze { + pub fn empty() -> Self { + Self { + message: ExecutionPayloadBidHeze::default(), + signature: Signature::empty(), + } + } +} + +pub enum SignedExecutionPayloadBidRef<'a, E: EthSpec> { + Gloas(&'a SignedExecutionPayloadBidGloas), + Heze(&'a SignedExecutionPayloadBidHeze), +} + +impl<'a, E: EthSpec> SignedExecutionPayloadBidRef<'a, E> { + pub fn message(&self) -> ExecutionPayloadBidRef<'a, E> { + match self { + Self::Gloas(inner) => ExecutionPayloadBidRef::Gloas(&inner.message), + Self::Heze(inner) => ExecutionPayloadBidRef::Heze(&inner.message), + } + } + + pub fn signature(&self) -> &'a Signature { + match self { + Self::Gloas(inner) => &inner.signature, + Self::Heze(inner) => &inner.signature, + } + } +} + #[cfg(test)] mod tests { use super::*; use crate::MainnetEthSpec; - ssz_and_tree_hash_tests!(SignedExecutionPayloadBid); + ssz_and_tree_hash_tests!(SignedExecutionPayloadBidGloas); + ssz_and_tree_hash_tests!(SignedExecutionPayloadBidHeze); } diff --git a/consensus/types/src/state/beacon_state.rs b/consensus/types/src/state/beacon_state.rs index 1478561c43..8ce6fc4b0a 100644 --- a/consensus/types/src/state/beacon_state.rs +++ b/consensus/types/src/state/beacon_state.rs @@ -24,7 +24,8 @@ use tree_hash_derive::TreeHash; use typenum::Unsigned; use crate::{ - Address, ExecutionBlockHash, ExecutionPayloadBid, ProposerPreferences, Withdrawal, + Address, ExecutionBlockHash, ExecutionPayloadBidGloas, ExecutionPayloadBidHeze, + ExecutionPayloadBidRef, ProposerPreferences, Withdrawal, attestation::{ AttestationData, AttestationDuty, BeaconCommittee, Checkpoint, CommitteeIndex, PTC, ParticipationFlags, PendingAttestation, @@ -673,9 +674,18 @@ where pub builder_pending_withdrawals: List, - #[superstruct(only(Gloas, Heze))] + #[superstruct( + only(Gloas), + partial_getter(rename = "latest_execution_payload_bid_gloas") + )] #[metastruct(exclude_from(tree_lists))] - pub latest_execution_payload_bid: ExecutionPayloadBid, + pub latest_execution_payload_bid: ExecutionPayloadBidGloas, + #[superstruct( + only(Heze), + partial_getter(rename = "latest_execution_payload_bid_heze") + )] + #[metastruct(exclude_from(tree_lists))] + pub latest_execution_payload_bid: ExecutionPayloadBidHeze, #[compare_fields(as_iter)] #[test_random(default)] @@ -1341,6 +1351,20 @@ impl BeaconState { } } + pub fn latest_execution_payload_bid( + &self, + ) -> Result, BeaconStateError> { + match self { + BeaconState::Gloas(state) => Ok(ExecutionPayloadBidRef::Gloas( + &state.latest_execution_payload_bid, + )), + BeaconState::Heze(state) => Ok(ExecutionPayloadBidRef::Heze( + &state.latest_execution_payload_bid, + )), + _ => Err(BeaconStateError::IncorrectStateVariant), + } + } + /// Return `true` if the validator who produced `slot_signature` is eligible to aggregate. /// /// Spec v0.12.1 @@ -2613,11 +2637,13 @@ impl BeaconState { | BeaconState::Capella(_) | BeaconState::Deneb(_) | BeaconState::Electra(_) - | BeaconState::Fulu(_) - | BeaconState::Heze(_) => true, + | BeaconState::Fulu(_) => true, BeaconState::Gloas(state) => { state.latest_execution_payload_bid.block_hash == state.latest_block_hash } + BeaconState::Heze(state) => { + state.latest_execution_payload_bid.block_hash == state.latest_block_hash + } } } diff --git a/testing/ef_tests/src/type_name.rs b/testing/ef_tests/src/type_name.rs index fe632f0211..22e469aa08 100644 --- a/testing/ef_tests/src/type_name.rs +++ b/testing/ef_tests/src/type_name.rs @@ -94,7 +94,7 @@ type_name_generic!(ExecutionPayloadHeaderElectra, "ExecutionPayloadHeader"); type_name_generic!(ExecutionPayloadHeaderFulu, "ExecutionPayloadHeader"); type_name_generic!(ExecutionPayloadHeaderHeze, "ExecutionPayloadHeader"); type_name_generic!(ExecutionPayloadBid); -type_name_generic!(SignedExecutionPayloadBid); +type_name_generic!(SignedExecutionPayloadBidGloas, "SignedExecutionPayloadBid"); type_name_generic!(ExecutionRequests); type_name_generic!(ExecutionPayloadEnvelope); type_name_generic!(SignedExecutionPayloadEnvelope); diff --git a/testing/ef_tests/tests/tests.rs b/testing/ef_tests/tests/tests.rs index 0a200e7c7c..7e80c2234f 100644 --- a/testing/ef_tests/tests/tests.rs +++ b/testing/ef_tests/tests/tests.rs @@ -275,7 +275,7 @@ mod ssz_static { BuilderPendingWithdrawal, ConsolidationRequest, DepositRequest, ExecutionPayloadBid, ExecutionPayloadEnvelope, IndexedPayloadAttestation, LightClientBootstrapAltair, PayloadAttestation, PayloadAttestationData, PayloadAttestationMessage, PendingDeposit, - PendingPartialWithdrawal, SignedExecutionPayloadBid, SignedExecutionPayloadEnvelope, + PendingPartialWithdrawal, SignedExecutionPayloadBidGloas, SignedExecutionPayloadEnvelope, WithdrawalRequest, *, }; @@ -688,8 +688,8 @@ mod ssz_static { #[test] fn signed_execution_payload_bid() { - SszStaticHandler::, MinimalEthSpec>::gloas_and_later().run(); - SszStaticHandler::, MainnetEthSpec>::gloas_and_later().run(); + SszStaticHandler::, MinimalEthSpec>::gloas_and_later().run(); + SszStaticHandler::, MainnetEthSpec>::gloas_and_later().run(); } #[test]