Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ use tracing::{Span, debug, debug_span, error, info, info_span, instrument, trace
use tree_hash::TreeHash;
use types::blob_sidecar::FixedBlobSidecarList;
use types::data_column_sidecar::ColumnIndex;
use types::payload::BlockProductionVersion;
use types::execution::BlockProductionVersion;
use types::*;

pub type ForkChoiceError = fork_choice::Error<crate::ForkChoiceStoreError>;
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/beacon_chain/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ pub enum BeaconChainError {
UnableToPublish,
UnableToBuildColumnSidecar(String),
AvailabilityCheckError(AvailabilityCheckError),
LightClientUpdateError(LightClientUpdateError),
LightClientError(LightClientError),
LightClientBootstrapError(String),
UnsupportedFork,
MilhouseError(MilhouseError),
Expand Down Expand Up @@ -274,7 +274,7 @@ easy_from_to!(BlockReplayError, BeaconChainError);
easy_from_to!(InconsistentFork, BeaconChainError);
easy_from_to!(AvailabilityCheckError, BeaconChainError);
easy_from_to!(EpochCacheError, BeaconChainError);
easy_from_to!(LightClientUpdateError, BeaconChainError);
easy_from_to!(LightClientError, BeaconChainError);
easy_from_to!(MilhouseError, BeaconChainError);
easy_from_to!(AttestationError, BeaconChainError);

Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/execution_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::sync::Arc;
use tokio::task::JoinHandle;
use tracing::{Instrument, debug, debug_span, warn};
use tree_hash::TreeHash;
use types::payload::BlockProductionVersion;
use types::execution::BlockProductionVersion;
use types::*;

pub type PreparePayloadResult<E> = Result<BlockProposalContentsType<E>, BlockProductionError>;
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/naive_aggregation_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use itertools::Itertools;
use smallvec::SmallVec;
use std::collections::HashMap;
use tree_hash::{MerkleHasher, TreeHash, TreeHashType};
use types::SlotData;
use types::consts::altair::SYNC_COMMITTEE_SUBNET_COUNT;
use types::slot_data::SlotData;
use types::sync_committee_contribution::SyncContributionData;
use types::{
Attestation, AttestationData, AttestationRef, CommitteeIndex, EthSpec, Hash256, Slot,
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/observed_aggregates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ use std::collections::HashMap;
use std::marker::PhantomData;
use tree_hash::TreeHash;
use tree_hash_derive::TreeHash;
use types::SlotData;
use types::consts::altair::{
SYNC_COMMITTEE_SUBNET_COUNT, TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE,
};
use types::slot_data::SlotData;
use types::{
Attestation, AttestationData, AttestationRef, EthSpec, Hash256, Slot, SyncCommitteeContribution,
};
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/observed_attesters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::collections::{HashMap, HashSet};
use std::hash::Hash;
use std::marker::PhantomData;
use typenum::Unsigned;
use types::slot_data::SlotData;
use types::SlotData;
use types::{Epoch, EthSpec, Hash256, Slot};

/// The maximum capacity of the `AutoPruningEpochContainer`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ use strum::AsRefStr;
use tree_hash::TreeHash;
use tree_hash_derive::TreeHash;
use types::ChainSpec;
use types::SlotData;
use types::consts::altair::SYNC_COMMITTEE_SUBNET_COUNT;
use types::slot_data::SlotData;
use types::sync_committee::SyncCommitteeError;
use types::{
BeaconStateError, EthSpec, Hash256, SignedContributionAndProof, Slot,
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ use task_executor::{ShutdownReason, test_utils::TestRuntime};
use tree_hash::TreeHash;
use typenum::U4294967296;
use types::data_column_custody_group::CustodyIndex;
use types::execution::BlockProductionVersion;
use types::indexed_attestation::IndexedAttestationBase;
use types::payload::BlockProductionVersion;
use types::test_utils::TestRandom;
pub use types::test_utils::generate_deterministic_keypairs;
use types::*;
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/execution_layer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ use tracing::{Instrument, debug, debug_span, error, info, instrument, warn};
use tree_hash::TreeHash;
use types::beacon_block_body::KzgCommitments;
use types::builder_bid::BuilderBid;
use types::execution::BlockProductionVersion;
use types::non_zero_usize::new_non_zero_usize;
use types::payload::BlockProductionVersion;
use types::{
AbstractExecPayload, BlobsList, ExecutionPayloadDeneb, ExecutionRequests, KzgProofs,
SignedBlindedBeaconBlock,
Expand Down
4 changes: 1 addition & 3 deletions beacon_node/http_api/src/beacon/states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ use eth2::types::{
ValidatorsRequestBody,
};
use std::sync::Arc;
use types::{
AttestationShufflingId, CommitteeCache, Error as BeaconStateError, EthSpec, RelativeEpoch,
};
use types::{AttestationShufflingId, BeaconStateError, CommitteeCache, EthSpec, RelativeEpoch};
use warp::filters::BoxedFilter;
use warp::{Filter, Reply};
use warp_utils::query::multi_key_query;
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/http_api/src/produce_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use lighthouse_tracing::{SPAN_PRODUCE_BLOCK_V2, SPAN_PRODUCE_BLOCK_V3};
use ssz::Encode;
use std::sync::Arc;
use tracing::instrument;
use types::{payload::BlockProductionVersion, *};
use types::{execution::BlockProductionVersion, *};
use warp::{
Reply,
hyper::{Body, Response},
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/http_api/src/sync_committees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use std::collections::HashMap;
use tokio::sync::mpsc::UnboundedSender;
use tracing::{debug, error, warn};
use types::{
BeaconStateError, Epoch, EthSpec, SignedContributionAndProof, SyncCommitteeMessage, SyncDuty,
SyncSubnetId, slot_data::SlotData,
BeaconStateError, Epoch, EthSpec, SignedContributionAndProof, SlotData, SyncCommitteeMessage,
SyncDuty, SyncSubnetId,
};

/// The struct that is returned to the requesting HTTP client.
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/http_api/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use std::convert::TryInto;
use std::sync::Arc;
use tokio::time::Duration;
use tree_hash::TreeHash;
use types::application_domain::ApplicationDomain;
use types::ApplicationDomain;
use types::{
Domain, EthSpec, ExecutionBlockHash, Hash256, MainnetEthSpec, RelativeEpoch, SelectionProof,
SignedRoot, SingleAttestation, Slot, attestation::AttestationBase,
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/operation_pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ use typenum::Unsigned;
use types::{
AbstractExecPayload, Attestation, AttestationData, AttesterSlashing, BeaconState,
BeaconStateError, ChainSpec, Epoch, EthSpec, ProposerSlashing, SignedBeaconBlock,
SignedBlsToExecutionChange, SignedVoluntaryExit, Slot, SyncAggregate,
SyncCommitteeContribution, Validator, sync_aggregate::Error as SyncAggregateError,
SignedBlsToExecutionChange, SignedVoluntaryExit, Slot, SyncAggregate, SyncAggregateError,
SyncCommitteeContribution, Validator,
};

type SyncContributions<E> = RwLock<HashMap<SyncAggregateId, Vec<SyncCommitteeContribution<E>>>>;
Expand Down
2 changes: 1 addition & 1 deletion consensus/state_processing/src/common/altair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn get_base_reward(
validator_effective_balance: u64,
base_reward_per_increment: BaseRewardPerIncrement,
spec: &ChainSpec,
) -> Result<u64, Error> {
) -> Result<u64, BeaconStateError> {
validator_effective_balance
.safe_div(spec.effective_balance_increment)?
.safe_mul(base_reward_per_increment.as_u64())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub mod attesting_indices_electra {
for committee_index in committee_indices {
let beacon_committee = committees
.get(committee_index as usize)
.ok_or(Error::NoCommitteeFound(committee_index))?;
.ok_or(BeaconStateError::NoCommitteeFound(committee_index))?;

// This check is new to the spec's `process_attestation` in Electra.
if committee_index >= committee_count_per_slot {
Expand Down
4 changes: 2 additions & 2 deletions consensus/state_processing/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ pub fn is_valid_genesis_state<E: EthSpec>(state: &BeaconState<E>, spec: &ChainSp
pub fn process_activations<E: EthSpec>(
state: &mut BeaconState<E>,
spec: &ChainSpec,
) -> Result<(), Error> {
) -> Result<(), BeaconStateError> {
let (validators, balances, _) = state.validators_and_balances_and_progressive_balances_mut();
let mut validators_iter = validators.iter_cow();
while let Some((index, validator)) = validators_iter.next_cow() {
let validator = validator.into_mut()?;
let balance = balances
.get(index)
.copied()
.ok_or(Error::BalancesOutOfBounds(index))?;
.ok_or(BeaconStateError::BalancesOutOfBounds(index))?;
validator.effective_balance = std::cmp::min(
balance.safe_sub(balance.safe_rem(spec.effective_balance_increment)?)?,
spec.max_effective_balance,
Expand Down
2 changes: 1 addition & 1 deletion consensus/state_processing/src/per_block_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ pub fn process_randao<E: EthSpec, Payload: AbstractExecPayload<E>>(
pub fn process_eth1_data<E: EthSpec>(
state: &mut BeaconState<E>,
eth1_data: &Eth1Data,
) -> Result<(), Error> {
) -> Result<(), BeaconStateError> {
if let Some(new_eth1_data) = get_new_eth1_data(state, eth1_data)? {
*state.eth1_data_mut() = new_eth1_data;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ethereum_hashing::hash_fixed;
use types::{KzgCommitment, VERSIONED_HASH_VERSION_KZG, VersionedHash};
use types::{VersionedHash, kzg_ext::KzgCommitment, kzg_ext::consts::VERSIONED_HASH_VERSION_KZG};

pub fn kzg_commitment_to_versioned_hash(kzg_commitment: &KzgCommitment) -> VersionedHash {
let mut hashed_commitment = hash_fixed(&kzg_commitment.0);
Expand Down
21 changes: 0 additions & 21 deletions consensus/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ pub mod blob_sidecar {
};
}

pub mod payload {
pub use crate::execution::BlockProductionVersion;
}

pub mod execution_requests {
pub use crate::execution::{
ConsolidationRequests, DepositRequests, ExecutionRequests, RequestType, WithdrawalRequests,
Expand All @@ -135,10 +131,6 @@ pub mod data_column_custody_group {
};
}

pub mod sync_aggregate {
pub use crate::sync_committee::SyncAggregateError as Error;
}

pub mod light_client_update {
pub use crate::light_client::consts::{
CURRENT_SYNC_COMMITTEE_INDEX, CURRENT_SYNC_COMMITTEE_INDEX_ELECTRA, FINALIZED_ROOT_INDEX,
Expand All @@ -153,10 +145,6 @@ pub mod sync_committee_contribution {
};
}

pub mod slot_data {
pub use crate::core::SlotData;
}

pub mod signed_aggregate_and_proof {
pub use crate::attestation::SignedAggregateAndProofRefMut;
}
Expand All @@ -166,12 +154,3 @@ pub mod payload_attestation {
PayloadAttestation, PayloadAttestationData, PayloadAttestationMessage,
};
}

pub mod application_domain {
pub use crate::core::ApplicationDomain;
}

// Temporary re-exports to maintain backwards compatibility for Lighthouse.
pub use crate::kzg_ext::consts::VERSIONED_HASH_VERSION_KZG;
pub use crate::light_client::LightClientError as LightClientUpdateError;
pub use crate::state::BeaconStateError as Error;
2 changes: 1 addition & 1 deletion testing/execution_engine_integration/src/test_rig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use std::sync::Arc;
use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
use task_executor::TaskExecutor;
use tokio::time::sleep;
use types::payload::BlockProductionVersion;
use types::execution::BlockProductionVersion;
use types::{
Address, ChainSpec, EthSpec, ExecutionBlockHash, ExecutionPayload, ExecutionPayloadHeader,
ForkName, Hash256, MainnetEthSpec, Slot, Uint256,
Expand Down