diff --git a/eth2/types/src/beacon_state.rs b/eth2/types/src/beacon_state.rs index c4000b8d8..b5dbf2a4a 100644 --- a/eth2/types/src/beacon_state.rs +++ b/eth2/types/src/beacon_state.rs @@ -110,7 +110,9 @@ where pub current_crosslinks: FixedLenVec, pub previous_crosslinks: FixedLenVec, pub latest_block_roots: FixedLenVec, + #[compare_fields(as_slice)] latest_state_roots: FixedLenVec, + #[compare_fields(as_slice)] latest_active_index_roots: FixedLenVec, latest_slashed_balances: FixedLenVec, pub latest_block_header: BeaconBlockHeader, @@ -795,7 +797,9 @@ impl BeaconState { ) -> Result<(), Error> { let i = Self::cache_index(relative_epoch); - if self.committee_caches[i].is_initialized_at(self.previous_epoch()) { + if self.committee_caches[i] + .is_initialized_at(relative_epoch.into_epoch(self.current_epoch())) + { Ok(()) } else { self.force_build_committee_cache(relative_epoch, spec)