mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
Fix spelling mistakes across the whole repository (#3808)
**Update:** Pushed additional changes based on the review comments. **This pull request fixes various spelling mistakes in this repository.** Most of the changes are contained in the first **3** commits: - `Fix spelling mistakes in comments and docs` - `Fix spelling mistakes in test names` - `Fix spelling mistakes in error messages, panic messages, logs and tracing` Other source code spelling mistakes are separated into individual commits for easier reviewing: - `Fix the spelling of 'authority'` - `Fix the spelling of 'REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY'` - `Fix the spelling of 'prev_enqueud_messages'` - `Fix the spelling of 'endpoint'` - `Fix the spelling of 'children'` - `Fix the spelling of 'PenpalSiblingSovereignAccount'` - `Fix the spelling of 'PenpalSudoAccount'` - `Fix the spelling of 'insufficient'` - `Fix the spelling of 'PalletXcmExtrinsicsBenchmark'` - `Fix the spelling of 'subtracted'` - `Fix the spelling of 'CandidatePendingAvailability'` - `Fix the spelling of 'exclusive'` - `Fix the spelling of 'until'` - `Fix the spelling of 'discriminator'` - `Fix the spelling of 'nonexistent'` - `Fix the spelling of 'subsystem'` - `Fix the spelling of 'indices'` - `Fix the spelling of 'committed'` - `Fix the spelling of 'topology'` - `Fix the spelling of 'response'` - `Fix the spelling of 'beneficiary'` - `Fix the spelling of 'formatted'` - `Fix the spelling of 'UNKNOWN_PROOF_REQUEST'` - `Fix the spelling of 'succeeded'` - `Fix the spelling of 'reopened'` - `Fix the spelling of 'proposer'` - `Fix the spelling of 'InstantiationNonce'` - `Fix the spelling of 'depositor'` - `Fix the spelling of 'expiration'` - `Fix the spelling of 'phantom'` - `Fix the spelling of 'AggregatedKeyValue'` - `Fix the spelling of 'randomness'` - `Fix the spelling of 'defendant'` - `Fix the spelling of 'AquaticMammal'` - `Fix the spelling of 'transactions'` - `Fix the spelling of 'PassingTracingSubscriber'` - `Fix the spelling of 'TxSignaturePayload'` - `Fix the spelling of 'versioning'` - `Fix the spelling of 'descendant'` - `Fix the spelling of 'overridden'` - `Fix the spelling of 'network'` Let me know if this structure is adequate. **Note:** The usage of the words `Merkle`, `Merkelize`, `Merklization`, `Merkelization`, `Merkleization`, is somewhat inconsistent but I left it as it is. ~~**Note:** In some places the term `Receival` is used to refer to message reception, IMO `Reception` is the correct word here, but I left it as it is.~~ ~~**Note:** In some places the term `Overlayed` is used instead of the more acceptable version `Overlaid` but I also left it as it is.~~ ~~**Note:** In some places the term `Applyable` is used instead of the correct version `Applicable` but I also left it as it is.~~ **Note:** Some usage of British vs American english e.g. `judgement` vs `judgment`, `initialise` vs `initialize`, `optimise` vs `optimize` etc. are both present in different places, but I suppose that's understandable given the number of contributors. ~~**Note:** There is a spelling mistake in `.github/CODEOWNERS` but it triggers errors in CI when I make changes to it, so I left it as it is.~~
This commit is contained in:
@@ -82,7 +82,7 @@ pub enum CompatibilityMode<N> {
|
||||
None,
|
||||
/// Call `initialize_block` before doing any runtime calls.
|
||||
///
|
||||
/// Previously the node would execute `initialize_block` before fetchting the authorities
|
||||
/// Previously the node would execute `initialize_block` before fetching the authorities
|
||||
/// from the runtime. This behaviour changed in: <https://github.com/paritytech/substrate/pull/9132>
|
||||
///
|
||||
/// By calling `initialize_block` before fetching the authorities, on a block that
|
||||
|
||||
@@ -59,7 +59,7 @@ pub(super) fn calculate_primary_threshold(
|
||||
assert!(theta > 0.0, "authority with weight 0.");
|
||||
|
||||
// NOTE: in the equation `p = 1 - (1 - c)^theta` the value of `p` is always
|
||||
// capped by `c`. For all pratical purposes `c` should always be set to a
|
||||
// capped by `c`. For all practical purposes `c` should always be set to a
|
||||
// value < 0.5, as such in the computations below we should never be near
|
||||
// edge cases like `0.999999`.
|
||||
|
||||
|
||||
@@ -1418,7 +1418,7 @@ where
|
||||
|
||||
// Skip babe logic if block already in chain or importing blocks during initial sync,
|
||||
// otherwise the check for epoch changes will error because trying to re-import an
|
||||
// epoch change or because of missing epoch data in the tree, respectivelly.
|
||||
// epoch change or because of missing epoch data in the tree, respectively.
|
||||
if info.block_gap.map_or(false, |(s, e)| s <= number && number <= e) ||
|
||||
block_status == BlockStatus::InChain
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@ impl EpochT for EpochV0 {
|
||||
|
||||
// Implement From<EpochV0> for Epoch
|
||||
impl EpochV0 {
|
||||
/// Migrate the sturct to current epoch version.
|
||||
/// Migrate the struct to current epoch version.
|
||||
pub fn migrate(self, config: &BabeConfiguration) -> Epoch {
|
||||
sp_consensus_babe::Epoch {
|
||||
epoch_index: self.epoch_index,
|
||||
|
||||
@@ -297,7 +297,7 @@ periodically on the global topic. Let's now dive into description of the message
|
||||
- Justification is considered worthwhile to gossip when:
|
||||
- It is for a recent (implementation specific) round or the latest mandatory round.
|
||||
- All signatures are valid and there is at least `2/3rd + 1` of them.
|
||||
- Signatorees are part of the current validator set.
|
||||
- Signatories are part of the current validator set.
|
||||
- Mandatory justifications should be announced periodically.
|
||||
|
||||
## Misbehavior
|
||||
|
||||
@@ -99,7 +99,7 @@ mod cost {
|
||||
// On-demand request was refused by peer.
|
||||
pub(super) const REFUSAL_RESPONSE: Rep = Rep::new(-100, "BEEFY: Proof request refused");
|
||||
// On-demand request for a proof that can't be found in the backend.
|
||||
pub(super) const UNKOWN_PROOF_REQUEST: Rep = Rep::new(-150, "BEEFY: Unknown proof request");
|
||||
pub(super) const UNKNOWN_PROOF_REQUEST: Rep = Rep::new(-150, "BEEFY: Unknown proof request");
|
||||
}
|
||||
|
||||
// benefit scalars for reporting peers.
|
||||
|
||||
+1
-1
@@ -170,7 +170,7 @@ where
|
||||
.flatten()
|
||||
.and_then(|hash| self.client.justifications(hash).ok().flatten())
|
||||
.and_then(|justifs| justifs.get(BEEFY_ENGINE_ID).cloned())
|
||||
.ok_or_else(|| reputation_changes.push(cost::UNKOWN_PROOF_REQUEST));
|
||||
.ok_or_else(|| reputation_changes.push(cost::UNKNOWN_PROOF_REQUEST));
|
||||
request
|
||||
.pending_response
|
||||
.send(netconfig::OutgoingResponse {
|
||||
|
||||
@@ -404,7 +404,7 @@ pub mod tests {
|
||||
|
||||
let store: BeefyKeystore<AuthorityId> = Some(store).into();
|
||||
|
||||
let msg = b"are you involved or commited?";
|
||||
let msg = b"are you involved or committed?";
|
||||
|
||||
let sig1 = store.sign(&alice, msg).unwrap();
|
||||
let sig2 = Keyring::<AuthorityId>::Alice.sign(msg);
|
||||
@@ -440,7 +440,7 @@ pub mod tests {
|
||||
|
||||
let alice = Keyring::Alice.public();
|
||||
|
||||
let msg = b"are you involved or commited?";
|
||||
let msg = b"are you involved or committed?";
|
||||
let sig = store.sign(&alice, msg).err().unwrap();
|
||||
let err = Error::Signature(expected_error_message.to_string());
|
||||
|
||||
@@ -463,7 +463,7 @@ pub mod tests {
|
||||
let store: BeefyKeystore<ecdsa_crypto::Public> = None.into();
|
||||
|
||||
let alice = Keyring::Alice.public();
|
||||
let msg = b"are you involved or commited";
|
||||
let msg = b"are you involved or committed";
|
||||
|
||||
let sig = store.sign(&alice, msg).err().unwrap();
|
||||
let err = Error::Keystore("no Keystore".to_string());
|
||||
@@ -487,7 +487,7 @@ pub mod tests {
|
||||
let alice = Keyring::Alice.public();
|
||||
|
||||
// `msg` and `sig` match
|
||||
let msg = b"are you involved or commited?";
|
||||
let msg = b"are you involved or committed?";
|
||||
let sig = store.sign(&alice, msg).unwrap();
|
||||
assert!(BeefyKeystore::verify(&alice, &sig, msg));
|
||||
|
||||
|
||||
@@ -76,13 +76,13 @@ pub(crate) enum RoundAction {
|
||||
pub(crate) struct VoterOracle<B: Block> {
|
||||
/// Queue of known sessions. Keeps track of voting rounds (block numbers) within each session.
|
||||
///
|
||||
/// There are three voter states coresponding to three queue states:
|
||||
/// There are three voter states corresponding to three queue states:
|
||||
/// 1. voter uninitialized: queue empty,
|
||||
/// 2. up-to-date - all mandatory blocks leading up to current GRANDPA finalized: queue has ONE
|
||||
/// element, the 'current session' where `mandatory_done == true`,
|
||||
/// 3. lagging behind GRANDPA: queue has [1, N] elements, where all `mandatory_done == false`.
|
||||
/// In this state, everytime a session gets its mandatory block BEEFY finalized, it's popped
|
||||
/// off the queue, eventually getting to state `2. up-to-date`.
|
||||
/// In this state, every time a session gets its mandatory block BEEFY finalized, it's
|
||||
/// popped off the queue, eventually getting to state `2. up-to-date`.
|
||||
sessions: VecDeque<Rounds<B>>,
|
||||
/// Min delta in block numbers between two blocks, BEEFY should vote on.
|
||||
min_block_delta: u32,
|
||||
|
||||
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
homepage = "https://substrate.io"
|
||||
repository.workspace = true
|
||||
description = "Collection of common consensus specific imlementations for Substrate (client)"
|
||||
description = "Collection of common consensus specific implementations for Substrate (client)"
|
||||
readme = "README.md"
|
||||
|
||||
[lints]
|
||||
|
||||
@@ -133,7 +133,7 @@ pub trait ImportQueue<B: BlockT>: Send {
|
||||
/// Start asynchronous runner for import queue.
|
||||
///
|
||||
/// Takes an object implementing [`Link`] which allows the import queue to
|
||||
/// influece the synchronization process.
|
||||
/// influence the synchronization process.
|
||||
async fn run(self, link: Box<dyn Link<B>>);
|
||||
}
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ impl<B: BlockT> ImportQueue<B> for BasicQueue<B> {
|
||||
/// Start asynchronous runner for import queue.
|
||||
///
|
||||
/// Takes an object implementing [`Link`] which allows the import queue to
|
||||
/// influece the synchronization process.
|
||||
/// influence the synchronization process.
|
||||
async fn run(mut self, mut link: Box<dyn Link<B>>) {
|
||||
loop {
|
||||
if let Err(_) = self.result_port.next_action(&mut *link).await {
|
||||
@@ -198,7 +198,7 @@ impl<B: BlockT> ImportQueue<B> for BasicQueue<B> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Messages destinated to the background worker.
|
||||
/// Messages designated to the background worker.
|
||||
mod worker_messages {
|
||||
use super::*;
|
||||
|
||||
|
||||
@@ -326,7 +326,7 @@ impl<E: Epoch> AsRef<E> for IncrementedEpoch<E> {
|
||||
///
|
||||
/// The first epoch, epoch_0, is special cased by saying that it starts at
|
||||
/// slot number of the first block in the chain. When bootstrapping a chain,
|
||||
/// there can be multiple competing block #1s, so we have to ensure that the overlayed
|
||||
/// there can be multiple competing block #1s, so we have to ensure that the overlaid
|
||||
/// DAG doesn't get confused.
|
||||
///
|
||||
/// The first block of every epoch should be producing a descriptor for the next
|
||||
@@ -655,7 +655,7 @@ where
|
||||
|
||||
/// Revert to a specified block given its `hash` and `number`.
|
||||
/// This removes all the epoch changes information that were announced by
|
||||
/// all the given block descendents.
|
||||
/// all the given block descendants.
|
||||
pub fn revert<D: IsDescendentOfBuilder<Hash>>(
|
||||
&mut self,
|
||||
descendent_of_builder: D,
|
||||
|
||||
@@ -222,13 +222,13 @@ pub(crate) struct NetworkBridge<B: BlockT, N: Network<B>, S: Syncing<B>> {
|
||||
neighbor_sender: periodic::NeighborPacketSender<B>,
|
||||
|
||||
/// `NeighborPacketWorker` processing packets sent through the `NeighborPacketSender`.
|
||||
// `NetworkBridge` is required to be cloneable, thus one needs to be able to clone its
|
||||
// `NetworkBridge` is required to be clonable, thus one needs to be able to clone its
|
||||
// children, thus one has to wrap `neighbor_packet_worker` with an `Arc` `Mutex`.
|
||||
neighbor_packet_worker: Arc<Mutex<periodic::NeighborPacketWorker<B>>>,
|
||||
|
||||
/// Receiver side of the peer report stream populated by the gossip validator, forwarded to the
|
||||
/// gossip engine.
|
||||
// `NetworkBridge` is required to be cloneable, thus one needs to be able to clone its
|
||||
// `NetworkBridge` is required to be clonable, thus one needs to be able to clone its
|
||||
// children, thus one has to wrap gossip_validator_report_stream with an `Arc` `Mutex`. Given
|
||||
// that it is just an `UnboundedReceiver`, one could also switch to a
|
||||
// multi-producer-*multi*-consumer channel implementation.
|
||||
@@ -766,7 +766,7 @@ impl<Block: BlockT> Sink<Message<Block::Header>> for OutgoingMessages<Block> {
|
||||
)
|
||||
.ok_or_else(|| {
|
||||
Error::Signing(format!(
|
||||
"Failed to sign GRANDPA vote for round {} targetting {:?}",
|
||||
"Failed to sign GRANDPA vote for round {} targeting {:?}",
|
||||
self.round, target_hash
|
||||
))
|
||||
})?;
|
||||
|
||||
@@ -106,7 +106,7 @@ impl<B: BlockT> Stream for NeighborPacketWorker<B> {
|
||||
|
||||
// Make sure the underlying task is scheduled for wake-up.
|
||||
//
|
||||
// Note: In case poll_unpin is called after the resetted delay fires again, this
|
||||
// Note: In case poll_unpin is called after the reset delay fires again, this
|
||||
// will drop one tick. Deemed as very unlikely and also not critical.
|
||||
while this.delay.poll_unpin(cx).is_ready() {}
|
||||
|
||||
|
||||
@@ -1805,7 +1805,7 @@ async fn grandpa_environment_checks_if_best_block_is_descendent_of_finality_targ
|
||||
);
|
||||
|
||||
// best block is higher than finality target and it's on the same fork,
|
||||
// the best block passed to the voting rule should not be overriden
|
||||
// the best block passed to the voting rule should not be overridden
|
||||
select_chain.set_best_chain(client.expect_header(hashof10_a).unwrap());
|
||||
select_chain.set_finality_target(client.expect_header(hashof5_a).unwrap().hash());
|
||||
voting_rule.set_expected_best_block(hashof10_a);
|
||||
@@ -1940,7 +1940,7 @@ async fn justification_with_equivocation() {
|
||||
precommits.push(precommit);
|
||||
}
|
||||
|
||||
// we create an equivocation for the 67th validator targetting blocks #1 and #2.
|
||||
// we create an equivocation for the 67th validator targeting blocks #1 and #2.
|
||||
// this should be accounted as "voting for all blocks" and therefore block #3 will
|
||||
// have 67/100 votes, reaching finality threshold.
|
||||
{
|
||||
|
||||
@@ -1002,7 +1002,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_global_message_wait_completed_return_none_on_block_number_missmatch() {
|
||||
fn block_global_message_wait_completed_return_none_on_block_number_mismatch() {
|
||||
let msg_inner = test_catch_up();
|
||||
|
||||
let waiting_block_1 =
|
||||
|
||||
@@ -196,7 +196,7 @@ where
|
||||
target_header = backend
|
||||
.header(target_hash)
|
||||
.ok()?
|
||||
.expect("Header known to exist due to the existence of one of its descendents; qed");
|
||||
.expect("Header known to exist due to the existence of one of its descendants; qed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ impl<Block: BlockT, Backend: ClientBackend<Block>> NetworkProvider<Block, Backen
|
||||
where
|
||||
NumberFor<Block>: BlockNumberOps,
|
||||
{
|
||||
/// Create a new istance for a given backend and authority set.
|
||||
/// Create a new instance for a given backend and authority set.
|
||||
pub fn new(
|
||||
backend: Arc<Backend>,
|
||||
authority_set: SharedAuthoritySet<Block::Hash, NumberFor<Block>>,
|
||||
|
||||
@@ -82,7 +82,7 @@ pub struct BabeVerifier<B: BlockT, C> {
|
||||
}
|
||||
|
||||
impl<B: BlockT, C> BabeVerifier<B, C> {
|
||||
/// create a nrew verifier
|
||||
/// create a new verifier
|
||||
pub fn new(epoch_changes: SharedEpochChanges<B, Epoch>, client: Arc<C>) -> BabeVerifier<B, C> {
|
||||
BabeVerifier { epoch_changes, client }
|
||||
}
|
||||
|
||||
@@ -555,7 +555,7 @@ impl SlotProportion {
|
||||
Self(inner.clamp(0.0, 1.0))
|
||||
}
|
||||
|
||||
/// Returns the inner that is guaranted to be in the range `[0,1]`.
|
||||
/// Returns the inner that is guaranteed to be in the range `[0,1]`.
|
||||
pub fn get(&self) -> f32 {
|
||||
self.0
|
||||
}
|
||||
@@ -648,7 +648,7 @@ pub fn proposing_remaining_duration<Block: BlockT>(
|
||||
}
|
||||
|
||||
/// Calculate a slot duration lenience based on the number of missed slots from current
|
||||
/// to parent. If the number of skipped slots is greated than 0 this method will apply
|
||||
/// to parent. If the number of skipped slots is greater than 0 this method will apply
|
||||
/// an exponential backoff of at most `2^7 * slot_duration`, if no slots were skipped
|
||||
/// this method will return `None.`
|
||||
pub fn slot_lenience_exponential<Block: BlockT>(
|
||||
@@ -680,7 +680,7 @@ pub fn slot_lenience_exponential<Block: BlockT>(
|
||||
}
|
||||
|
||||
/// Calculate a slot duration lenience based on the number of missed slots from current
|
||||
/// to parent. If the number of skipped slots is greated than 0 this method will apply
|
||||
/// to parent. If the number of skipped slots is greater than 0 this method will apply
|
||||
/// a linear backoff of at most `20 * slot_duration`, if no slots were skipped
|
||||
/// this method will return `None.`
|
||||
pub fn slot_lenience_linear<Block: BlockT>(
|
||||
|
||||
Reference in New Issue
Block a user