Beacon state diffs!

This commit is contained in:
Michael Sproul
2022-02-24 08:46:03 +11:00
parent 0a4dcdd4e3
commit 143cf59504
38 changed files with 860 additions and 277 deletions

View File

@@ -5,7 +5,7 @@ use crate::decode::{ssz_decode_file_with, ssz_decode_state, yaml_decode_file};
use serde_derive::Deserialize;
use state_processing::{
per_block_processing, per_slot_processing, BlockProcessingError, BlockSignatureStrategy,
VerifyBlockRoot,
ConsensusContext, VerifyBlockRoot,
};
use types::{BeaconState, EthSpec, ForkName, RelativeEpoch, SignedBeaconBlock};
@@ -94,26 +94,28 @@ impl<E: EthSpec> Case for SanityBlocks<E> {
.build_committee_cache(RelativeEpoch::Current, spec)
.unwrap();
let mut ctxt = ConsensusContext::new(indiv_state.slot());
per_block_processing(
&mut indiv_state,
signed_block,
None,
BlockSignatureStrategy::VerifyIndividual,
VerifyBlockRoot::True,
&mut ctxt,
spec,
)?;
let mut ctxt = ConsensusContext::new(indiv_state.slot());
per_block_processing(
&mut bulk_state,
signed_block,
None,
BlockSignatureStrategy::VerifyBulk,
VerifyBlockRoot::True,
&mut ctxt,
spec,
)?;
if block.state_root() == bulk_state.canonical_root()
&& block.state_root() == indiv_state.canonical_root()
if block.state_root() == bulk_state.update_tree_hash_cache().unwrap()
&& block.state_root() == indiv_state.update_tree_hash_cache().unwrap()
{
Ok(())
} else {