mirror of
https://github.com/sigp/lighthouse.git
synced 2026-06-01 05:37:05 +00:00
Remove consensus/types re-exports (#8540)
There are certain crates which we re-export within `types` which creates a fragmented DevEx, where there are various ways to import the same crates.
```rust
// consensus/types/src/lib.rs
pub use bls::{
AggregatePublicKey, AggregateSignature, Error as BlsError, Keypair, PUBLIC_KEY_BYTES_LEN,
PublicKey, PublicKeyBytes, SIGNATURE_BYTES_LEN, SecretKey, Signature, SignatureBytes,
get_withdrawal_credentials,
};
pub use context_deserialize::{ContextDeserialize, context_deserialize};
pub use fixed_bytes::FixedBytesExtended;
pub use milhouse::{self, List, Vector};
pub use ssz_types::{BitList, BitVector, FixedVector, VariableList, typenum, typenum::Unsigned};
pub use superstruct::superstruct;
```
This PR removes these re-exports and makes it explicit that these types are imported from a non-`consensus/types` crate.
Co-Authored-By: Mac L <mjladson@pm.me>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::EpochProcessingError;
|
||||
use types::List;
|
||||
use milhouse::List;
|
||||
use types::beacon_state::BeaconState;
|
||||
use types::eth_spec::EthSpec;
|
||||
use types::participation_flags::ParticipationFlags;
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
use super::base::{TotalBalances, ValidatorStatus, validator_statuses::InclusionInfo};
|
||||
use crate::metrics;
|
||||
use milhouse::List;
|
||||
use std::sync::Arc;
|
||||
use types::{
|
||||
BeaconStateError, Epoch, EthSpec, List, ParticipationFlags, ProgressiveBalancesCache,
|
||||
SyncCommittee, Validator,
|
||||
BeaconStateError, Epoch, EthSpec, ParticipationFlags, ProgressiveBalancesCache, SyncCommittee,
|
||||
Validator,
|
||||
consts::altair::{TIMELY_HEAD_FLAG_INDEX, TIMELY_SOURCE_FLAG_INDEX, TIMELY_TARGET_FLAG_INDEX},
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use types::{BeaconStateError, EpochCacheError, InconsistentFork, milhouse};
|
||||
use milhouse;
|
||||
use types::{BeaconStateError, EpochCacheError, InconsistentFork};
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum EpochProcessingError {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use super::errors::EpochProcessingError;
|
||||
use safe_arith::SafeArith;
|
||||
use tree_hash::TreeHash;
|
||||
use types::Unsigned;
|
||||
use typenum::Unsigned;
|
||||
use types::beacon_state::BeaconState;
|
||||
use types::eth_spec::EthSpec;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use types::{BeaconState, BeaconStateError, BitVector, Checkpoint, Epoch, EthSpec, Hash256};
|
||||
use ssz_types::BitVector;
|
||||
use types::{BeaconState, BeaconStateError, Checkpoint, Epoch, EthSpec, Hash256};
|
||||
|
||||
/// This is a subset of the `BeaconState` which is used to compute justification and finality
|
||||
/// without modifying the `BeaconState`.
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
use super::errors::EpochProcessingError;
|
||||
use milhouse::List;
|
||||
use safe_arith::SafeArith;
|
||||
use typenum::Unsigned;
|
||||
use types::beacon_state::BeaconState;
|
||||
use types::eth_spec::EthSpec;
|
||||
use types::{List, Unsigned};
|
||||
|
||||
pub fn process_eth1_data_reset<E: EthSpec>(
|
||||
state: &mut BeaconState<E>,
|
||||
|
||||
@@ -8,19 +8,20 @@ use crate::{
|
||||
per_epoch_processing::{Delta, Error, ParticipationEpochSummary},
|
||||
};
|
||||
use itertools::izip;
|
||||
use milhouse::{Cow, List, Vector};
|
||||
use safe_arith::{SafeArith, SafeArithIter};
|
||||
use std::cmp::{max, min};
|
||||
use std::collections::{BTreeSet, HashMap};
|
||||
use tracing::instrument;
|
||||
use typenum::Unsigned;
|
||||
use types::{
|
||||
ActivationQueue, BeaconState, BeaconStateError, ChainSpec, Checkpoint, DepositData, Epoch,
|
||||
EthSpec, ExitCache, ForkName, List, ParticipationFlags, PendingDeposit,
|
||||
ProgressiveBalancesCache, RelativeEpoch, Unsigned, Validator, Vector,
|
||||
EthSpec, ExitCache, ForkName, ParticipationFlags, PendingDeposit, ProgressiveBalancesCache,
|
||||
RelativeEpoch, Validator,
|
||||
consts::altair::{
|
||||
NUM_FLAG_INDICES, PARTICIPATION_FLAG_WEIGHTS, TIMELY_HEAD_FLAG_INDEX,
|
||||
TIMELY_TARGET_FLAG_INDEX, WEIGHT_DENOMINATOR,
|
||||
},
|
||||
milhouse::Cow,
|
||||
};
|
||||
|
||||
pub struct SinglePassConfig {
|
||||
|
||||
@@ -4,7 +4,8 @@ use crate::per_epoch_processing::{
|
||||
single_pass::{SinglePassConfig, process_epoch_single_pass},
|
||||
};
|
||||
use safe_arith::{SafeArith, SafeArithIter};
|
||||
use types::{BeaconState, ChainSpec, EthSpec, Unsigned};
|
||||
use typenum::Unsigned;
|
||||
use types::{BeaconState, ChainSpec, EthSpec};
|
||||
|
||||
/// Process slashings.
|
||||
pub fn process_slashings<E: EthSpec>(
|
||||
|
||||
Reference in New Issue
Block a user