Add cache builds when advancing chain slot

This commit is contained in:
Paul Hauner 2019-03-27 10:34:52 +11:00
parent c27fdbe37f
commit c82bad7602
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6

View File

@ -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)?;
}