diff --git a/consensus-core/src/consensus_core.rs b/consensus-core/src/consensus_core.rs index 666b5472..b6fc4ed8 100644 --- a/consensus-core/src/consensus_core.rs +++ b/consensus-core/src/consensus_core.rs @@ -15,10 +15,11 @@ use crate::proof::{ }; use crate::types::bls::{PublicKey, Signature}; use crate::types::{ - Bootstrap, FinalityUpdate, GenericUpdate, Header, LightClientStore, OptimisticUpdate, Update + Bootstrap, FinalityUpdate, GenericUpdate, Header, LightClientStore, OptimisticUpdate, Update, }; use crate::utils::{ - calculate_fork_version, compute_committee_sign_root, compute_fork_data_root, get_participating_keys + calculate_fork_version, compute_committee_sign_root, compute_fork_data_root, + get_participating_keys, }; pub fn verify_bootstrap(bootstrap: &Bootstrap, checkpoint: B256) -> Result<()> { @@ -107,7 +108,6 @@ pub fn apply_optimistic_update( apply_generic_update(store, &update) } - // implements state changes from apply_light_client_update and process_light_client_update in // the specification /// Returns the new checkpoint if one is created, otherwise None diff --git a/consensus-core/src/utils.rs b/consensus-core/src/utils.rs index ad99e65d..69f9a922 100644 --- a/consensus-core/src/utils.rs +++ b/consensus-core/src/utils.rs @@ -7,7 +7,6 @@ use tree_hash_derive::TreeHash; use crate::types::{bls::PublicKey, SyncCommittee}; - pub fn compute_committee_sign_root(header: B256, fork_data_root: B256) -> B256 { let domain_type = [7, 00, 00, 00]; let domain = compute_domain(domain_type, fork_data_root); diff --git a/consensus/src/consensus.rs b/consensus/src/consensus.rs index fd2bd580..ddca157b 100644 --- a/consensus/src/consensus.rs +++ b/consensus/src/consensus.rs @@ -34,9 +34,7 @@ use consensus_core::{ apply_finality_update, apply_optimistic_update, apply_update, calc_sync_period, errors::ConsensusError, expected_current_slot, get_bits, - types::{ - ExecutionPayload, FinalityUpdate, LightClientStore, OptimisticUpdate, Update, - }, + types::{ExecutionPayload, FinalityUpdate, LightClientStore, OptimisticUpdate, Update}, }; pub struct ConsensusClient { @@ -383,7 +381,7 @@ impl Inner { pub fn verify_update(&self, update: &Update) -> Result<()> { verify_update( - &update, + update, self.expected_current_slot(), &self.store, self.config.chain.genesis_root, @@ -393,7 +391,7 @@ impl Inner { fn verify_finality_update(&self, update: &FinalityUpdate) -> Result<()> { verify_finality_update( - &update, + update, self.expected_current_slot(), &self.store, self.config.chain.genesis_root, @@ -403,7 +401,7 @@ impl Inner { fn verify_optimistic_update(&self, update: &OptimisticUpdate) -> Result<()> { verify_optimistic_update( - &update, + update, self.expected_current_slot(), &self.store, self.config.chain.genesis_root, @@ -418,7 +416,6 @@ impl Inner { } } - fn apply_finality_update(&mut self, update: &FinalityUpdate) { let new_checkpoint = apply_finality_update(&mut self.store, update); if new_checkpoint.is_some() {