From a9202d187f6422f73c9c36ec6ce39fd80a419d1a Mon Sep 17 00:00:00 2001 From: Jun Kimura Date: Mon, 23 Dec 2024 20:35:57 +0900 Subject: [PATCH] S-1: fix typo Signed-off-by: Jun Kimura --- crates/consensus/src/bls.rs | 8 ++++---- crates/consensus/src/errors.rs | 2 +- crates/consensus/src/sync_protocol.rs | 4 ++-- crates/light-client-verifier/src/consensus.rs | 8 ++++---- crates/light-client-verifier/src/updates.rs | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/consensus/src/bls.rs b/crates/consensus/src/bls.rs index a6106ca..5cbd2a9 100644 --- a/crates/consensus/src/bls.rs +++ b/crates/consensus/src/bls.rs @@ -195,7 +195,7 @@ impl TryFrom for BLSSignature { } } -pub fn aggreate_public_key(keys: &[BLSPublicKey]) -> Result { +pub fn aggregate_public_key(keys: &[BLSPublicKey]) -> Result { Ok(BLSAggregatePublicKey::into_aggregate(keys)?) } @@ -204,13 +204,13 @@ pub fn fast_aggregate_verify( msg: H256, signature: BLSSignature, ) -> Result { - let aggregate_pubkey = aggreate_public_key(&pubkeys)?; + let aggregate_pubkey = aggregate_public_key(&pubkeys)?; let aggregate_signature = BLSAggregateSignature::from_signature(&signature); Ok(aggregate_signature.fast_aggregate_verify_pre_aggregated(msg.as_bytes(), &aggregate_pubkey)) } -pub fn is_equal_pubkeys_and_aggreate_pub_key( +pub fn is_equal_pubkeys_and_aggregate_pub_key( pubkeys: &Vector, aggregate_pubkey: &PublicKey, ) -> Result<(), Error> { @@ -218,7 +218,7 @@ pub fn is_equal_pubkeys_and_aggreate_pub_key( .iter() .map(|k| k.clone().try_into().unwrap()) .collect(); - let agg_pubkey: PublicKey = aggreate_public_key(&pubkeys)?.into(); + let agg_pubkey: PublicKey = aggregate_public_key(&pubkeys)?.into(); if aggregate_pubkey == &agg_pubkey { Ok(()) } else { diff --git a/crates/consensus/src/errors.rs b/crates/consensus/src/errors.rs index 5772ecd..d1281a0 100644 --- a/crates/consensus/src/errors.rs +++ b/crates/consensus/src/errors.rs @@ -21,7 +21,7 @@ pub enum Error { InvalidBLSSignatureLenght(usize, usize), /// invalid bls public key length: `expected={0} actual={1}` InvalidBLSPublicKeyLength(usize, usize), - /// bls aggreate public key mismatch: `{0:?} != {1:?}` + /// bls aggregate public key mismatch: `{0:?} != {1:?}` BLSAggregatePublicKeyMismatch(PublicKey, PublicKey), /// invalid address length: `expected={0} actual={1}` InvalidAddressLength(usize, usize), diff --git a/crates/consensus/src/sync_protocol.rs b/crates/consensus/src/sync_protocol.rs index eec4a20..aa99c47 100644 --- a/crates/consensus/src/sync_protocol.rs +++ b/crates/consensus/src/sync_protocol.rs @@ -1,5 +1,5 @@ use crate::{ - bls::{is_equal_pubkeys_and_aggreate_pub_key, PublicKey, Signature}, + bls::{is_equal_pubkeys_and_aggregate_pub_key, PublicKey, Signature}, errors::Error, internal_prelude::*, types::U64, @@ -21,7 +21,7 @@ pub struct SyncCommittee { impl SyncCommittee { pub fn validate(&self) -> Result<(), Error> { - is_equal_pubkeys_and_aggreate_pub_key(&self.pubkeys, &self.aggregate_pubkey) + is_equal_pubkeys_and_aggregate_pub_key(&self.pubkeys, &self.aggregate_pubkey) } } diff --git a/crates/light-client-verifier/src/consensus.rs b/crates/light-client-verifier/src/consensus.rs index f713f6e..74b3170 100644 --- a/crates/light-client-verifier/src/consensus.rs +++ b/crates/light-client-verifier/src/consensus.rs @@ -387,7 +387,7 @@ pub mod test_utils { use ethereum_consensus::ssz_rs::Vector; use ethereum_consensus::{ beacon::{BlockNumber, Checkpoint, Epoch, Slot}, - bls::{aggreate_public_key, PublicKey, Signature}, + bls::{aggregate_public_key, PublicKey, Signature}, fork::deneb, merkle::MerkleTree, preset::minimal::DenebBeaconBlock, @@ -441,7 +441,7 @@ pub mod test_utils { for v in self.committee.iter() { pubkeys.push(v.public_key()); } - let aggregate_pubkey = aggreate_public_key(&pubkeys.to_vec()).unwrap(); + let aggregate_pubkey = aggregate_public_key(&pubkeys.to_vec()).unwrap(); SyncCommittee { pubkeys: Vector::from_iter(pubkeys.into_iter().map(PublicKey::from)), aggregate_pubkey: PublicKey::from(aggregate_pubkey), @@ -855,7 +855,7 @@ mod tests { }; use ethereum_consensus::{ beacon::Version, - bls::aggreate_public_key, + bls::aggregate_public_key, config::{minimal, Config}, fork::{ altair::ALTAIR_FORK_SPEC, bellatrix::BELLATRIX_FORK_SPEC, ForkParameter, @@ -897,7 +897,7 @@ mod tests { .iter() .map(|k| k.clone().try_into().unwrap()) .collect(); - let aggregated_key = aggreate_public_key(&pubkeys).unwrap(); + let aggregated_key = aggregate_public_key(&pubkeys).unwrap(); let pubkey = BLSPublicKey { point: aggregated_key.point, }; diff --git a/crates/light-client-verifier/src/updates.rs b/crates/light-client-verifier/src/updates.rs index 8fa7e2f..c0da19e 100644 --- a/crates/light-client-verifier/src/updates.rs +++ b/crates/light-client-verifier/src/updates.rs @@ -77,7 +77,7 @@ pub trait ConsensusUpdate: /// validate the basic properties of the update fn validate_basic(&self, ctx: &C) -> Result<(), Error> { - // ensure that sync committee's aggreated key matches pubkeys + // ensure that sync committee's aggregated key matches pubkeys if let Some(next_sync_committee) = self.next_sync_committee() { next_sync_committee.validate()?; }