Optimization: avoid recomputing known state roots (#762)

* Start adding optimization

* Add temp fix for protobuf issue

* Fix compile errors

* Fix protobuf import
This commit is contained in:
Paul Hauner
2020-01-03 15:09:00 +11:00
committed by GitHub
parent 39df89521f
commit 647034b637
11 changed files with 42 additions and 16 deletions

View File

@@ -216,7 +216,7 @@ pub fn state_root_at_slot<T: BeaconChainTypes>(
// Ensure the next epoch state caches are built in case of an epoch transition.
state.build_committee_cache(RelativeEpoch::Next, spec)?;
state_processing::per_slot_processing(&mut state, spec)?;
state_processing::per_slot_processing(&mut state, None, spec)?;
}
// Note: this is an expensive operation. Once the tree hash cache is implement it may be