Remove milhouse export aliases (#5286)

Closes #5141
This commit is contained in:
Lion - dapplion
2024-02-27 09:19:22 +08:00
committed by GitHub
parent a5d3408c59
commit 5dfc5c1f88
22 changed files with 83 additions and 94 deletions

View File

@@ -2,7 +2,7 @@ use crate::EpochProcessingError;
use types::beacon_state::BeaconState;
use types::eth_spec::EthSpec;
use types::participation_flags::ParticipationFlags;
use types::VList;
use types::List;
pub fn process_participation_flag_updates<T: EthSpec>(
state: &mut BeaconState<T>,
@@ -10,6 +10,6 @@ pub fn process_participation_flag_updates<T: EthSpec>(
*state.previous_epoch_participation_mut()? =
std::mem::take(state.current_epoch_participation_mut()?);
*state.current_epoch_participation_mut()? =
VList::repeat(ParticipationFlags::default(), state.validators().len())?;
List::repeat(ParticipationFlags::default(), state.validators().len())?;
Ok(())
}

View File

@@ -3,8 +3,8 @@ use crate::metrics;
use std::sync::Arc;
use types::{
consts::altair::{TIMELY_HEAD_FLAG_INDEX, TIMELY_SOURCE_FLAG_INDEX, TIMELY_TARGET_FLAG_INDEX},
BeaconStateError, Epoch, EthSpec, ParticipationFlags, ProgressiveBalancesCache, SyncCommittee,
VList, Validator,
BeaconStateError, Epoch, EthSpec, List, ParticipationFlags, ProgressiveBalancesCache,
SyncCommittee, Validator,
};
/// Provides a summary of validator participation during the epoch.
@@ -25,20 +25,20 @@ pub enum EpochProcessingSummary<T: EthSpec> {
#[derive(PartialEq, Debug)]
pub struct ParticipationEpochSummary<T: EthSpec> {
/// Copy of the validator registry prior to mutation.
validators: VList<Validator, T::ValidatorRegistryLimit>,
validators: List<Validator, T::ValidatorRegistryLimit>,
/// Copy of the participation flags for the previous epoch.
previous_epoch_participation: VList<ParticipationFlags, T::ValidatorRegistryLimit>,
previous_epoch_participation: List<ParticipationFlags, T::ValidatorRegistryLimit>,
/// Copy of the participation flags for the current epoch.
current_epoch_participation: VList<ParticipationFlags, T::ValidatorRegistryLimit>,
current_epoch_participation: List<ParticipationFlags, T::ValidatorRegistryLimit>,
previous_epoch: Epoch,
current_epoch: Epoch,
}
impl<T: EthSpec> ParticipationEpochSummary<T> {
pub fn new(
validators: VList<Validator, T::ValidatorRegistryLimit>,
previous_epoch_participation: VList<ParticipationFlags, T::ValidatorRegistryLimit>,
current_epoch_participation: VList<ParticipationFlags, T::ValidatorRegistryLimit>,
validators: List<Validator, T::ValidatorRegistryLimit>,
previous_epoch_participation: List<ParticipationFlags, T::ValidatorRegistryLimit>,
current_epoch_participation: List<ParticipationFlags, T::ValidatorRegistryLimit>,
previous_epoch: Epoch,
current_epoch: Epoch,
) -> Self {

View File

@@ -2,7 +2,7 @@ use super::errors::EpochProcessingError;
use safe_arith::SafeArith;
use types::beacon_state::BeaconState;
use types::eth_spec::EthSpec;
use types::{Unsigned, VList};
use types::{List, Unsigned};
pub fn process_eth1_data_reset<T: EthSpec>(
state: &mut BeaconState<T>,
@@ -13,7 +13,7 @@ pub fn process_eth1_data_reset<T: EthSpec>(
.safe_rem(T::SlotsPerEth1VotingPeriod::to_u64())?
== 0
{
*state.eth1_data_votes_mut() = VList::empty();
*state.eth1_data_votes_mut() = List::empty();
}
Ok(())
}

View File

@@ -4,13 +4,13 @@ use std::mem;
use std::sync::Arc;
use types::{
BeaconState, BeaconStateAltair, BeaconStateError as Error, ChainSpec, EpochCache, EthSpec,
Fork, ParticipationFlags, PendingAttestation, RelativeEpoch, SyncCommittee, VList,
Fork, List, ParticipationFlags, PendingAttestation, RelativeEpoch, SyncCommittee,
};
/// Translate the participation information from the epoch prior to the fork into Altair's format.
pub fn translate_participation<E: EthSpec>(
state: &mut BeaconState<E>,
pending_attestations: &VList<PendingAttestation<E>, E::MaxPendingAttestations>,
pending_attestations: &List<PendingAttestation<E>, E::MaxPendingAttestations>,
spec: &ChainSpec,
) -> Result<(), Error> {
// Previous epoch committee cache is required for `get_attesting_indices`.
@@ -51,8 +51,8 @@ pub fn upgrade_to_altair<E: EthSpec>(
let pre = pre_state.as_base_mut()?;
let default_epoch_participation =
VList::new(vec![ParticipationFlags::default(); pre.validators.len()])?;
let inactivity_scores = VList::new(vec![0; pre.validators.len()])?;
List::new(vec![ParticipationFlags::default(); pre.validators.len()])?;
let inactivity_scores = List::new(vec![0; pre.validators.len()])?;
let temp_sync_committee = Arc::new(SyncCommittee::temporary());

View File

@@ -1,7 +1,7 @@
use std::mem;
use types::{
BeaconState, BeaconStateCapella, BeaconStateError as Error, ChainSpec, EpochCache, EthSpec,
Fork, VList,
Fork, List,
};
/// Transform a `Merge` state into an `Capella` state.
@@ -61,7 +61,7 @@ pub fn upgrade_to_capella<E: EthSpec>(
// Capella
next_withdrawal_index: 0,
next_withdrawal_validator_index: 0,
historical_summaries: VList::default(),
historical_summaries: List::default(),
// Caches
total_active_balance: pre.total_active_balance,
progressive_balances_cache: mem::take(&mut pre.progressive_balances_cache),