Fix Compilation/Formatting/Lint Issues

This commit is contained in:
Mark Mackey
2025-08-22 10:19:55 -05:00
parent a695fa53b0
commit 7b9f25c341
11 changed files with 39 additions and 52 deletions

View File

@@ -681,7 +681,7 @@ impl<E: EthSpec, Payload: AbstractExecPayload<E>> EmptyBlock for BeaconBlockGloa
}
}
/// TODO(EIP-7732) Mark's branch had the following implementation but not sure if it's needed so will just add header below for reference
// TODO(EIP-7732) Mark's branch had the following implementation but not sure if it's needed so will just add header below for reference
// impl<E: EthSpec, Payload: AbstractExecPayload<E>> BeaconBlockEIP7732<E, Payload> {
// TODO(EIP-7732) Look into whether we can remove this in the future since no blinded blocks post-gloas

View File

@@ -2,9 +2,8 @@ use crate::beacon_block_body::KzgCommitments;
use crate::{
ChainSpec, ContextDeserialize, EthSpec, ExecutionPayloadHeaderBellatrix,
ExecutionPayloadHeaderCapella, ExecutionPayloadHeaderDeneb, ExecutionPayloadHeaderElectra,
ExecutionPayloadHeaderFulu, ExecutionPayloadHeaderRef,
ExecutionPayloadHeaderRefMut, ExecutionRequests, ForkName, ForkVersionDecode, SignedRoot,
Uint256, test_utils::TestRandom,
ExecutionPayloadHeaderFulu, ExecutionPayloadHeaderRef, ExecutionPayloadHeaderRefMut,
ExecutionRequests, ForkName, ForkVersionDecode, SignedRoot, Uint256, test_utils::TestRandom,
};
use bls::PublicKeyBytes;
use bls::Signature;

View File

@@ -126,7 +126,7 @@ impl<E: EthSpec> ExecutionPayloadHeader<E> {
// TODO(newfork): Add a new case here if there are new variable fields
if fork_name.gloas_enabled() {
// TODO(EIP7732): check this
return 0;
0
} else if fork_name.bellatrix_enabled() {
// Max size of variable length `extra_data` field
E::max_extra_data_bytes() * <u8 as Encode>::ssz_fixed_len()
@@ -516,7 +516,7 @@ impl<'de, E: EthSpec> ContextDeserialize<'de, ForkName> for ExecutionPayloadHead
return Err(serde::de::Error::custom(format!(
"ExecutionPayloadHeader failed to deserialize: unsupported fork '{}'",
context
)))
)));
}
})
}

View File

@@ -176,8 +176,8 @@ pub use crate::deposit_request::DepositRequest;
pub use crate::deposit_tree_snapshot::{DepositTreeSnapshot, FinalizedExecutionBlock};
pub use crate::enr_fork_id::EnrForkId;
pub use crate::epoch_cache::{EpochCache, EpochCacheError, EpochCacheKey};
pub use crate::eth1_data::Eth1Data;
pub use crate::eth_spec::EthSpecId;
pub use crate::eth1_data::Eth1Data;
pub use crate::execution_bid::ExecutionBid;
pub use crate::execution_block_hash::ExecutionBlockHash;
pub use crate::execution_block_header::{EncodableExecutionBlockHeader, ExecutionBlockHeader};

View File

@@ -1,9 +1,9 @@
use crate::context_deserialize;
use crate::{
light_client_update::*, test_utils::TestRandom, BeaconState, ChainSpec, ContextDeserialize,
EthSpec, FixedVector, ForkName, Hash256, LightClientHeader, LightClientHeaderAltair,
LightClientHeaderCapella, LightClientHeaderDeneb, LightClientHeaderElectra,
LightClientHeaderFulu, SignedBlindedBeaconBlock, Slot, SyncCommittee,
BeaconState, ChainSpec, ContextDeserialize, EthSpec, FixedVector, ForkName, Hash256,
LightClientHeader, LightClientHeaderAltair, LightClientHeaderCapella, LightClientHeaderDeneb,
LightClientHeaderElectra, LightClientHeaderFulu, SignedBlindedBeaconBlock, Slot, SyncCommittee,
light_client_update::*, test_utils::TestRandom,
};
use derivative::Derivative;
use serde::{Deserialize, Deserializer, Serialize};

View File

@@ -2,9 +2,9 @@ use super::{EthSpec, FixedVector, Hash256, LightClientHeader, Slot, SyncAggregat
use crate::ChainSpec;
use crate::context_deserialize;
use crate::{
light_client_update::*, test_utils::TestRandom, ContextDeserialize, ForkName,
LightClientHeaderAltair, LightClientHeaderCapella, LightClientHeaderDeneb,
LightClientHeaderElectra, LightClientHeaderFulu, SignedBlindedBeaconBlock,
ContextDeserialize, ForkName, LightClientHeaderAltair, LightClientHeaderCapella,
LightClientHeaderDeneb, LightClientHeaderElectra, LightClientHeaderFulu,
SignedBlindedBeaconBlock, light_client_update::*, test_utils::TestRandom,
};
use derivative::Derivative;
use serde::{Deserialize, Deserializer, Serialize};

View File

@@ -1,12 +1,12 @@
use crate::ChainSpec;
use crate::context_deserialize;
use crate::{light_client_update::*, BeaconBlockBody};
use crate::{BeaconBlockBody, light_client_update::*};
use crate::{BeaconBlockHeader, ExecutionPayloadHeader};
use crate::{ContextDeserialize, ForkName};
use crate::{
EthSpec, ExecutionPayloadHeaderCapella, ExecutionPayloadHeaderDeneb,
ExecutionPayloadHeaderElectra, ExecutionPayloadHeaderFulu,
FixedVector, Hash256, SignedBlindedBeaconBlock, test_utils::TestRandom,
ExecutionPayloadHeaderElectra, ExecutionPayloadHeaderFulu, FixedVector, Hash256,
SignedBlindedBeaconBlock, test_utils::TestRandom,
};
use derivative::Derivative;
use serde::{Deserialize, Deserializer, Serialize};
@@ -148,7 +148,7 @@ impl<E: EthSpec> LightClientHeader<E> {
pub fn ssz_max_var_len_for_fork(fork_name: ForkName) -> usize {
if fork_name.gloas_enabled() {
// TODO(EIP7732): check this
return 0;
0
} else if fork_name.capella_enabled() {
ExecutionPayloadHeader::<E>::ssz_max_var_len_for_fork(fork_name)
} else {

View File

@@ -2,9 +2,9 @@ use super::{ContextDeserialize, EthSpec, ForkName, LightClientHeader, Slot, Sync
use crate::context_deserialize;
use crate::test_utils::TestRandom;
use crate::{
light_client_update::*, ChainSpec, LightClientHeaderAltair, LightClientHeaderCapella,
LightClientHeaderDeneb, LightClientHeaderElectra, LightClientHeaderFulu,
SignedBlindedBeaconBlock,
ChainSpec, LightClientHeaderAltair, LightClientHeaderCapella, LightClientHeaderDeneb,
LightClientHeaderElectra, LightClientHeaderFulu, SignedBlindedBeaconBlock,
light_client_update::*,
};
use derivative::Derivative;
use serde::{Deserialize, Deserializer, Serialize};

View File

@@ -3,9 +3,9 @@ use crate::LightClientHeader;
use crate::context_deserialize;
use crate::light_client_header::LightClientHeaderElectra;
use crate::{
beacon_state, test_utils::TestRandom, ChainSpec, ContextDeserialize, Epoch, ForkName,
LightClientHeaderAltair, LightClientHeaderCapella, LightClientHeaderDeneb,
LightClientHeaderFulu, SignedBlindedBeaconBlock,
ChainSpec, ContextDeserialize, Epoch, ForkName, LightClientHeaderAltair,
LightClientHeaderCapella, LightClientHeaderDeneb, LightClientHeaderFulu,
SignedBlindedBeaconBlock, beacon_state, test_utils::TestRandom,
};
use derivative::Derivative;
use safe_arith::ArithError;

View File

@@ -305,18 +305,10 @@ impl<E: EthSpec> ExecPayload<E> for FullPayload<E> {
fn withdrawals_root(&self) -> Result<Hash256, Error> {
match self {
FullPayload::Bellatrix(_) => Err(Error::IncorrectStateVariant),
FullPayload::Capella(ref inner) => {
Ok(inner.execution_payload.withdrawals.tree_hash_root())
}
FullPayload::Deneb(ref inner) => {
Ok(inner.execution_payload.withdrawals.tree_hash_root())
}
FullPayload::Electra(ref inner) => {
Ok(inner.execution_payload.withdrawals.tree_hash_root())
}
FullPayload::Fulu(ref inner) => {
Ok(inner.execution_payload.withdrawals.tree_hash_root())
}
FullPayload::Capella(inner) => Ok(inner.execution_payload.withdrawals.tree_hash_root()),
FullPayload::Deneb(inner) => Ok(inner.execution_payload.withdrawals.tree_hash_root()),
FullPayload::Electra(inner) => Ok(inner.execution_payload.withdrawals.tree_hash_root()),
FullPayload::Fulu(inner) => Ok(inner.execution_payload.withdrawals.tree_hash_root()),
}
}
@@ -325,9 +317,9 @@ impl<E: EthSpec> ExecPayload<E> for FullPayload<E> {
FullPayload::Bellatrix(_) | FullPayload::Capella(_) => {
Err(Error::IncorrectStateVariant)
}
FullPayload::Deneb(ref inner) => Ok(inner.execution_payload.blob_gas_used),
FullPayload::Electra(ref inner) => Ok(inner.execution_payload.blob_gas_used),
FullPayload::Fulu(ref inner) => Ok(inner.execution_payload.blob_gas_used),
FullPayload::Deneb(inner) => Ok(inner.execution_payload.blob_gas_used),
FullPayload::Electra(inner) => Ok(inner.execution_payload.blob_gas_used),
FullPayload::Fulu(inner) => Ok(inner.execution_payload.blob_gas_used),
}
}
@@ -651,14 +643,10 @@ impl<E: EthSpec> ExecPayload<E> for BlindedPayload<E> {
fn withdrawals_root(&self) -> Result<Hash256, Error> {
match self {
BlindedPayload::Bellatrix(_) => Err(Error::IncorrectStateVariant),
BlindedPayload::Capella(ref inner) => {
Ok(inner.execution_payload_header.withdrawals_root)
}
BlindedPayload::Deneb(ref inner) => Ok(inner.execution_payload_header.withdrawals_root),
BlindedPayload::Electra(ref inner) => {
Ok(inner.execution_payload_header.withdrawals_root)
}
BlindedPayload::Fulu(ref inner) => Ok(inner.execution_payload_header.withdrawals_root),
BlindedPayload::Capella(inner) => Ok(inner.execution_payload_header.withdrawals_root),
BlindedPayload::Deneb(inner) => Ok(inner.execution_payload_header.withdrawals_root),
BlindedPayload::Electra(inner) => Ok(inner.execution_payload_header.withdrawals_root),
BlindedPayload::Fulu(inner) => Ok(inner.execution_payload_header.withdrawals_root),
}
}
@@ -667,9 +655,9 @@ impl<E: EthSpec> ExecPayload<E> for BlindedPayload<E> {
BlindedPayload::Bellatrix(_) | BlindedPayload::Capella(_) => {
Err(Error::IncorrectStateVariant)
}
BlindedPayload::Deneb(ref inner) => Ok(inner.execution_payload_header.blob_gas_used),
BlindedPayload::Electra(ref inner) => Ok(inner.execution_payload_header.blob_gas_used),
BlindedPayload::Fulu(ref inner) => Ok(inner.execution_payload_header.blob_gas_used),
BlindedPayload::Deneb(inner) => Ok(inner.execution_payload_header.blob_gas_used),
BlindedPayload::Electra(inner) => Ok(inner.execution_payload_header.blob_gas_used),
BlindedPayload::Fulu(inner) => Ok(inner.execution_payload_header.blob_gas_used),
}
}

View File

@@ -50,8 +50,8 @@ pub struct SignedExecutionPayloadEnvelope<E: EthSpec> {
impl<E: EthSpec> SignedExecutionPayloadEnvelope<E> {
pub fn message(&self) -> ExecutionPayloadEnvelopeRef<E> {
match self {
Self::Gloas(ref signed) => ExecutionPayloadEnvelopeRef::Gloas(&signed.message),
Self::NextFork(ref signed) => ExecutionPayloadEnvelopeRef::NextFork(&signed.message),
Self::Gloas(signed) => ExecutionPayloadEnvelopeRef::Gloas(&signed.message),
Self::NextFork(signed) => ExecutionPayloadEnvelopeRef::NextFork(&signed.message),
}
}
}