From fec71685129d433e6e1019ba688f2b9c84a4565f Mon Sep 17 00:00:00 2001 From: John Adler Date: Fri, 26 Jul 2019 15:26:06 -0400 Subject: [PATCH] Fix lots of typos. --- README.md | 4 ++-- beacon_node/beacon_chain/src/beacon_chain.rs | 8 ++++---- beacon_node/beacon_chain/src/fork_choice.rs | 2 +- beacon_node/eth2-libp2p/src/config.rs | 2 +- beacon_node/eth2-libp2p/src/rpc/methods.rs | 4 ++-- beacon_node/network/src/message_handler.rs | 2 +- beacon_node/network/src/sync/import_queue.rs | 2 +- beacon_node/network/src/sync/simple_sync.rs | 10 +++++----- beacon_node/rpc/src/attestation.rs | 2 +- beacon_node/src/run.rs | 2 +- beacon_node/store/src/block_at_slot.rs | 14 +++++++------- beacon_node/store/src/disk_db.rs | 4 ++-- beacon_node/store/src/lib.rs | 4 ++-- beacon_node/store/src/store.rs | 2 +- docs/onboarding.md | 2 +- eth2/lmd_ghost/src/reduced_tree.rs | 4 ++-- eth2/operation_pool/src/lib.rs | 2 +- .../benches/bench_epoch_processing.rs | 2 +- .../src/per_block_processing/errors.rs | 4 ++-- .../src/per_block_processing/verify_transfer.rs | 2 +- eth2/state_processing/src/per_epoch_processing.rs | 2 +- .../src/per_epoch_processing/process_slashings.rs | 4 ++-- .../src/per_epoch_processing/registry_updates.rs | 2 +- .../src/per_epoch_processing/validator_statuses.rs | 2 +- eth2/types/src/slot_epoch.rs | 2 +- .../test_utils/builders/testing_deposit_builder.rs | 2 +- .../types/src/test_utils/test_random/secret_key.rs | 2 +- eth2/utils/bls/src/aggregate_signature.rs | 8 ++++---- eth2/utils/cached_tree_hash/src/btree_overlay.rs | 2 +- eth2/utils/cached_tree_hash/src/impls/vec.rs | 4 ++-- eth2/utils/cached_tree_hash/src/tree_hash_cache.rs | 2 +- eth2/utils/honey-badger-split/src/lib.rs | 2 +- eth2/utils/ssz/README.md | 4 ++-- eth2/utils/ssz/src/decode/impls.rs | 2 +- eth2/utils/tree_hash/src/merkleize_standard.rs | 2 +- eth2/utils/tree_hash_derive/src/lib.rs | 2 +- eth2/validator_change/src/lib.rs | 2 +- protos/src/services.proto | 6 +++--- tests/ef_tests/tests/tests.rs | 2 +- validator_client/src/attestation_producer/mod.rs | 2 +- validator_client/src/block_producer/mod.rs | 2 +- 41 files changed, 68 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index 85290f6c8..e4f2e8ccb 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,12 @@ An open-source Ethereum 2.0 client, written in Rust and maintained by Sigma Prim Lighthouse is: - Fully open-source, licensed under Apache 2.0. -- Security-focussed, fuzzing has begun and security reviews are planned +- Security-focused, fuzzing has begun and security reviews are planned for late-2019. - Built in [Rust](https://www.rust-lang.org/), a modern language providing unique safety guarantees and excellent performance (comparable to C++). - Funded by various organisations, including Sigma Prime, the - Ethereum Foundation, Consensys and private individuals. + Ethereum Foundation, ConsenSys and private individuals. - Actively working to promote an inter-operable, multi-client Ethereum 2.0. diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index 96ebe4b41..e5a163a16 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -70,10 +70,10 @@ pub struct BeaconChain { /// Stores all operations (e.g., `Attestation`, `Deposit`, etc) that are candidates for /// inclusion in a block. pub op_pool: OperationPool, - /// Stores a "snapshot" of the chain at the time the head-of-the-chain block was recieved. + /// Stores a "snapshot" of the chain at the time the head-of-the-chain block was received. canonical_head: RwLock>, /// The same state from `self.canonical_head`, but updated at the start of each slot with a - /// skip slot if no block is recieved. This is effectively a cache that avoids repeating calls + /// skip slot if no block is received. This is effectively a cache that avoids repeating calls /// to `per_slot_processing`. state: RwLock>, /// The root of the genesis block. @@ -391,12 +391,12 @@ impl BeaconChain { /// /// Information is read from the current state, so only information from the present and prior /// epoch is available. - pub fn validator_attestion_slot_and_shard( + pub fn validator_attestation_slot_and_shard( &self, validator_index: usize, ) -> Result, BeaconStateError> { trace!( - "BeaconChain::validator_attestion_slot_and_shard: validator_index: {}", + "BeaconChain::validator_attestation_slot_and_shard: validator_index: {}", validator_index ); if let Some(attestation_duty) = self diff --git a/beacon_node/beacon_chain/src/fork_choice.rs b/beacon_node/beacon_chain/src/fork_choice.rs index c693145ea..30b20ffe6 100644 --- a/beacon_node/beacon_chain/src/fork_choice.rs +++ b/beacon_node/beacon_chain/src/fork_choice.rs @@ -145,7 +145,7 @@ impl ForkChoice { // 2. Ignore all attestations to the zero hash. // // (1) becomes weird once we hit finality and fork choice drops the genesis block. (2) is - // fine becuase votes to the genesis block are not useful; all validators implicitly attest + // fine because votes to the genesis block are not useful; all validators implicitly attest // to genesis just by being present in the chain. if block_hash != Hash256::zero() { let block_slot = attestation diff --git a/beacon_node/eth2-libp2p/src/config.rs b/beacon_node/eth2-libp2p/src/config.rs index ea87075b7..4c6f0b6da 100644 --- a/beacon_node/eth2-libp2p/src/config.rs +++ b/beacon_node/eth2-libp2p/src/config.rs @@ -54,7 +54,7 @@ impl Default for Config { network_dir.push("network"); Config { network_dir, - listen_address: "127.0.0.1".parse().expect("vaild ip address"), + listen_address: "127.0.0.1".parse().expect("valid ip address"), libp2p_port: 9000, discovery_address: "127.0.0.1".parse().expect("valid ip address"), discovery_port: 9000, diff --git a/beacon_node/eth2-libp2p/src/rpc/methods.rs b/beacon_node/eth2-libp2p/src/rpc/methods.rs index 0d6311d9d..8cc336395 100644 --- a/beacon_node/eth2-libp2p/src/rpc/methods.rs +++ b/beacon_node/eth2-libp2p/src/rpc/methods.rs @@ -43,7 +43,7 @@ pub enum GoodbyeReason { ClientShutdown = 1, /// Incompatible networks. - IrreleventNetwork = 2, + IrrelevantNetwork = 2, /// Error/fault in the RPC. Fault = 3, @@ -56,7 +56,7 @@ impl From for GoodbyeReason { fn from(id: u64) -> GoodbyeReason { match id { 1 => GoodbyeReason::ClientShutdown, - 2 => GoodbyeReason::IrreleventNetwork, + 2 => GoodbyeReason::IrrelevantNetwork, 3 => GoodbyeReason::Fault, _ => GoodbyeReason::Unknown, } diff --git a/beacon_node/network/src/message_handler.rs b/beacon_node/network/src/message_handler.rs index b1d88415c..4e510094f 100644 --- a/beacon_node/network/src/message_handler.rs +++ b/beacon_node/network/src/message_handler.rs @@ -252,7 +252,7 @@ impl MessageHandler { fn handle_gossip(&mut self, peer_id: PeerId, gossip_message: PubsubMessage) { match gossip_message { PubsubMessage::Block(message) => { - let _should_foward_on = + let _should_forward_on = self.sync .on_block_gossip(peer_id, message, &mut self.network_context); } diff --git a/beacon_node/network/src/sync/import_queue.rs b/beacon_node/network/src/sync/import_queue.rs index fe640aaa0..504add4f8 100644 --- a/beacon_node/network/src/sync/import_queue.rs +++ b/beacon_node/network/src/sync/import_queue.rs @@ -270,7 +270,7 @@ pub struct PartialBeaconBlock { impl PartialBeaconBlock { /// Attempts to build a block. /// - /// Does not comsume the `PartialBeaconBlock`. + /// Does not consume the `PartialBeaconBlock`. pub fn attempt_complete(&self) -> PartialBeaconBlockCompletion { if self.header.is_none() { PartialBeaconBlockCompletion::MissingHeader(self.slot) diff --git a/beacon_node/network/src/sync/simple_sync.rs b/beacon_node/network/src/sync/simple_sync.rs index 91594b999..aeabd0507 100644 --- a/beacon_node/network/src/sync/simple_sync.rs +++ b/beacon_node/network/src/sync/simple_sync.rs @@ -186,7 +186,7 @@ impl SimpleSync { "reason" => "network_id" ); - network.disconnect(peer_id.clone(), GoodbyeReason::IrreleventNetwork); + network.disconnect(peer_id.clone(), GoodbyeReason::IrrelevantNetwork); } else if remote.latest_finalized_epoch <= local.latest_finalized_epoch && remote.latest_finalized_root != self.chain.spec.zero_hash && local.latest_finalized_root != self.chain.spec.zero_hash @@ -202,7 +202,7 @@ impl SimpleSync { "peer" => format!("{:?}", peer_id), "reason" => "different finalized chain" ); - network.disconnect(peer_id.clone(), GoodbyeReason::IrreleventNetwork); + network.disconnect(peer_id.clone(), GoodbyeReason::IrrelevantNetwork); } else if remote.latest_finalized_epoch < local.latest_finalized_epoch { // The node has a lower finalized epoch, their chain is not useful to us. There are two // cases where a node can have a lower finalized epoch: @@ -529,7 +529,7 @@ impl SimpleSync { .import_queue .enqueue_bodies(res.block_bodies, peer_id.clone()); - // Attempt to process all recieved bodies by recursively processing the latest block + // Attempt to process all received bodies by recursively processing the latest block if let Some(root) = last_root { match self.attempt_process_partial_block(peer_id, root, network, &"rpc") { Some(BlockProcessingOutcome::Processed { block_root: _ }) => { @@ -606,7 +606,7 @@ impl SimpleSync { } // Note: known blocks are forwarded on the gossip network. // - // We rely upon the lower layers (libp2p) to stop loops occuring from re-gossiped + // We rely upon the lower layers (libp2p) to stop loops occurring from re-gossiped // blocks. BlockProcessingOutcome::BlockIsAlreadyKnown => SHOULD_FORWARD_GOSSIP_BLOCK, _ => SHOULD_NOT_FORWARD_GOSSIP_BLOCK, @@ -837,7 +837,7 @@ impl SimpleSync { // If the parent is in the `import_queue` attempt to complete it then process it. match self.attempt_process_partial_block(peer_id, parent, network, source) { - // If processing parent is sucessful, re-process block and remove parent from queue + // If processing parent is successful, re-process block and remove parent from queue Some(BlockProcessingOutcome::Processed { block_root: _ }) => { self.import_queue.remove(parent); diff --git a/beacon_node/rpc/src/attestation.rs b/beacon_node/rpc/src/attestation.rs index b85d4e947..cedd184e3 100644 --- a/beacon_node/rpc/src/attestation.rs +++ b/beacon_node/rpc/src/attestation.rs @@ -43,7 +43,7 @@ impl AttestationService for AttestationServiceInstance { let state = &self.chain.current_state(); // Start by performing some checks - // Check that the AttestionData is for the current slot (otherwise it will not be valid) + // Check that the AttestationData is for the current slot (otherwise it will not be valid) if slot_requested > state.slot.as_u64() { let log_clone = self.log.clone(); let f = sink diff --git a/beacon_node/src/run.rs b/beacon_node/src/run.rs index 51fa16154..fc46a3f44 100644 --- a/beacon_node/src/run.rs +++ b/beacon_node/src/run.rs @@ -116,7 +116,7 @@ where ctrlc_send.send(()).expect("Error sending ctrl-c message"); } }) - .map_err(|e| format!("Could not set ctrlc hander: {:?}", e))?; + .map_err(|e| format!("Could not set ctrlc handler: {:?}", e))?; let (exit_signal, exit) = exit_future::signal(); diff --git a/beacon_node/store/src/block_at_slot.rs b/beacon_node/store/src/block_at_slot.rs index 5a0dd6861..12f1cccfe 100644 --- a/beacon_node/store/src/block_at_slot.rs +++ b/beacon_node/store/src/block_at_slot.rs @@ -20,18 +20,18 @@ fn read_previous_block_root_from_block_bytes(bytes: &[u8]) -> Result( +pub fn get_block_at_preceding_slot( store: &T, slot: Slot, start_root: Hash256, ) -> Result, Error> { - Ok(match get_at_preceeding_slot(store, slot, start_root)? { + Ok(match get_at_preceding_slot(store, slot, start_root)? { Some((hash, bytes)) => Some((hash, BeaconBlock::from_ssz_bytes(&bytes)?)), None => None, }) } -fn get_at_preceeding_slot( +fn get_at_preceding_slot( store: &T, slot: Slot, mut root: Hash256, @@ -141,7 +141,7 @@ mod tests { let (target_root, target_block) = &blocks_and_roots[target]; let (found_root, found_block) = store - .get_block_at_preceeding_slot(*source_root, target_block.slot) + .get_block_at_preceding_slot(*source_root, target_block.slot) .unwrap() .unwrap(); @@ -166,7 +166,7 @@ mod tests { let (target_root, target_block) = &blocks_and_roots[target]; let (found_root, found_block) = store - .get_block_at_preceeding_slot(*source_root, target_block.slot) + .get_block_at_preceding_slot(*source_root, target_block.slot) .unwrap() .unwrap(); @@ -177,14 +177,14 @@ mod tests { // Slot that doesn't exist let (source_root, _source_block) = &blocks_and_roots[3]; assert!(store - .get_block_at_preceeding_slot(*source_root, Slot::new(3)) + .get_block_at_preceding_slot(*source_root, Slot::new(3)) .unwrap() .is_none()); // Slot too high let (source_root, _source_block) = &blocks_and_roots[3]; assert!(store - .get_block_at_preceeding_slot(*source_root, Slot::new(3)) + .get_block_at_preceding_slot(*source_root, Slot::new(3)) .unwrap() .is_none()); } diff --git a/beacon_node/store/src/disk_db.rs b/beacon_node/store/src/disk_db.rs index 669547ab9..873c9df82 100644 --- a/beacon_node/store/src/disk_db.rs +++ b/beacon_node/store/src/disk_db.rs @@ -106,7 +106,7 @@ impl ClientDB for DiskStore { fn exists(&self, col: &str, key: &[u8]) -> Result { /* * I'm not sure if this is the correct way to read if some - * block exists. Naively I would expect this to unncessarily + * block exists. Naively I would expect this to unnecessarily * copy some data, but I could be wrong. */ match self.db.cf_handle(col) { @@ -164,7 +164,7 @@ mod tests { let thread_count = 10; let write_count = 10; - // We're execting the product of these numbers to fit in one byte. + // We're expecting the product of these numbers to fit in one byte. assert!(thread_count * write_count <= 255); let mut handles = vec![]; diff --git a/beacon_node/store/src/lib.rs b/beacon_node/store/src/lib.rs index 24f622fdc..f4e335ab7 100644 --- a/beacon_node/store/src/lib.rs +++ b/beacon_node/store/src/lib.rs @@ -52,12 +52,12 @@ pub trait Store: Sync + Send + Sized { /// /// Returns `None` if no parent block exists at that slot, or if `slot` is greater than the /// slot of `start_block_root`. - fn get_block_at_preceeding_slot( + fn get_block_at_preceding_slot( &self, start_block_root: Hash256, slot: Slot, ) -> Result, Error> { - block_at_slot::get_block_at_preceeding_slot(self, slot, start_block_root) + block_at_slot::get_block_at_preceding_slot(self, slot, start_block_root) } /// Retrieve some bytes in `column` with `key`. diff --git a/beacon_node/store/src/store.rs b/beacon_node/store/src/store.rs index 5d18c7ba5..84447b83c 100644 --- a/beacon_node/store/src/store.rs +++ b/beacon_node/store/src/store.rs @@ -19,7 +19,7 @@ pub trait Store: Sync + Send + Sized { I::db_delete(self, key) } - fn get_block_at_preceeding_slot( + fn get_block_at_preceding_slot( &self, start_block_root: Hash256, slot: Slot, diff --git a/docs/onboarding.md b/docs/onboarding.md index 275f95484..1937271a0 100644 --- a/docs/onboarding.md +++ b/docs/onboarding.md @@ -115,7 +115,7 @@ other programming languages you may have used. * **Trait**: A trait is a collection of methods defined for a type, they can be implemented for any data type. * **Struct**: A custom data type that lets us name and package together -multiple related values that make a meaninguful group. +multiple related values that make a meaningful group. * **Crate**: A crate is synonymous with a *library* or *package* in other languages. They can produce an executable or library depending on the project. diff --git a/eth2/lmd_ghost/src/reduced_tree.rs b/eth2/lmd_ghost/src/reduced_tree.rs index dace2bda6..7baf45b38 100644 --- a/eth2/lmd_ghost/src/reduced_tree.rs +++ b/eth2/lmd_ghost/src/reduced_tree.rs @@ -1,6 +1,6 @@ //! An implementation of "reduced tree" LMD GHOST fork choice. //! -//! This algorithm was concieved at IC3 Cornell, 2019. +//! This algorithm was conceived at IC3 Cornell, 2019. //! //! This implementation is incomplete and has known bugs. Do not use in production. use super::{LmdGhost, Result as SuperResult}; @@ -147,7 +147,7 @@ where Ok(()) } - /// Removes `current_hash` and all decendants, except `subtree_hash` and all nodes + /// Removes `current_hash` and all descendants, except `subtree_hash` and all nodes /// which have `subtree_hash` as an ancestor. /// /// In effect, prunes the tree so that only decendants of `subtree_hash` exist. diff --git a/eth2/operation_pool/src/lib.rs b/eth2/operation_pool/src/lib.rs index 6c6f1e752..a39fcce33 100644 --- a/eth2/operation_pool/src/lib.rs +++ b/eth2/operation_pool/src/lib.rs @@ -34,7 +34,7 @@ pub struct OperationPool { /// Map from deposit index to deposit data. // NOTE: We assume that there is only one deposit per index // because the Eth1 data is updated (at most) once per epoch, - // and the spec doesn't seem to accomodate for re-orgs on a time-frame + // and the spec doesn't seem to accommodate for re-orgs on a time-frame // longer than an epoch deposits: RwLock>, /// Map from two attestation IDs to a slashing for those IDs. diff --git a/eth2/state_processing/benches/bench_epoch_processing.rs b/eth2/state_processing/benches/bench_epoch_processing.rs index e89305ce4..977464513 100644 --- a/eth2/state_processing/benches/bench_epoch_processing.rs +++ b/eth2/state_processing/benches/bench_epoch_processing.rs @@ -48,7 +48,7 @@ pub fn bench_epoch_processing_n_validators(c: &mut Criterion, validator_count: u "The state should have an attestation for each committee." ); - // Assert that we will run the first arm of process_rewards_and_penalities + // Assert that we will run the first arm of process_rewards_and_penalties let epochs_since_finality = state.next_epoch(&spec) - state.finalized_epoch; assert_eq!( epochs_since_finality, 4, diff --git a/eth2/state_processing/src/per_block_processing/errors.rs b/eth2/state_processing/src/per_block_processing/errors.rs index 41e6410be..8c8c365cc 100644 --- a/eth2/state_processing/src/per_block_processing/errors.rs +++ b/eth2/state_processing/src/per_block_processing/errors.rs @@ -247,7 +247,7 @@ pub enum IndexedAttestationInvalid { MaxIndicesExceed(u64, usize), /// The validator indices were not in increasing order. /// - /// The error occured between the given `index` and `index + 1` + /// The error occurred between the given `index` and `index + 1` BadValidatorIndicesOrdering(usize), /// The validator index is unknown. One cannot slash one who does not exist. UnknownValidator(u64), @@ -413,7 +413,7 @@ pub enum TransferInvalid { /// The `transfer.from` validator has been activated and is not withdrawable. /// /// (from_validator) - FromValidatorIneligableForTransfer(u64), + FromValidatorIneligibleForTransfer(u64), /// The validators withdrawal credentials do not match `transfer.pubkey`. /// /// (state_credentials, transfer_pubkey_credentials) diff --git a/eth2/state_processing/src/per_block_processing/verify_transfer.rs b/eth2/state_processing/src/per_block_processing/verify_transfer.rs index e0b3d22e8..20a16959b 100644 --- a/eth2/state_processing/src/per_block_processing/verify_transfer.rs +++ b/eth2/state_processing/src/per_block_processing/verify_transfer.rs @@ -114,7 +114,7 @@ fn verify_transfer_parametric( || sender_validator.activation_eligibility_epoch == spec.far_future_epoch || sender_validator.is_withdrawable_at(epoch) || total_amount + spec.max_effective_balance <= sender_balance, - Invalid::FromValidatorIneligableForTransfer(transfer.sender) + Invalid::FromValidatorIneligibleForTransfer(transfer.sender) ); // Ensure the withdrawal credentials generated from the sender's pubkey match those stored in diff --git a/eth2/state_processing/src/per_epoch_processing.rs b/eth2/state_processing/src/per_epoch_processing.rs index be4213408..c1d601b47 100644 --- a/eth2/state_processing/src/per_epoch_processing.rs +++ b/eth2/state_processing/src/per_epoch_processing.rs @@ -47,7 +47,7 @@ pub fn per_epoch_processing( // Crosslinks. let winning_root_for_shards = process_crosslinks(state, spec)?; - // Rewards and Penalities. + // Rewards and Penalties. process_rewards_and_penalties( state, &mut validator_statuses, diff --git a/eth2/state_processing/src/per_epoch_processing/process_slashings.rs b/eth2/state_processing/src/per_epoch_processing/process_slashings.rs index d17dd1622..df743c553 100644 --- a/eth2/state_processing/src/per_epoch_processing/process_slashings.rs +++ b/eth2/state_processing/src/per_epoch_processing/process_slashings.rs @@ -12,7 +12,7 @@ pub fn process_slashings( let total_at_start = state.get_slashed_balance(current_epoch + 1)?; let total_at_end = state.get_slashed_balance(current_epoch)?; - let total_penalities = total_at_end - total_at_start; + let total_penalties = total_at_end - total_at_start; for (index, validator) in state.validator_registry.iter().enumerate() { let should_penalize = current_epoch.as_usize() + T::LatestSlashedExitLength::to_usize() / 2 @@ -22,7 +22,7 @@ pub fn process_slashings( let effective_balance = state.get_effective_balance(index, spec)?; let penalty = std::cmp::max( - effective_balance * std::cmp::min(total_penalities * 3, current_total_balance) + effective_balance * std::cmp::min(total_penalties * 3, current_total_balance) / current_total_balance, effective_balance / spec.min_slashing_penalty_quotient, ); diff --git a/eth2/state_processing/src/per_epoch_processing/registry_updates.rs b/eth2/state_processing/src/per_epoch_processing/registry_updates.rs index f97841d72..b18111faf 100644 --- a/eth2/state_processing/src/per_epoch_processing/registry_updates.rs +++ b/eth2/state_processing/src/per_epoch_processing/registry_updates.rs @@ -3,7 +3,7 @@ use super::Error; use itertools::{Either, Itertools}; use types::*; -/// Peforms a validator registry update, if required. +/// Performs a validator registry update, if required. /// /// Spec v0.6.3 pub fn process_registry_updates( diff --git a/eth2/state_processing/src/per_epoch_processing/validator_statuses.rs b/eth2/state_processing/src/per_epoch_processing/validator_statuses.rs index e20aa6cf2..9f05b8204 100644 --- a/eth2/state_processing/src/per_epoch_processing/validator_statuses.rs +++ b/eth2/state_processing/src/per_epoch_processing/validator_statuses.rs @@ -150,7 +150,7 @@ pub struct TotalBalances { /// some `BeaconState`. #[derive(Clone)] pub struct ValidatorStatuses { - /// Information about each individual validator from the state's validator registy. + /// Information about each individual validator from the state's validator registry. pub statuses: Vec, /// Summed balances for various sets of validators. pub total_balances: TotalBalances, diff --git a/eth2/types/src/slot_epoch.rs b/eth2/types/src/slot_epoch.rs index 9a7808da4..bd611aa0c 100644 --- a/eth2/types/src/slot_epoch.rs +++ b/eth2/types/src/slot_epoch.rs @@ -1,4 +1,4 @@ -//! The `Slot` and `Epoch` types are defined as newtypes over u64 to enforce type-safety between +//! The `Slot` and `Epoch` types are defined as new types over u64 to enforce type-safety between //! the two types. //! //! `Slot` and `Epoch` have implementations which permit conversion, comparison and math operations diff --git a/eth2/types/src/test_utils/builders/testing_deposit_builder.rs b/eth2/types/src/test_utils/builders/testing_deposit_builder.rs index dcb6a56ef..aec7ae48f 100644 --- a/eth2/types/src/test_utils/builders/testing_deposit_builder.rs +++ b/eth2/types/src/test_utils/builders/testing_deposit_builder.rs @@ -34,7 +34,7 @@ impl TestingDepositBuilder { /// /// - `pubkey` to the signing pubkey. /// - `withdrawal_credentials` to the signing pubkey. - /// - `proof_of_possesssion` + /// - `proof_of_possession` pub fn sign(&mut self, keypair: &Keypair, epoch: Epoch, fork: &Fork, spec: &ChainSpec) { let withdrawal_credentials = Hash256::from_slice( &get_withdrawal_credentials(&keypair.pk, spec.bls_withdrawal_prefix_byte)[..], diff --git a/eth2/types/src/test_utils/test_random/secret_key.rs b/eth2/types/src/test_utils/test_random/secret_key.rs index a833a4488..7953b7c53 100644 --- a/eth2/types/src/test_utils/test_random/secret_key.rs +++ b/eth2/types/src/test_utils/test_random/secret_key.rs @@ -6,7 +6,7 @@ impl TestRandom for SecretKey { let mut key_bytes = vec![0; 48]; rng.fill_bytes(&mut key_bytes); /* - * An `unreachable!` is used here as there's no reason why you cannot constuct a key from a + * An `unreachable!` is used here as there's no reason why you cannot construct a key from a * fixed-length byte slice. Also, this should only be used during testing so a panic is * acceptable. */ diff --git a/eth2/utils/bls/src/aggregate_signature.rs b/eth2/utils/bls/src/aggregate_signature.rs index f434feb0d..60f9ee993 100644 --- a/eth2/utils/bls/src/aggregate_signature.rs +++ b/eth2/utils/bls/src/aggregate_signature.rs @@ -23,7 +23,7 @@ impl AggregateSignature { /// Instantiate a new AggregateSignature. /// /// is_empty is false - /// AggregateSiganture is point at infinity + /// AggregateSignature is point at infinity pub fn new() -> Self { Self { aggregate_signature: RawAggregateSignature::new(), @@ -87,7 +87,7 @@ impl AggregateSignature { .verify_multiple(&msg[..], domain, &aggregate_public_keys[..]) } - /// Return AggregateSiganture as bytes + /// Return AggregateSignature as bytes pub fn as_bytes(&self) -> Vec { if self.is_empty { return vec![0; BLS_AGG_SIG_BYTE_SIZE]; @@ -95,7 +95,7 @@ impl AggregateSignature { self.aggregate_signature.as_bytes() } - /// Convert bytes to AggregateSiganture + /// Convert bytes to AggregateSignature pub fn from_bytes(bytes: &[u8]) -> Result { for byte in bytes { if *byte != 0 { @@ -114,7 +114,7 @@ impl AggregateSignature { Ok(Self::empty_signature()) } - /// Returns if the AggregateSiganture `is_empty` + /// Returns if the AggregateSignature `is_empty` pub fn is_empty(&self) -> bool { self.is_empty } diff --git a/eth2/utils/cached_tree_hash/src/btree_overlay.rs b/eth2/utils/cached_tree_hash/src/btree_overlay.rs index 5692a4391..7ab22bcef 100644 --- a/eth2/utils/cached_tree_hash/src/btree_overlay.rs +++ b/eth2/utils/cached_tree_hash/src/btree_overlay.rs @@ -64,7 +64,7 @@ pub struct BTreeOverlay { } impl BTreeOverlay { - /// Instantiates a new instance for `item`, where it's first chunk is `inital_offset` and has + /// Instantiates a new instance for `item`, where it's first chunk is `initial_offset` and has /// the specified `depth`. pub fn new(item: &T, initial_offset: usize, depth: usize) -> Self where diff --git a/eth2/utils/cached_tree_hash/src/impls/vec.rs b/eth2/utils/cached_tree_hash/src/impls/vec.rs index bdb7eb134..0196e6a71 100644 --- a/eth2/utils/cached_tree_hash/src/impls/vec.rs +++ b/eth2/utils/cached_tree_hash/src/impls/vec.rs @@ -201,7 +201,7 @@ pub fn update_tree_hash_cache( cache.chunk_index = new.end; } - // The list has been lengthened and this is a new item that was prevously a + // The list has been lengthened and this is a new item that was previously a // padding item. // // Splice the tree for the new item over the padding chunk. @@ -268,7 +268,7 @@ pub fn update_tree_hash_cache( // This leaf was padding in both lists, there's nothing to do. (LeafNode::Padding, LeafNode::Padding) => (), // As we are looping through the larger of the lists of leaf nodes, it should - // be impossible for either leaf to be non-existant. + // be impossible for either leaf to be non-existent. (LeafNode::DoesNotExist, LeafNode::DoesNotExist) => unreachable!(), } } diff --git a/eth2/utils/cached_tree_hash/src/tree_hash_cache.rs b/eth2/utils/cached_tree_hash/src/tree_hash_cache.rs index 8f7b9de86..30b63b70d 100644 --- a/eth2/utils/cached_tree_hash/src/tree_hash_cache.rs +++ b/eth2/utils/cached_tree_hash/src/tree_hash_cache.rs @@ -139,7 +139,7 @@ impl TreeHashCache { } /// Instantiate a new cache from the pre-built `bytes` where each `self.chunk_modified` will be - /// set to `intitial_modified_state`. + /// set to `initial_modified_state`. /// /// Note: `bytes.len()` must be a multiple of 32 pub fn from_bytes( diff --git a/eth2/utils/honey-badger-split/src/lib.rs b/eth2/utils/honey-badger-split/src/lib.rs index ca02b5c01..6b5b325c9 100644 --- a/eth2/utils/honey-badger-split/src/lib.rs +++ b/eth2/utils/honey-badger-split/src/lib.rs @@ -29,7 +29,7 @@ impl<'a, T> Iterator for Split<'a, T> { } } -/// Splits a slice into chunks of size n. All postive n values are applicable, +/// Splits a slice into chunks of size n. All positive n values are applicable, /// hence the honey_badger prefix. /// /// Returns an iterator over the original list. diff --git a/eth2/utils/ssz/README.md b/eth2/utils/ssz/README.md index 0a9bbff25..7db85b10b 100644 --- a/eth2/utils/ssz/README.md +++ b/eth2/utils/ssz/README.md @@ -213,7 +213,7 @@ return rawbytes[current_index+4:current_index+4+bytes_length], new_index #### List -Deserailize each object in the list. +Deserialize each object in the list. 1. Get the length of the serialized list. 2. Loop through deseralizing each item in the list until you reach the entire length of the list. @@ -437,7 +437,7 @@ let decoded: Result<(Vec, usize), DecodeError> = decode_ssz_list( &encode Deserializes the "length" value in the serialized bytes from the index. The length of bytes is given (usually 4 stated in the reference implementation) and -is often the value appended to the list infront of the actual serialized +is often the value appended to the list in front of the actual serialized object. | Parameter | Description | diff --git a/eth2/utils/ssz/src/decode/impls.rs b/eth2/utils/ssz/src/decode/impls.rs index 6f7986945..1a12e7e19 100644 --- a/eth2/utils/ssz/src/decode/impls.rs +++ b/eth2/utils/ssz/src/decode/impls.rs @@ -535,7 +535,7 @@ mod tests { } #[test] - fn awkward_fixed_lenth_portion() { + fn awkward_fixed_length_portion() { assert_eq!( >>::from_ssz_bytes(&[10, 0, 0, 0, 10, 0, 0, 0, 0, 0]), Err(DecodeError::InvalidByteLength { diff --git a/eth2/utils/tree_hash/src/merkleize_standard.rs b/eth2/utils/tree_hash/src/merkleize_standard.rs index c47d342dd..88ea6d00e 100644 --- a/eth2/utils/tree_hash/src/merkleize_standard.rs +++ b/eth2/utils/tree_hash/src/merkleize_standard.rs @@ -47,7 +47,7 @@ pub fn merkleize_standard(bytes: &[u8]) -> Vec { j -= HASHSIZE; let hash = match o.get(i..i + MERKLE_HASH_CHUNK) { - // All bytes are available, hash as ususal. + // All bytes are available, hash as usual. Some(slice) => hash(slice), // Unable to get all the bytes. None => { diff --git a/eth2/utils/tree_hash_derive/src/lib.rs b/eth2/utils/tree_hash_derive/src/lib.rs index f815dd529..5a7b304b5 100644 --- a/eth2/utils/tree_hash_derive/src/lib.rs +++ b/eth2/utils/tree_hash_derive/src/lib.rs @@ -27,7 +27,7 @@ fn get_hashable_named_field_idents<'a>(struct_data: &'a syn::DataStruct) -> Vec< .collect() } -/// Returns true if some field has an attribute declaring it should not be hashedd. +/// Returns true if some field has an attribute declaring it should not be hashed. /// /// The field attribute is: `#[tree_hash(skip_hashing)]` fn should_skip_hashing(field: &syn::Field) -> bool { diff --git a/eth2/validator_change/src/lib.rs b/eth2/validator_change/src/lib.rs index 7c13b168a..3b119519c 100644 --- a/eth2/validator_change/src/lib.rs +++ b/eth2/validator_change/src/lib.rs @@ -59,7 +59,7 @@ pub fn update_validator_set( for (i, v) in validators.iter_mut().enumerate() { match v.status { /* - * Validator is pending activiation. + * Validator is pending activation. */ ValidatorStatus::PendingActivation => { let new_total_changed = total_changed diff --git a/protos/src/services.proto b/protos/src/services.proto index ecc75ee26..bf23ff391 100644 --- a/protos/src/services.proto +++ b/protos/src/services.proto @@ -6,7 +6,7 @@ // the block will be lost. // // This "stateful" method is being used presently because it's easier and -// requires less maintainence as the `BeaconBlock` definition changes. +// requires less maintenance as the `BeaconBlock` definition changes. syntax = "proto3"; @@ -28,7 +28,7 @@ service BeaconBlockService { /// Service that provides the validator client with requisite knowledge about //its public keys service ValidatorService { - // Gets the block proposer slot and comittee slot that a validator needs to + // Gets the block proposer slot and committee slot that a validator needs to // perform work on. rpc GetValidatorDuties(GetDutiesRequest) returns (GetDutiesResponse); } @@ -79,7 +79,7 @@ message PublishBeaconBlockRequest { BeaconBlock block = 1; } -// Beacon node indicates a sucessfully submitted proposal. +// Beacon node indicates a successfully submitted proposal. message PublishBeaconBlockResponse { bool success = 1; bytes msg = 2; diff --git a/tests/ef_tests/tests/tests.rs b/tests/ef_tests/tests/tests.rs index 06e8f223d..f6e14c927 100644 --- a/tests/ef_tests/tests/tests.rs +++ b/tests/ef_tests/tests/tests.rs @@ -12,7 +12,7 @@ fn yaml_files_in_test_dir(dir: &Path) -> Vec { assert!( base_path.exists(), format!( - "Unable to locate {:?}. Did you init git submoules?", + "Unable to locate {:?}. Did you init git submodules?", base_path ) ); diff --git a/validator_client/src/attestation_producer/mod.rs b/validator_client/src/attestation_producer/mod.rs index d59f383ef..900b0de24 100644 --- a/validator_client/src/attestation_producer/mod.rs +++ b/validator_client/src/attestation_producer/mod.rs @@ -39,7 +39,7 @@ pub struct AttestationProducer<'a, B: BeaconNodeAttestation, S: Signer> { pub beacon_node: Arc, /// The signer to sign the block. pub signer: &'a S, - /// Used for caclulating epoch. + /// Used for calculating epoch. pub slots_per_epoch: u64, } diff --git a/validator_client/src/block_producer/mod.rs b/validator_client/src/block_producer/mod.rs index 212db1f8e..48173b835 100644 --- a/validator_client/src/block_producer/mod.rs +++ b/validator_client/src/block_producer/mod.rs @@ -48,7 +48,7 @@ pub struct BlockProducer<'a, B: BeaconNodeBlock, S: Signer> { pub beacon_node: Arc, /// The signer to sign the block. pub signer: &'a S, - /// Used for caclulating epoch. + /// Used for calculating epoch. pub slots_per_epoch: u64, }