Fix EpochCache handling in ef-tests

This commit is contained in:
Michael Sproul
2023-06-30 22:57:36 +10:00
parent 2df714e2cd
commit f631b515f6
6 changed files with 31 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ use crate::decode::{ssz_decode_state, yaml_decode_file};
use crate::type_name;
use crate::type_name::TypeName;
use serde_derive::Deserialize;
use state_processing::epoch_cache::initialize_epoch_cache;
use state_processing::per_epoch_processing::capella::process_historical_summaries_update;
use state_processing::per_epoch_processing::{
altair, base,
@@ -135,6 +136,7 @@ impl<E: EthSpec> EpochTransition<E> for RewardsAndPenalties {
impl<E: EthSpec> EpochTransition<E> for RegistryUpdates {
fn run(state: &mut BeaconState<E>, spec: &ChainSpec) -> Result<(), EpochProcessingError> {
initialize_epoch_cache(state, state.current_epoch(), spec)?;
process_registry_updates(state, spec)
}
}

View File

@@ -4,6 +4,7 @@ use crate::case_result::{check_state_diff, compare_beacon_state_results_without_
use crate::decode::{ssz_decode_file, ssz_decode_file_with, ssz_decode_state, yaml_decode_file};
use crate::testing_spec;
use serde_derive::Deserialize;
use state_processing::epoch_cache::initialize_epoch_cache;
use state_processing::{
per_block_processing::{
errors::BlockProcessingError,
@@ -86,6 +87,7 @@ impl<E: EthSpec> Operation<E> for Attestation<E> {
spec: &ChainSpec,
_: &Operations<E, Self>,
) -> Result<(), BlockProcessingError> {
initialize_epoch_cache(state, state.current_epoch(), spec)?;
let mut ctxt = ConsensusContext::new(state.slot());
match state {
BeaconState::Base(_) => base::process_attestations(