mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-17 11:52:42 +00:00
Fix EpochCache handling in ef-tests (#4454)
This commit is contained in:
@@ -23,6 +23,7 @@ pub fn initialize_epoch_cache<E: EthSpec>(
|
||||
}
|
||||
|
||||
// Compute base rewards.
|
||||
state.build_total_active_balance_cache_at(epoch, spec)?;
|
||||
let total_active_balance = state.get_total_active_balance_at_epoch(epoch)?;
|
||||
let sqrt_total_active_balance = SqrtTotalActiveBalance::new(total_active_balance);
|
||||
let base_reward_per_increment = BaseRewardPerIncrement::new(total_active_balance, spec)?;
|
||||
|
||||
@@ -28,6 +28,8 @@ pub fn process_epoch<T: EthSpec>(
|
||||
state.build_committee_cache(RelativeEpoch::Previous, spec)?;
|
||||
state.build_committee_cache(RelativeEpoch::Current, spec)?;
|
||||
state.build_committee_cache(RelativeEpoch::Next, spec)?;
|
||||
state.build_total_active_balance_cache_at(state.current_epoch(), spec)?;
|
||||
initialize_epoch_cache(state, state.current_epoch(), spec)?;
|
||||
|
||||
// Pre-compute participating indices and total balances.
|
||||
let mut participation_cache = ParticipationCache::new(state, spec)?;
|
||||
|
||||
@@ -24,6 +24,8 @@ pub fn process_epoch<T: EthSpec>(
|
||||
state.build_committee_cache(RelativeEpoch::Previous, spec)?;
|
||||
state.build_committee_cache(RelativeEpoch::Current, spec)?;
|
||||
state.build_committee_cache(RelativeEpoch::Next, spec)?;
|
||||
state.build_total_active_balance_cache_at(state.current_epoch(), spec)?;
|
||||
initialize_epoch_cache(state, state.current_epoch(), spec)?;
|
||||
|
||||
// Load the struct we use to assign validators into sets based on their participation.
|
||||
//
|
||||
|
||||
@@ -24,6 +24,8 @@ pub fn process_epoch<T: EthSpec>(
|
||||
state.build_committee_cache(RelativeEpoch::Previous, spec)?;
|
||||
state.build_committee_cache(RelativeEpoch::Current, spec)?;
|
||||
state.build_committee_cache(RelativeEpoch::Next, spec)?;
|
||||
state.build_total_active_balance_cache_at(state.current_epoch(), spec)?;
|
||||
initialize_epoch_cache(state, state.current_epoch(), spec)?;
|
||||
|
||||
// Pre-compute participating indices and total balances.
|
||||
let mut participation_cache = ParticipationCache::new(state, spec)?;
|
||||
|
||||
Reference in New Issue
Block a user