Very spicy consensus optimisations

This commit is contained in:
Michael Sproul
2022-02-18 17:34:53 +11:00
parent 82bf8a3351
commit 0a4dcdd4e3
10 changed files with 226 additions and 261 deletions

View File

@@ -45,9 +45,13 @@ pub fn run_transition_blocks<T: EthSpec>(
load_from_ssz_with(&block_path, spec, SignedBeaconBlock::from_ssz_bytes)?;
let t = std::time::Instant::now();
let post_state = do_transition(pre_state.clone(), block, spec)?;
let mut post_state = do_transition(pre_state.clone(), block.clone(), spec)?;
println!("Total transition time: {}ms", t.elapsed().as_millis());
if post_state.update_tree_hash_cache().unwrap() != block.state_root() {
return Err("state root mismatch".into());
}
let mut output_file =
File::create(output_path).map_err(|e| format!("Unable to create output file: {:?}", e))?;