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

@@ -73,7 +73,7 @@ impl<E: EthSpec> Case for SanityBlocks<E> {
.iter()
.try_for_each(|block| {
while state.slot < block.slot {
per_slot_processing(&mut state, spec).unwrap();
per_slot_processing(&mut state, None, spec).unwrap();
}
state

View File

@@ -66,7 +66,7 @@ impl<E: EthSpec> Case for SanitySlots<E> {
state.build_all_caches(spec).unwrap();
let mut result = (0..self.slots)
.try_for_each(|_| per_slot_processing(&mut state, spec))
.try_for_each(|_| per_slot_processing(&mut state, None, spec))
.map(|_| state);
compare_beacon_state_results_without_caches(&mut result, &mut expected)