From c82bad7602ba8257a432cba9ab4ba05859d0af9e Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Wed, 27 Mar 2019 10:34:52 +1100 Subject: [PATCH] Add cache builds when advancing chain slot --- beacon_node/beacon_chain/src/beacon_chain.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index f0290d9391..2caee2f988 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -342,6 +342,10 @@ where // If required, transition the new state to the present slot. for _ in state.slot.as_u64()..present_slot.as_u64() { + // Ensure the next epoch state caches are built in case of an epoch transition. + state.build_epoch_cache(RelativeEpoch::NextWithoutRegistryChange, &self.spec)?; + state.build_epoch_cache(RelativeEpoch::NextWithRegistryChange, &self.spec)?; + per_slot_processing(&mut *state, &latest_block_header, &self.spec)?; }