diff --git a/bridges/bin/millau/node/src/cli.rs b/bridges/bin/millau/node/src/cli.rs index 46323ed25c..49f4fc092f 100644 --- a/bridges/bin/millau/node/src/cli.rs +++ b/bridges/bin/millau/node/src/cli.rs @@ -29,7 +29,7 @@ pub struct Cli { /// Possible subcommands of the main binary. #[derive(Debug, StructOpt)] pub enum Subcommand { - /// Key management cli utilities + /// Key management CLI utilities Key(sc_cli::KeySubcommand), /// Verify a signature for a message, provided on STDIN, with a given (public or secret) key. diff --git a/bridges/bin/millau/runtime/src/lib.rs b/bridges/bin/millau/runtime/src/lib.rs index ff5b39439b..8d9f5edcf1 100644 --- a/bridges/bin/millau/runtime/src/lib.rs +++ b/bridges/bin/millau/runtime/src/lib.rs @@ -238,7 +238,7 @@ parameter_types! { } impl pallet_timestamp::Config for Runtime { - /// A timestamp: milliseconds since the unix epoch. + /// A timestamp: milliseconds since the UNIX epoch. type Moment = u64; type OnTimestampSet = Aura; type MinimumPeriod = MinimumPeriod; diff --git a/bridges/bin/rialto/node/src/cli.rs b/bridges/bin/rialto/node/src/cli.rs index 46323ed25c..49f4fc092f 100644 --- a/bridges/bin/rialto/node/src/cli.rs +++ b/bridges/bin/rialto/node/src/cli.rs @@ -29,7 +29,7 @@ pub struct Cli { /// Possible subcommands of the main binary. #[derive(Debug, StructOpt)] pub enum Subcommand { - /// Key management cli utilities + /// Key management CLI utilities Key(sc_cli::KeySubcommand), /// Verify a signature for a message, provided on STDIN, with a given (public or secret) key. diff --git a/bridges/bin/rialto/runtime/src/exchange.rs b/bridges/bin/rialto/runtime/src/exchange.rs index a054962a79..e259856f37 100644 --- a/bridges/bin/rialto/runtime/src/exchange.rs +++ b/bridges/bin/rialto/runtime/src/exchange.rs @@ -55,7 +55,7 @@ pub struct EthereumTransactionInclusionProof { /// /// The assumption is that this pair will never appear more than once in /// transactions included into finalized blocks. This is obviously true -/// for any existing eth-like chain (that keep current tx format), because +/// for any existing eth-like chain (that keep current TX format), because /// otherwise transaction can be replayed over and over. #[derive(Encode, Decode, PartialEq, RuntimeDebug)] pub struct EthereumTransactionTag { @@ -65,7 +65,7 @@ pub struct EthereumTransactionTag { pub nonce: sp_core::U256, } -/// Eth transaction from runtime perspective. +/// Ethereum transaction from runtime perspective. pub struct EthTransaction; impl MaybeLockFundsTransaction for EthTransaction { diff --git a/bridges/bin/rialto/runtime/src/kovan.rs b/bridges/bin/rialto/runtime/src/kovan.rs index 03b0ca8a07..15c73fc6ea 100644 --- a/bridges/bin/rialto/runtime/src/kovan.rs +++ b/bridges/bin/rialto/runtime/src/kovan.rs @@ -34,7 +34,7 @@ frame_support::parameter_types! { kovan_validators_configuration(); } -/// Max number of finalized headers to keep. It is equivalent of ~24 hours of +/// Max number of finalized headers to keep. It is equivalent of around 24 hours of /// finalized blocks on current Kovan chain. const FINALIZED_HEADERS_TO_KEEP: u64 = 20_000; diff --git a/bridges/bin/rialto/runtime/src/lib.rs b/bridges/bin/rialto/runtime/src/lib.rs index 762ef17102..3a40139d6d 100644 --- a/bridges/bin/rialto/runtime/src/lib.rs +++ b/bridges/bin/rialto/runtime/src/lib.rs @@ -370,7 +370,7 @@ parameter_types! { } impl pallet_timestamp::Config for Runtime { - /// A timestamp: milliseconds since the unix epoch. + /// A timestamp: milliseconds since the UNIX epoch. type Moment = bp_rialto::Moment; type OnTimestampSet = Babe; type MinimumPeriod = MinimumPeriod; diff --git a/bridges/docs/high-level-overview.md b/bridges/docs/high-level-overview.md index 9ca3ca42ff..2fc210ed7a 100644 --- a/bridges/docs/high-level-overview.md +++ b/bridges/docs/high-level-overview.md @@ -74,7 +74,7 @@ Referer to the [pallet documentation](../modules/substrate/src/lib.rs) for more There is currently no reward strategy for the relayers at all. They also are not required to be staked or registered on-chain, unlike in other bridge designs. We consider the header sync to be -an essential part of the bridge and the incentivisation should be happening on the higher layers. +an essential part of the bridge and the incentivization should be happening on the higher layers. At the moment, signed transactions are the only way to submit headers to the header sync pallet. However, in the future we would like to use unsigned transactions for headers delivery. This will @@ -110,7 +110,7 @@ Users of the pallet add their messages to an "outbound lane" on the source chain finalized message relayers are responsible for reading the current queue of messages and submitting some (or all) of them to the "inbound lane" of the target chain. Each message has a `nonce` associated with it, which serves as the ordering of messages. The inbound lane stores the last -delivered nonce to prevent replaying messages. To succesfuly deliver the message to the inbound lane +delivered nonce to prevent replaying messages. To successfully deliver the message to the inbound lane on target chain the relayer has to present present a storage proof which shows that the message was part of the outbound lane on the source chain. diff --git a/bridges/modules/dispatch/src/lib.rs b/bridges/modules/dispatch/src/lib.rs index d3533fcfcb..b27295481a 100644 --- a/bridges/modules/dispatch/src/lib.rs +++ b/bridges/modules/dispatch/src/lib.rs @@ -19,7 +19,7 @@ //! The messages are interpreted directly as runtime `Call`. We attempt to decode //! them and then dispatch as usual. To prevent compatibility issues, the Calls have //! to include a `spec_version`. This will be checked before dispatch. In the case of -//! a succesful dispatch an event is emitted. +//! a successful dispatch an event is emitted. #![cfg_attr(not(feature = "std"), no_std)] #![warn(missing_docs)] diff --git a/bridges/modules/ethereum-contract-builtin/src/lib.rs b/bridges/modules/ethereum-contract-builtin/src/lib.rs index a07f838cf8..75004fd2a9 100644 --- a/bridges/modules/ethereum-contract-builtin/src/lib.rs +++ b/bridges/modules/ethereum-contract-builtin/src/lib.rs @@ -28,9 +28,9 @@ pub enum Error { BlockNumberDecode, /// Failed to decode Substrate header. HeaderDecode(codec::Error), - /// Failed to decode best voters set. + /// Failed to decode the best voters set. BestSetDecode(codec::Error), - /// Best voters set is invalid. + /// The best voters set is invalid. InvalidBestSet, /// Failed to decode finality proof. FinalityProofDecode(codec::Error), diff --git a/bridges/modules/ethereum/src/finality.rs b/bridges/modules/ethereum/src/finality.rs index 58987c6b29..25f1ecdb2c 100644 --- a/bridges/modules/ethereum/src/finality.rs +++ b/bridges/modules/ethereum/src/finality.rs @@ -36,7 +36,7 @@ pub struct CachedFinalityVotes { /// best finalized. pub stopped_at_finalized_sibling: bool, /// Header ancestors that were read while we have been searching for - /// cached votes entry. Newest header has index 0. + /// cached votes entry. The newest header has index 0. pub unaccounted_ancestry: VecDeque<(HeaderId, Option, AuraHeader)>, /// Cached finality votes, if they have been found. The associated /// header is not included into `unaccounted_ancestry`. @@ -59,7 +59,7 @@ pub struct FinalityEffects { pub struct FinalityVotes { /// Number of votes per each validator. pub votes: BTreeMap, - /// Ancestry blocks with oldest ancestors at the beginning and newest at the + /// Ancestry blocks with the oldest ancestors at the beginning and newest at the /// end of the queue. pub ancestry: VecDeque>, } diff --git a/bridges/modules/ethereum/src/import.rs b/bridges/modules/ethereum/src/import.rs index 8cd4c8a17c..89ee39f7b3 100644 --- a/bridges/modules/ethereum/src/import.rs +++ b/bridges/modules/ethereum/src/import.rs @@ -22,7 +22,7 @@ use crate::{AuraConfiguration, ChainTime, ChangeToEnact, PruningStrategy, Storag use bp_eth_poa::{AuraHeader, HeaderId, Receipt}; use sp_std::{collections::btree_map::BTreeMap, prelude::*}; -/// Imports bunch of headers and updates blocks finality. +/// Imports a bunch of headers and updates blocks finality. /// /// Transactions receipts must be provided if `header_import_requires_receipts()` /// has returned true. diff --git a/bridges/modules/ethereum/src/lib.rs b/bridges/modules/ethereum/src/lib.rs index facf377d51..ebb36edbe5 100644 --- a/bridges/modules/ethereum/src/lib.rs +++ b/bridges/modules/ethereum/src/lib.rs @@ -169,8 +169,8 @@ struct PruningRange { /// were unable to prune for whatever reason (i.e. if it isn't finalized yet and has /// scheduled validators set change). pub oldest_unpruned_block: u64, - /// Number of oldest block(s) that we want to keep. We want to prune blocks in range - /// [`oldest_unpruned_block`; `oldest_block_to_keep`). + /// Number of the oldest block(s) that we want to keep. We want to prune blocks in range + /// [ `oldest_unpruned_block`; `oldest_block_to_keep` ). pub oldest_block_to_keep: u64, } @@ -316,10 +316,10 @@ pub trait PruningStrategy: Default { /// Pallet may prune both finalized and unfinalized blocks. But it can't give any /// guarantees on when it will happen. Example: if some unfinalized block at height N /// has scheduled validators set change, then the module won't prune any blocks with - /// number >= N even if strategy allows that. + /// number greater than or equal to N even if strategy allows that. /// /// If your strategy allows pruning unfinalized blocks, this could lead to switch - /// between finalized forks (only if authorities are misbehaving). But since 50%+1 (or 2/3) + /// between finalized forks (only if authorities are misbehaving). But since 50 percent plus one (or 2/3) /// authorities are able to do whatever they want with the chain, this isn't considered /// fatal. If your strategy only prunes finalized blocks, we'll never be able to finalize /// header that isn't descendant of current best finalized block. diff --git a/bridges/modules/ethereum/src/test_utils.rs b/bridges/modules/ethereum/src/test_utils.rs index 41161089ba..853ad0930b 100644 --- a/bridges/modules/ethereum/src/test_utils.rs +++ b/bridges/modules/ethereum/src/test_utils.rs @@ -19,7 +19,7 @@ //! Although the name implies that it is used by tests, it shouldn't be be used _directly_ by tests. //! Instead these utilities should be used by the Mock runtime, which in turn is used by tests. //! -//! On the other hand, they may be used directly by the bechmarking module. +//! On the other hand, they may be used directly by the benchmark module. // Since this is test code it's fine that not everything is used #![allow(dead_code)] diff --git a/bridges/modules/ethereum/src/verification.rs b/bridges/modules/ethereum/src/verification.rs index c8c4deca87..638da68af4 100644 --- a/bridges/modules/ethereum/src/verification.rs +++ b/bridges/modules/ethereum/src/verification.rs @@ -43,7 +43,7 @@ pub fn is_importable_header(storage: &S, header: &AuraHeader) -> Res Ok((id, finalized_id)) } -/// Try accept unsigned aura header into transaction pool. +/// Try to accept unsigned aura header into transaction pool. /// /// Returns required and provided tags. pub fn accept_aura_header_into_pool( diff --git a/bridges/modules/grandpa/src/benchmarking.rs b/bridges/modules/grandpa/src/benchmarking.rs index bc027e86a4..02600201f7 100644 --- a/bridges/modules/grandpa/src/benchmarking.rs +++ b/bridges/modules/grandpa/src/benchmarking.rs @@ -23,7 +23,7 @@ //! 2. The number of `pre-commits` in the justification //! //! Vote ancestries are the headers between (`finality_target`, `head_of_chain`], where -//! `header_of_chain` is a decendant of `finality_target`. +//! `header_of_chain` is a descendant of `finality_target`. //! //! Pre-commits are messages which are signed by validators at the head of the chain they think is //! the best. @@ -34,7 +34,7 @@ //! [A] <- [B] <- [C] //! //! The common ancestor of both forks is block A, so this is what GRANDPA will finalize. In order to -//! verify this we will have vote ancestries of [B, C, B', C'] and pre-commits [C, C']. +//! verify this we will have vote ancestries of `[B, C, B', C']` and pre-commits `[C, C']`. //! //! Note that the worst case scenario here would be a justification where each validator has it's //! own fork which is `SESSION_LENGTH` blocks long. diff --git a/bridges/modules/grandpa/src/lib.rs b/bridges/modules/grandpa/src/lib.rs index 4cca1c7827..6c25968630 100644 --- a/bridges/modules/grandpa/src/lib.rs +++ b/bridges/modules/grandpa/src/lib.rs @@ -28,7 +28,7 @@ //! //! Since this pallet only tracks finalized headers it does not deal with forks. Forks can only //! occur if the GRANDPA validator set on the bridged chain is either colluding or there is a severe -//! bug causing resulting in an equivocation. Such events are outside of the scope of this pallet. +//! bug causing resulting in an equivocation. Such events are outside the scope of this pallet. //! Shall the fork occur on the bridged chain governance intervention will be required to //! re-initialize the bridge and track the right fork. @@ -175,7 +175,7 @@ pub mod pallet { /// Bootstrap the bridge pallet with an initial header and authority set from which to sync. /// /// The initial configuration provided does not need to be the genesis header of the bridged - /// chain, it can be any arbirary header. You can also provide the next scheduled set change + /// chain, it can be any arbitrary header. You can also provide the next scheduled set change /// if it is already know. /// /// This function is only allowed to be called from a trusted origin and writes to storage @@ -355,7 +355,7 @@ pub mod pallet { /// is found it will be enacted immediately. /// /// This function does not support forced changes, or scheduled changes with delays - /// since these types of changes are indicitive of abnormal behaviour from GRANDPA. + /// since these types of changes are indicative of abnormal behavior from GRANDPA. /// /// Returned value will indicate if a change was enacted or not. pub(crate) fn try_enact_authority_change, I: 'static>( @@ -401,7 +401,7 @@ pub mod pallet { /// /// Will use the GRANDPA current authorities known to the pallet. /// - /// If succesful it returns the decoded GRANDPA justification so we can refund any weight which + /// If successful it returns the decoded GRANDPA justification so we can refund any weight which /// was overcharged in the initial call. pub(crate) fn verify_justification, I: 'static>( justification: &GrandpaJustification>, @@ -432,7 +432,7 @@ pub mod pallet { /// Import a previously verified header to the storage. /// /// Note this function solely takes care of updating the storage and pruning old entries, - /// but does not verify the validaty of such import. + /// but does not verify the validity of such import. pub(crate) fn insert_header, I: 'static>(header: BridgedHeader, hash: BridgedBlockHash) { let index = >::get(); let pruning = >::try_get(index); diff --git a/bridges/modules/messages/src/instant_payments.rs b/bridges/modules/messages/src/instant_payments.rs index 524a3765d6..80bc32f294 100644 --- a/bridges/modules/messages/src/instant_payments.rs +++ b/bridges/modules/messages/src/instant_payments.rs @@ -31,14 +31,14 @@ use sp_std::fmt::Debug; /// Instant message payments made in given currency. /// -/// The balance is initally reserved in a special `relayers-fund` account, and transferred +/// The balance is initially reserved in a special `relayers-fund` account, and transferred /// to the relayer when message delivery is confirmed. /// -/// Additionaly, confirmation transaction submitter (`confirmation_relayer`) is reimbursed +/// Additionally, confirmation transaction submitter (`confirmation_relayer`) is reimbursed /// with the confirmation rewards (part of message fee, reserved to pay for delivery confirmation). /// /// NOTE The `relayers-fund` account must always exist i.e. be over Existential Deposit (ED; the -/// pallet enforces that) to make sure that even if the message cost is below ED it is still payed +/// pallet enforces that) to make sure that even if the message cost is below ED it is still paid /// to the relayer account. /// NOTE It's within relayer's interest to keep their balance above ED as well, to make sure they /// can receive the payment. diff --git a/bridges/modules/messages/src/lib.rs b/bridges/modules/messages/src/lib.rs index ed57baaf6e..842c28bd4b 100644 --- a/bridges/modules/messages/src/lib.rs +++ b/bridges/modules/messages/src/lib.rs @@ -86,7 +86,7 @@ mod mock; pub trait Config: frame_system::Config { // General types - /// They overarching event type. + /// They are overarching event type. type Event: From> + Into<::Event>; /// Benchmarks results from runtime we're plugged into. type WeightInfo: WeightInfoExt; @@ -786,22 +786,22 @@ impl, I: Instance> Pallet { OutboundMessages::::get(MessageKey { lane_id: lane, nonce }) } - /// Get nonce of latest generated message at given outbound lane. + /// Get nonce of the latest generated message at given outbound lane. pub fn outbound_latest_generated_nonce(lane: LaneId) -> MessageNonce { OutboundLanes::::get(&lane).latest_generated_nonce } - /// Get nonce of latest confirmed message at given outbound lane. + /// Get nonce of the latest confirmed message at given outbound lane. pub fn outbound_latest_received_nonce(lane: LaneId) -> MessageNonce { OutboundLanes::::get(&lane).latest_received_nonce } - /// Get nonce of latest received message at given inbound lane. + /// Get nonce of the latest received message at given inbound lane. pub fn inbound_latest_received_nonce(lane: LaneId) -> MessageNonce { InboundLanes::::get(&lane).last_delivered_nonce() } - /// Get nonce of latest confirmed message at given inbound lane. + /// Get nonce of the latest confirmed message at given inbound lane. pub fn inbound_latest_confirmed_nonce(lane: LaneId) -> MessageNonce { InboundLanes::::get(&lane).last_confirmed_nonce } diff --git a/bridges/modules/messages/src/mock.rs b/bridges/modules/messages/src/mock.rs index 063bbfaa5a..f2a42ab55e 100644 --- a/bridges/modules/messages/src/mock.rs +++ b/bridges/modules/messages/src/mock.rs @@ -386,7 +386,7 @@ impl OnDeliveryConfirmed for TestOnDeliveryConfirmed1 { } } -/// Seconde on-messages-delivered callback. +/// Second on-messages-delivered callback. #[derive(Debug)] pub struct TestOnDeliveryConfirmed2; diff --git a/bridges/modules/messages/src/outbound_lane.rs b/bridges/modules/messages/src/outbound_lane.rs index 7130bd1bb5..5888fa7fd7 100644 --- a/bridges/modules/messages/src/outbound_lane.rs +++ b/bridges/modules/messages/src/outbound_lane.rs @@ -49,7 +49,7 @@ pub enum ReceivalConfirmationResult { /// New messages have been confirmed by the confirmation transaction. ConfirmedMessages(DeliveredMessages), /// Confirmation transaction brings no new confirmation. This may be a result of relayer - /// error or several relayers runnng. + /// error or several relayers running. NoNewConfirmations, /// Bridged chain is trying to confirm more messages than we have generated. May be a result /// of invalid bridged chain storage. diff --git a/bridges/modules/messages/src/weights_ext.rs b/bridges/modules/messages/src/weights_ext.rs index e1b8c7e885..b17be922f5 100644 --- a/bridges/modules/messages/src/weights_ext.rs +++ b/bridges/modules/messages/src/weights_ext.rs @@ -266,7 +266,7 @@ pub trait WeightInfoExt: WeightInfo { weight_of_two_messages_and_two_tx_overheads.saturating_sub(weight_of_two_messages_and_single_tx_overhead) } - /// Returns weight that needs to be accounted when receiving given number of messages with message + /// Returns weight that needs to be accounted when receiving given a number of messages with message /// delivery transaction (`receive_messages_proof`). fn receive_messages_proof_messages_overhead(messages: MessageNonce) -> Weight { let weight_of_two_messages_and_single_tx_overhead = Self::receive_two_messages_proof(); @@ -293,7 +293,7 @@ pub trait WeightInfoExt: WeightInfo { weight_of_two_messages_and_two_tx_overheads.saturating_sub(weight_of_two_messages_and_single_tx_overhead) } - /// Returns weight that needs to be accounted when receiving confirmations for given number of + /// Returns weight that needs to be accounted when receiving confirmations for given a number of /// messages with delivery confirmation transaction (`receive_messages_delivery_proof`). fn receive_messages_delivery_proof_messages_overhead(messages: MessageNonce) -> Weight { let weight_of_two_messages = Self::receive_delivery_proof_for_two_messages_by_single_relayer(); @@ -303,7 +303,7 @@ pub trait WeightInfoExt: WeightInfo { .saturating_mul(messages as Weight) } - /// Returns weight that needs to be accounted when receiving confirmations for given number of + /// Returns weight that needs to be accounted when receiving confirmations for given a number of /// relayers entries with delivery confirmation transaction (`receive_messages_delivery_proof`). fn receive_messages_delivery_proof_relayers_overhead(relayers: MessageNonce) -> Weight { let weight_of_two_messages_by_two_relayers = Self::receive_delivery_proof_for_two_messages_by_two_relayers(); @@ -314,7 +314,7 @@ pub trait WeightInfoExt: WeightInfo { .saturating_mul(relayers as Weight) } - /// Returns weight that needs to be accounted when storage proof of given size is recieved (either in + /// Returns weight that needs to be accounted when storage proof of given size is received (either in /// `receive_messages_proof` or `receive_messages_delivery_proof`). /// /// **IMPORTANT**: this overhead is already included in the 'base' transaction cost - e.g. proof diff --git a/bridges/primitives/chain-kusama/src/lib.rs b/bridges/primitives/chain-kusama/src/lib.rs index d0e9e3acd5..e5ab47259e 100644 --- a/bridges/primitives/chain-kusama/src/lib.rs +++ b/bridges/primitives/chain-kusama/src/lib.rs @@ -79,7 +79,7 @@ sp_api::decl_runtime_apis! { /// /// Returns `None` if message is too expensive to be sent to Kusama from this chain. /// - /// Please keep in mind that this method returns lowest message fee required for message + /// Please keep in mind that this method returns the lowest message fee required for message /// to be accepted to the lane. It may be good idea to pay a bit over this price to account /// future exchange rate changes and guarantee that relayer would deliver your message /// to the target chain. @@ -110,7 +110,7 @@ sp_api::decl_runtime_apis! { pub trait FromKusamaInboundLaneApi { /// Returns nonce of the latest message, received by given lane. fn latest_received_nonce(lane: LaneId) -> MessageNonce; - /// Nonce of latest message that has been confirmed to the bridged chain. + /// Nonce of the latest message that has been confirmed to the bridged chain. fn latest_confirmed_nonce(lane: LaneId) -> MessageNonce; /// State of the unrewarded relayers set at given lane. fn unrewarded_relayers_state(lane: LaneId) -> UnrewardedRelayersState; diff --git a/bridges/primitives/chain-millau/src/lib.rs b/bridges/primitives/chain-millau/src/lib.rs index 0efc54e96e..d9f4fd51f9 100644 --- a/bridges/primitives/chain-millau/src/lib.rs +++ b/bridges/primitives/chain-millau/src/lib.rs @@ -130,7 +130,7 @@ pub type BlockNumber = u64; /// Hash type used in Millau. pub type Hash = ::Out; -/// The type of an object that can produce hashes on Millau. +/// Type of object that can produce hashes on Millau. pub type Hasher = BlakeTwoAndKeccak256; /// The header type used by Millau. @@ -287,7 +287,7 @@ sp_api::decl_runtime_apis! { /// /// Returns `None` if message is too expensive to be sent to Millau from this chain. /// - /// Please keep in mind that this method returns lowest message fee required for message + /// Please keep in mind that this method returns the lowest message fee required for message /// to be accepted to the lane. It may be good idea to pay a bit over this price to account /// future exchange rate changes and guarantee that relayer would deliver your message /// to the target chain. @@ -318,7 +318,7 @@ sp_api::decl_runtime_apis! { pub trait FromMillauInboundLaneApi { /// Returns nonce of the latest message, received by given lane. fn latest_received_nonce(lane: LaneId) -> MessageNonce; - /// Nonce of latest message that has been confirmed to the bridged chain. + /// Nonce of the latest message that has been confirmed to the bridged chain. fn latest_confirmed_nonce(lane: LaneId) -> MessageNonce; /// State of the unrewarded relayers set at given lane. fn unrewarded_relayers_state(lane: LaneId) -> UnrewardedRelayersState; diff --git a/bridges/primitives/chain-polkadot/src/lib.rs b/bridges/primitives/chain-polkadot/src/lib.rs index 7ab1c7f439..b0ba77c66f 100644 --- a/bridges/primitives/chain-polkadot/src/lib.rs +++ b/bridges/primitives/chain-polkadot/src/lib.rs @@ -79,7 +79,7 @@ sp_api::decl_runtime_apis! { /// /// Returns `None` if message is too expensive to be sent to Polkadot from this chain. /// - /// Please keep in mind that this method returns lowest message fee required for message + /// Please keep in mind that this method returns the lowest message fee required for message /// to be accepted to the lane. It may be good idea to pay a bit over this price to account /// future exchange rate changes and guarantee that relayer would deliver your message /// to the target chain. @@ -110,7 +110,7 @@ sp_api::decl_runtime_apis! { pub trait FromPolkadotInboundLaneApi { /// Returns nonce of the latest message, received by given lane. fn latest_received_nonce(lane: LaneId) -> MessageNonce; - /// Nonce of latest message that has been confirmed to the bridged chain. + /// Nonce of the latest message that has been confirmed to the bridged chain. fn latest_confirmed_nonce(lane: LaneId) -> MessageNonce; /// State of the unrewarded relayers set at given lane. fn unrewarded_relayers_state(lane: LaneId) -> UnrewardedRelayersState; diff --git a/bridges/primitives/chain-rialto/src/lib.rs b/bridges/primitives/chain-rialto/src/lib.rs index 4fe05547b5..10eac7deb8 100644 --- a/bridges/primitives/chain-rialto/src/lib.rs +++ b/bridges/primitives/chain-rialto/src/lib.rs @@ -126,7 +126,7 @@ pub type BlockNumber = u32; /// Hash type used in Rialto. pub type Hash = ::Out; -/// The type of an object that can produce hashes on Rialto. +/// The type of object that can produce hashes on Rialto. pub type Hasher = BlakeTwo256; /// The header type used by Rialto. @@ -256,7 +256,7 @@ sp_api::decl_runtime_apis! { /// /// Returns `None` if message is too expensive to be sent to Rialto from this chain. /// - /// Please keep in mind that this method returns lowest message fee required for message + /// Please keep in mind that this method returns the lowest message fee required for message /// to be accepted to the lane. It may be good idea to pay a bit over this price to account /// future exchange rate changes and guarantee that relayer would deliver your message /// to the target chain. @@ -287,7 +287,7 @@ sp_api::decl_runtime_apis! { pub trait FromRialtoInboundLaneApi { /// Returns nonce of the latest message, received by given lane. fn latest_received_nonce(lane: LaneId) -> MessageNonce; - /// Nonce of latest message that has been confirmed to the bridged chain. + /// Nonce of the latest message that has been confirmed to the bridged chain. fn latest_confirmed_nonce(lane: LaneId) -> MessageNonce; /// State of the unrewarded relayers set at given lane. fn unrewarded_relayers_state(lane: LaneId) -> UnrewardedRelayersState; diff --git a/bridges/primitives/chain-rococo/src/lib.rs b/bridges/primitives/chain-rococo/src/lib.rs index 8df064e891..d76ec8e679 100644 --- a/bridges/primitives/chain-rococo/src/lib.rs +++ b/bridges/primitives/chain-rococo/src/lib.rs @@ -116,7 +116,7 @@ sp_api::decl_runtime_apis! { /// /// Returns `None` if message is too expensive to be sent to Rococo from this chain. /// - /// Please keep in mind that this method returns lowest message fee required for message + /// Please keep in mind that this method returns the lowest message fee required for message /// to be accepted to the lane. It may be good idea to pay a bit over this price to account /// future exchange rate changes and guarantee that relayer would deliver your message /// to the target chain. @@ -147,7 +147,7 @@ sp_api::decl_runtime_apis! { pub trait FromRococoInboundLaneApi { /// Returns nonce of the latest message, received by given lane. fn latest_received_nonce(lane: LaneId) -> MessageNonce; - /// Nonce of latest message that has been confirmed to the bridged chain. + /// Nonce of the latest message that has been confirmed to the bridged chain. fn latest_confirmed_nonce(lane: LaneId) -> MessageNonce; /// State of the unrewarded relayers set at given lane. fn unrewarded_relayers_state(lane: LaneId) -> UnrewardedRelayersState; diff --git a/bridges/primitives/chain-westend/src/lib.rs b/bridges/primitives/chain-westend/src/lib.rs index a0895da259..4f8b9cccf4 100644 --- a/bridges/primitives/chain-westend/src/lib.rs +++ b/bridges/primitives/chain-westend/src/lib.rs @@ -52,7 +52,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { /// All entries here (like pretty much in the entire file) must be kept in sync with Westend /// `construct_runtime`, so that we maintain SCALE-compatibility. /// -/// See: https://github.com/paritytech/polkadot/blob/master/runtime/westend/src/lib.rs +/// See: [link](https://github.com/paritytech/polkadot/blob/master/runtime/westend/src/lib.rs) #[derive(parity_scale_codec::Encode, parity_scale_codec::Decode, Debug, PartialEq, Eq, Clone)] pub enum Call { /// Rococo bridge pallet. @@ -141,7 +141,7 @@ sp_api::decl_runtime_apis! { /// /// Returns `None` if message is too expensive to be sent to Westend from this chain. /// - /// Please keep in mind that this method returns lowest message fee required for message + /// Please keep in mind that this method returns the lowest message fee required for message /// to be accepted to the lane. It may be good idea to pay a bit over this price to account /// future exchange rate changes and guarantee that relayer would deliver your message /// to the target chain. @@ -172,7 +172,7 @@ sp_api::decl_runtime_apis! { pub trait FromWestendInboundLaneApi { /// Returns nonce of the latest message, received by given lane. fn latest_received_nonce(lane: LaneId) -> MessageNonce; - /// Nonce of latest message that has been confirmed to the bridged chain. + /// Nonce of the latest message that has been confirmed to the bridged chain. fn latest_confirmed_nonce(lane: LaneId) -> MessageNonce; /// State of the unrewarded relayers set at given lane. fn unrewarded_relayers_state(lane: LaneId) -> UnrewardedRelayersState; diff --git a/bridges/primitives/chain-wococo/src/lib.rs b/bridges/primitives/chain-wococo/src/lib.rs index 24572e141b..e0d49ffe85 100644 --- a/bridges/primitives/chain-wococo/src/lib.rs +++ b/bridges/primitives/chain-wococo/src/lib.rs @@ -81,7 +81,7 @@ sp_api::decl_runtime_apis! { /// /// Returns `None` if message is too expensive to be sent to Wococo from this chain. /// - /// Please keep in mind that this method returns lowest message fee required for message + /// Please keep in mind that this method returns the lowest message fee required for message /// to be accepted to the lane. It may be good idea to pay a bit over this price to account /// future exchange rate changes and guarantee that relayer would deliver your message /// to the target chain. @@ -112,7 +112,7 @@ sp_api::decl_runtime_apis! { pub trait FromWococoInboundLaneApi { /// Returns nonce of the latest message, received by given lane. fn latest_received_nonce(lane: LaneId) -> MessageNonce; - /// Nonce of latest message that has been confirmed to the bridged chain. + /// Nonce of the latest message that has been confirmed to the bridged chain. fn latest_confirmed_nonce(lane: LaneId) -> MessageNonce; /// State of the unrewarded relayers set at given lane. fn unrewarded_relayers_state(lane: LaneId) -> UnrewardedRelayersState; diff --git a/bridges/primitives/currency-exchange/src/lib.rs b/bridges/primitives/currency-exchange/src/lib.rs index 88695dbb5e..c85a9d4ff7 100644 --- a/bridges/primitives/currency-exchange/src/lib.rs +++ b/bridges/primitives/currency-exchange/src/lib.rs @@ -36,7 +36,7 @@ pub enum Error { InvalidRecipient, /// Cannot map from peer recipient to this blockchain recipient. FailedToMapRecipients, - /// Failed to convert from peer blockchain currency to this blockhain currency. + /// Failed to convert from peer blockchain currency to this blockchain currency. FailedToConvertCurrency, /// Deposit has failed. DepositFailed, diff --git a/bridges/primitives/ethereum-poa/src/lib.rs b/bridges/primitives/ethereum-poa/src/lib.rs index 382e6f81ee..b2e00760c0 100644 --- a/bridges/primitives/ethereum-poa/src/lib.rs +++ b/bridges/primitives/ethereum-poa/src/lib.rs @@ -323,7 +323,7 @@ impl UnsignedTransaction { stream.out().to_vec() } - /// Encode to given rlp stream. + /// Encode to given RLP stream. pub fn rlp_to(&self, chain_id: Option, stream: &mut RlpStream) { stream.append(&self.nonce); stream.append(&self.gas_price); @@ -405,7 +405,7 @@ impl SealedEmptyStep { keccak_256(&message.out()).into() } - /// Returns rlp for the vector of empty steps (we only do encoding in tests). + /// Returns RLP for the vector of empty steps (we only do encoding in tests). pub fn rlp_of(empty_steps: &[SealedEmptyStep]) -> Bytes { let mut s = RlpStream::new(); s.begin_list(empty_steps.len()); diff --git a/bridges/primitives/header-chain/src/justification.rs b/bridges/primitives/header-chain/src/justification.rs index 625d776259..760369fe0d 100644 --- a/bridges/primitives/header-chain/src/justification.rs +++ b/bridges/primitives/header-chain/src/justification.rs @@ -168,7 +168,7 @@ where pub struct AncestryChain { /// Header hash => parent header hash mapping. pub parents: BTreeMap, - /// Hashes of headers that weren't visited by `is_ancestor` method. + /// Hashes of headers that were not visited by `is_ancestor` method. pub unvisited: BTreeSet, } diff --git a/bridges/primitives/message-dispatch/src/lib.rs b/bridges/primitives/message-dispatch/src/lib.rs index 859dc5e469..65f9fc15dc 100644 --- a/bridges/primitives/message-dispatch/src/lib.rs +++ b/bridges/primitives/message-dispatch/src/lib.rs @@ -77,7 +77,7 @@ pub enum CallOrigin { /// Identifiers of relayers and messages that they have delivered to this lane (ordered by message nonce). /// /// This serves as a helper storage item, to allow the source chain to easily pay rewards - /// to the relayers who succesfuly delivered messages to the target chain (inbound lane). + /// to the relayers who successfully delivered messages to the target chain (inbound lane). /// /// It is guaranteed to have at most N entries, where N is configured at the module level. /// If there are N entries in this vec, then: @@ -149,7 +149,7 @@ impl Default for InboundLaneData { } impl InboundLaneData { - /// Returns approximate size of the struct, given number of entries in the `relayers` set and + /// Returns approximate size of the struct, given a number of entries in the `relayers` set and /// size of each entry. /// /// Returns `None` if size overflows `u32` limits. @@ -277,12 +277,12 @@ pub struct UnrewardedRelayersState { /// Outbound lane data. #[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq)] pub struct OutboundLaneData { - /// Nonce of oldest message that we haven't yet pruned. May point to not-yet-generated message if + /// Nonce of the oldest message that we haven't yet pruned. May point to not-yet-generated message if /// all sent messages are already pruned. pub oldest_unpruned_nonce: MessageNonce, - /// Nonce of latest message, received by bridged chain. + /// Nonce of the latest message, received by bridged chain. pub latest_received_nonce: MessageNonce, - /// Nonce of latest message, generated by us. + /// Nonce of the latest message, generated by us. pub latest_generated_nonce: MessageNonce, } diff --git a/bridges/primitives/messages/src/source_chain.rs b/bridges/primitives/messages/src/source_chain.rs index ed69f39c76..a1ec0f19b4 100644 --- a/bridges/primitives/messages/src/source_chain.rs +++ b/bridges/primitives/messages/src/source_chain.rs @@ -56,14 +56,14 @@ pub trait TargetHeaderChain { /// /// The proper implementation must ensure that the delivery-transaction with this /// payload would (at least) be accepted into target chain transaction pool AND - /// eventually will be successfully 'mined'. The most obvious incorrect implementation + /// eventually will be successfully mined. The most obvious incorrect implementation /// example would be implementation for BTC chain that accepts payloads larger than /// 1MB. BTC nodes aren't accepting transactions that are larger than 1MB, so relayer /// will be unable to craft valid transaction => this (and all subsequent) messages will /// never be delivered. fn verify_message(payload: &Payload) -> Result<(), Self::Error>; - /// Verify messages delivery proof and return lane && nonce of the latest recevied message. + /// Verify messages delivery proof and return lane && nonce of the latest received message. fn verify_messages_delivery_proof( proof: Self::MessagesDeliveryProof, ) -> Result<(LaneId, InboundLaneData), Self::Error>; @@ -102,7 +102,7 @@ pub trait LaneMessageVerifier { /// by relayer. /// /// So to be sure that any non-altruist relayer would agree to deliver message, submitter -/// should set `delivery_and_dispatch_fee` to at least (equialent of): sum of fees from (2) +/// should set `delivery_and_dispatch_fee` to at least (equivalent of): sum of fees from (2) /// to (4) above, plus some interest for the relayer. pub trait MessageDeliveryAndDispatchPayment { /// Error type. diff --git a/bridges/primitives/messages/src/target_chain.rs b/bridges/primitives/messages/src/target_chain.rs index d1b87fd023..38ce9e800d 100644 --- a/bridges/primitives/messages/src/target_chain.rs +++ b/bridges/primitives/messages/src/target_chain.rs @@ -75,7 +75,7 @@ pub trait SourceHeaderChain { /// messages will be rejected. /// /// The `messages_count` argument verification (sane limits) is supposed to be made - /// outside of this function. This function only verifies that the proof declares exactly + /// outside this function. This function only verifies that the proof declares exactly /// `messages_count` messages. fn verify_messages_proof( proof: Self::MessagesProof, diff --git a/bridges/primitives/polkadot-core/src/lib.rs b/bridges/primitives/polkadot-core/src/lib.rs index a1619b27bc..4744e29492 100644 --- a/bridges/primitives/polkadot-core/src/lib.rs +++ b/bridges/primitives/polkadot-core/src/lib.rs @@ -66,18 +66,18 @@ pub const EXTRA_STORAGE_PROOF_SIZE: u32 = 1024; /// All polkadot-like chains are using same crypto. pub const MAXIMAL_ENCODED_ACCOUNT_ID_SIZE: u32 = 32; -/// All Polkadot-like chains allow normal extrinsics to fill block up to 75%. +/// All Polkadot-like chains allow normal extrinsics to fill block up to 75 percent. /// /// This is a copy-paste from the Polkadot repo's `polkadot-runtime-common` crate. const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); -/// All Polkadot-like chains allow 2 seconds of compute with a 6 second average block time. +/// All Polkadot-like chains allow 2 seconds of compute with a 6-second average block time. /// /// This is a copy-paste from the Polkadot repo's `polkadot-runtime-common` crate. pub const MAXIMUM_BLOCK_WEIGHT: Weight = 2 * WEIGHT_PER_SECOND; -/// All Polkadot-like chains assume that an on-initialize consumes 1% of the weight on average, -/// hence a single extrinsic will not be allowed to consume more than `AvailableBlockRatio - 1%`. +/// All Polkadot-like chains assume that an on-initialize consumes 1 percent of the weight on average, +/// hence a single extrinsic will not be allowed to consume more than `AvailableBlockRatio - 1 percent`. /// /// This is a copy-paste from the Polkadot repo's `polkadot-runtime-common` crate. pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(1); @@ -165,7 +165,7 @@ pub type Index = u32; /// Hashing type. pub type Hashing = BlakeTwo256; -/// The type of an object that can produce hashes on Polkadot-like chains. +/// The type of object that can produce hashes on Polkadot-like chains. pub type Hasher = BlakeTwo256; /// The header type used by Polkadot-like chains. @@ -304,7 +304,7 @@ impl Convert for AccountIdConverter { /// Return a storage key for account data. /// /// This is based on FRAME storage-generation code from Substrate: -/// https://github.com/paritytech/substrate/blob/c939ceba381b6313462d47334f775e128ea4e95d/frame/support/src/storage/generator/map.rs#L74 +/// [link](https://github.com/paritytech/substrate/blob/c939ceba381b6313462d47334f775e128ea4e95d/frame/support/src/storage/generator/map.rs#L74) /// The equivalent command to invoke in case full `Runtime` is known is this: /// `let key = frame_system::Account::::storage_map_final_key(&account_id);` pub fn account_info_storage_key(id: &AccountId) -> Vec { diff --git a/bridges/primitives/runtime/src/lib.rs b/bridges/primitives/runtime/src/lib.rs index 7b17a2947f..ed915b7288 100644 --- a/bridges/primitives/runtime/src/lib.rs +++ b/bridges/primitives/runtime/src/lib.rs @@ -74,9 +74,9 @@ pub type ChainId = [u8; 4]; /// Type of accounts on the source chain. pub enum SourceAccount { - /// An account that belongs to Root (priviledged origin). + /// An account that belongs to Root (privileged origin). Root, - /// A non-priviledged account. + /// A non-privileged account. /// /// The embedded account ID may or may not have a private key depending on the "owner" of the /// account (private key, pallet, proxy, etc.). @@ -86,7 +86,7 @@ pub enum SourceAccount { /// Derive an account ID from a foreign account ID. /// /// This function returns an encoded Blake2 hash. It is the responsibility of the caller to ensure -/// this can be succesfully decoded into an AccountId. +/// this can be successfully decoded into an AccountId. /// /// The `bridge_id` is used to provide extra entropy when producing account IDs. This helps prevent /// AccountId collisions between different bridges on a single target chain. diff --git a/bridges/primitives/runtime/src/messages.rs b/bridges/primitives/runtime/src/messages.rs index f6e04619c7..1b00c10fa4 100644 --- a/bridges/primitives/runtime/src/messages.rs +++ b/bridges/primitives/runtime/src/messages.rs @@ -22,7 +22,7 @@ use frame_support::{weights::Weight, RuntimeDebug}; /// Where message dispatch fee is paid? #[derive(Encode, Decode, RuntimeDebug, Clone, Copy, PartialEq, Eq)] pub enum DispatchFeePayment { - /// The dispacth fee is paid at the source chain. + /// The dispatch fee is paid at the source chain. AtSourceChain, /// The dispatch fee is paid at the target chain. /// diff --git a/bridges/primitives/test-utils/src/lib.rs b/bridges/primitives/test-utils/src/lib.rs index 6410975408..83aac614ab 100644 --- a/bridges/primitives/test-utils/src/lib.rs +++ b/bridges/primitives/test-utils/src/lib.rs @@ -49,7 +49,7 @@ pub struct JustificationGeneratorParams { pub authorities: Vec<(Account, AuthorityWeight)>, /// The total number of precommit ancestors in the `votes_ancestries` field our justification. /// - /// These may be distributed among many different forks. + /// These may be distributed among many forks. pub ancestors: u32, /// The number of forks. /// diff --git a/bridges/relays/bin-ethereum/src/ethereum_client.rs b/bridges/relays/bin-ethereum/src/ethereum_client.rs index 71a3f38859..007bef49fe 100644 --- a/bridges/relays/bin-ethereum/src/ethereum_client.rs +++ b/bridges/relays/bin-ethereum/src/ethereum_client.rs @@ -41,7 +41,7 @@ type RpcResult = std::result::Result; /// interactions involving, for example, an Ethereum contract. #[async_trait] pub trait EthereumHighLevelRpc { - /// Returns best Substrate block that PoA chain knows of. + /// Returns the best Substrate block that PoA chain knows of. async fn best_substrate_block(&self, contract_address: Address) -> RpcResult; /// Returns true if Substrate header is known to Ethereum node. diff --git a/bridges/relays/bin-ethereum/src/rialto_client.rs b/bridges/relays/bin-ethereum/src/rialto_client.rs index 1ec1e7df79..311bc9edbc 100644 --- a/bridges/relays/bin-ethereum/src/rialto_client.rs +++ b/bridges/relays/bin-ethereum/src/rialto_client.rs @@ -41,13 +41,13 @@ type RpcResult = std::result::Result; /// interactions involving, for example, an Ethereum bridge module. #[async_trait] pub trait SubstrateHighLevelRpc { - /// Returns best Ethereum block that Substrate runtime knows of. + /// Returns the best Ethereum block that Substrate runtime knows of. async fn best_ethereum_block(&self) -> RpcResult; /// Returns best finalized Ethereum block that Substrate runtime knows of. async fn best_ethereum_finalized_block(&self) -> RpcResult; - /// Returns whether or not transactions receipts are required for Ethereum header submission. + /// Returns whether transactions receipts are required for Ethereum header submission. async fn ethereum_receipts_required(&self, header: SubstrateEthereumHeader) -> RpcResult; - /// Returns whether or not the given Ethereum header is known to the Substrate runtime. + /// Returns whether the given Ethereum header is known to the Substrate runtime. async fn ethereum_header_known(&self, header_id: EthereumHeaderId) -> RpcResult; } diff --git a/bridges/relays/bin-substrate/src/chains/rococo.rs b/bridges/relays/bin-substrate/src/chains/rococo.rs index ec94450a63..ec34d9cd33 100644 --- a/bridges/relays/bin-substrate/src/chains/rococo.rs +++ b/bridges/relays/bin-substrate/src/chains/rococo.rs @@ -27,7 +27,7 @@ use crate::cli::{ /// Weight of the `system::remark` call at Rococo. /// -/// This weight is larger (x2) than actual weight at current Rooco runtime to avoid unsuccessful +/// This weight is larger (x2) than actual weight at current Rococo runtime to avoid unsuccessful /// calls in the future. But since it is used only in tests (and on test chains), this is ok. pub(crate) const SYSTEM_REMARK_CALL_WEIGHT: Weight = 2 * 1_345_000; diff --git a/bridges/relays/bin-substrate/src/cli/derive_account.rs b/bridges/relays/bin-substrate/src/cli/derive_account.rs index f1967df8c7..1903d42c1f 100644 --- a/bridges/relays/bin-substrate/src/cli/derive_account.rs +++ b/bridges/relays/bin-substrate/src/cli/derive_account.rs @@ -28,7 +28,7 @@ use strum::VariantNames; /// since messages sent over the bridge will be able to spend these. #[derive(StructOpt)] pub struct DeriveAccount { - /// A bridge instance to initalize. + /// A bridge instance to initialize. #[structopt(possible_values = FullBridge::VARIANTS, case_insensitive = true)] bridge: FullBridge, /// Source-chain address to derive Target-chain address from. diff --git a/bridges/relays/bin-substrate/src/cli/encode_message.rs b/bridges/relays/bin-substrate/src/cli/encode_message.rs index a2d8a422b5..d002ab28f4 100644 --- a/bridges/relays/bin-substrate/src/cli/encode_message.rs +++ b/bridges/relays/bin-substrate/src/cli/encode_message.rs @@ -41,7 +41,7 @@ pub enum MessagePayload { /// A `MessagePayload` to encode. #[derive(StructOpt)] pub struct EncodeMessage { - /// A bridge instance to initalize. + /// A bridge instance to initialize. #[structopt(possible_values = FullBridge::VARIANTS, case_insensitive = true)] bridge: FullBridge, #[structopt(flatten)] diff --git a/bridges/relays/bin-substrate/src/cli/init_bridge.rs b/bridges/relays/bin-substrate/src/cli/init_bridge.rs index 1ff39ede5c..647978e430 100644 --- a/bridges/relays/bin-substrate/src/cli/init_bridge.rs +++ b/bridges/relays/bin-substrate/src/cli/init_bridge.rs @@ -26,7 +26,7 @@ use strum::{EnumString, EnumVariantNames, VariantNames}; /// Initialize bridge pallet. #[derive(StructOpt)] pub struct InitBridge { - /// A bridge instance to initalize. + /// A bridge instance to initialize. #[structopt(possible_values = InitBridgeName::VARIANTS, case_insensitive = true)] bridge: InitBridgeName, #[structopt(flatten)] diff --git a/bridges/relays/bin-substrate/src/cli/mod.rs b/bridges/relays/bin-substrate/src/cli/mod.rs index 3088b06eb0..d108c71f7b 100644 --- a/bridges/relays/bin-substrate/src/cli/mod.rs +++ b/bridges/relays/bin-substrate/src/cli/mod.rs @@ -235,7 +235,7 @@ pub trait CliChain: relay_substrate_client::Chain { /// Bridge Message Payload type. /// - /// TODO [#854] This should be removed in favour of target-specifc types. + /// TODO [#854] This should be removed in favor of target-specifc types. type MessagePayload; /// Numeric value of SS58 format. @@ -354,7 +354,7 @@ where } /// Create chain-specific set of configuration objects: connection parameters, -/// signing parameters and bridge initialisation parameters. +/// signing parameters and bridge initialization parameters. #[macro_export] macro_rules! declare_chain_options { ($chain:ident, $chain_prefix:ident) => { diff --git a/bridges/relays/bin-substrate/src/cli/send_message.rs b/bridges/relays/bin-substrate/src/cli/send_message.rs index 2834474579..6259c85b50 100644 --- a/bridges/relays/bin-substrate/src/cli/send_message.rs +++ b/bridges/relays/bin-substrate/src/cli/send_message.rs @@ -35,7 +35,7 @@ use strum::{EnumString, EnumVariantNames, VariantNames}; #[derive(Debug, EnumString, EnumVariantNames, Clone, Copy, PartialEq, Eq)] #[strum(serialize_all = "kebab_case")] pub enum DispatchFeePayment { - /// The dispacth fee is paid at the source chain. + /// The dispatch fee is paid at the source chain. AtSourceChain, /// The dispatch fee is paid at the target chain. AtTargetChain, diff --git a/bridges/relays/bin-substrate/src/finality_pipeline.rs b/bridges/relays/bin-substrate/src/finality_pipeline.rs index 19fa0917df..2013ec646b 100644 --- a/bridges/relays/bin-substrate/src/finality_pipeline.rs +++ b/bridges/relays/bin-substrate/src/finality_pipeline.rs @@ -49,7 +49,7 @@ pub trait SubstrateFinalitySyncPipeline: FinalitySyncPipeline { /// Start finality relay guards. /// /// Different finality bridges may have different set of guards - e.g. on ephemeral chains we - /// don't need version guards, on test chains we don't care that much about relayer account + /// don't need a version guards, on test chains we don't care that much about relayer account /// balance, ... So the implementation is left to the specific bridges. fn start_relay_guards(&self) {} diff --git a/bridges/relays/bin-substrate/src/messages_lane.rs b/bridges/relays/bin-substrate/src/messages_lane.rs index 1920137f14..cea43058d8 100644 --- a/bridges/relays/bin-substrate/src/messages_lane.rs +++ b/bridges/relays/bin-substrate/src/messages_lane.rs @@ -66,9 +66,9 @@ pub trait SubstrateMessageLane: MessageLane { /// Name of the runtime method that returns latest received nonce at the target chain. const INBOUND_LANE_LATEST_RECEIVED_NONCE_METHOD: &'static str; - /// Name of the runtime method that returns latest confirmed (reward-paid) nonce at the target chain. + /// Name of the runtime method that returns the latest confirmed (reward-paid) nonce at the target chain. const INBOUND_LANE_LATEST_CONFIRMED_NONCE_METHOD: &'static str; - /// Numebr of the runtime method that returns state of "unrewarded relayers" set at the target chain. + /// Number of the runtime method that returns state of "unrewarded relayers" set at the target chain. const INBOUND_LANE_UNREWARDED_RELAYERS_STATE: &'static str; /// Name of the runtime method that returns id of best finalized source header at target chain. diff --git a/bridges/relays/bin-substrate/src/on_demand_headers.rs b/bridges/relays/bin-substrate/src/on_demand_headers.rs index 58ef268a29..4a2b04328b 100644 --- a/bridges/relays/bin-substrate/src/on_demand_headers.rs +++ b/bridges/relays/bin-substrate/src/on_demand_headers.rs @@ -248,7 +248,7 @@ async fn background_task( } } -/// Returns `Some()` with inclusive range of headers which must be scanned for manadatory headers +/// Returns `Some()` with inclusive range of headers which must be scanned for mandatory headers /// and the first of such headers must be submitted to the target node. async fn mandatory_headers_scan_range( best_finalized_source_header_at_source: Option, diff --git a/bridges/relays/client-ethereum/src/sign.rs b/bridges/relays/client-ethereum/src/sign.rs index 6f479ab7d5..da1dbc4842 100644 --- a/bridges/relays/client-ethereum/src/sign.rs +++ b/bridges/relays/client-ethereum/src/sign.rs @@ -47,7 +47,7 @@ impl Default for SigningParams { } } -/// Sign and submit tranaction using given Ethereum client. +/// Sign and submit transaction using given Ethereum client. pub async fn sign_and_submit_transaction( client: &Client, params: &SigningParams, diff --git a/bridges/relays/client-rococo/src/runtime.rs b/bridges/relays/client-rococo/src/runtime.rs index 6dbd40bee5..77d10529bf 100644 --- a/bridges/relays/client-rococo/src/runtime.rs +++ b/bridges/relays/client-rococo/src/runtime.rs @@ -61,7 +61,7 @@ where /// All entries here (like pretty much in the entire file) must be kept in sync with Rococo /// `construct_runtime`, so that we maintain SCALE-compatibility. /// -/// See: https://github.com/paritytech/polkadot/blob/master/runtime/rococo/src/lib.rs +/// See: [link](https://github.com/paritytech/polkadot/blob/master/runtime/rococo/src/lib.rs) #[allow(clippy::large_enum_variant)] #[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)] pub enum Call { diff --git a/bridges/relays/client-substrate/src/chain.rs b/bridges/relays/client-substrate/src/chain.rs index 63432c9701..03cbaef2d8 100644 --- a/bridges/relays/client-substrate/src/chain.rs +++ b/bridges/relays/client-substrate/src/chain.rs @@ -61,7 +61,7 @@ pub trait Chain: ChainBase + Clone { type Call: Dispatchable + Debug; /// Balance of an account in native tokens. /// - /// The chain may suport multiple tokens, but this particular type is for token that is used + /// The chain may support multiple tokens, but this particular type is for token that is used /// to pay for transaction dispatch, to reward different relayers (headers, messages), etc. type Balance: AtLeast32BitUnsigned + FixedPointOperand diff --git a/bridges/relays/client-substrate/src/client.rs b/bridges/relays/client-substrate/src/client.rs index 7449dda100..8164501348 100644 --- a/bridges/relays/client-substrate/src/client.rs +++ b/bridges/relays/client-substrate/src/client.rs @@ -85,7 +85,7 @@ impl std::fmt::Debug for Client { impl Client { /// Returns client that is able to call RPCs on Substrate node over websocket connection. /// - /// This function will keep connecting to given Sustrate node until connection is established + /// This function will keep connecting to given Substrate node until connection is established /// and is functional. If attempt fail, it will wait for `RECONNECT_DELAY` and retry again. pub async fn new(params: ConnectionParams) -> Self { loop { @@ -263,7 +263,7 @@ impl Client { /// Get the nonce of the given Substrate account. /// - /// Note: It's the caller's responsibility to make sure `account` is a valid ss58 address. + /// Note: It's the caller's responsibility to make sure `account` is a valid SS58 address. pub async fn next_account_index(&self, account: C::AccountId) -> Result { self.jsonrpsee_execute(move |client| async move { Ok(Substrate::::system_account_next_index(&*client, account).await?) diff --git a/bridges/relays/client-substrate/src/guard.rs b/bridges/relays/client-substrate/src/guard.rs index e7159bf271..37a7c2aa27 100644 --- a/bridges/relays/client-substrate/src/guard.rs +++ b/bridges/relays/client-substrate/src/guard.rs @@ -80,7 +80,7 @@ pub fn abort_on_spec_version_change(mut env: impl Environm }); } -/// Abort if, during a 24 hours, free balance of given account is decreased at least by given value. +/// Abort if, during 24 hours, free balance of given account is decreased at least by given value. /// Other components may increase (or decrease) balance of account and it WILL affect logic of the guard. pub fn abort_when_account_balance_decreased( mut env: impl Environment, diff --git a/bridges/relays/client-wococo/src/runtime.rs b/bridges/relays/client-wococo/src/runtime.rs index e973c3a6d0..e3e7ce7b31 100644 --- a/bridges/relays/client-wococo/src/runtime.rs +++ b/bridges/relays/client-wococo/src/runtime.rs @@ -61,7 +61,7 @@ where /// All entries here (like pretty much in the entire file) must be kept in sync with Rococo /// `construct_runtime`, so that we maintain SCALE-compatibility. /// -/// See: https://github.com/paritytech/polkadot/blob/master/runtime/rococo/src/lib.rs +/// See: [link](https://github.com/paritytech/polkadot/blob/master/runtime/rococo/src/lib.rs) #[allow(clippy::large_enum_variant)] #[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)] pub enum Call { diff --git a/bridges/relays/headers/src/headers.rs b/bridges/relays/headers/src/headers.rs index 0b948d9da4..b9095e1931 100644 --- a/bridges/relays/headers/src/headers.rs +++ b/bridges/relays/headers/src/headers.rs @@ -65,7 +65,7 @@ pub struct QueuedHeaders { /// Headers that are (we believe) currently submitted to target node by our, /// not-yet mined transactions. submitted: HeadersQueue

, - /// Synced headers childrens. We need it to support case when header is synced, but some of + /// Synced headers children. We need it to support case when header is synced, but some of /// its parents are incomplete. synced_children: SyncedChildren

, /// Pointers to all headers that we ever seen and we believe we can touch in the future. @@ -191,7 +191,7 @@ impl QueuedHeaders

{ .unwrap_or(HeaderStatus::Unknown) } - /// Get oldest header from given queue. + /// Get the oldest header from given queue. pub fn header(&self, status: HeaderStatus) -> Option<&QueuedHeader

> { match status { HeaderStatus::Unknown | HeaderStatus::Synced => None, @@ -205,7 +205,7 @@ impl QueuedHeaders

{ } } - /// Get oldest headers from given queue until functor will return false. + /// Get the oldest headers from given queue until functor will return false. pub fn headers( &self, status: HeaderStatus, @@ -282,7 +282,7 @@ impl QueuedHeaders

{ ); } - /// Receive best header from the target node. + /// Receive the best header from the target node. pub fn target_best_header_response(&mut self, id: &HeaderIdOf

) { self.header_synced(id) } @@ -453,7 +453,7 @@ impl QueuedHeaders

{ } } - /// When incomplete headers ids are receved from target node. + /// When incomplete headers ids are received from target node. pub fn incomplete_headers_response(&mut self, ids: HashSet>) { // all new incomplete headers are marked Synced and all their descendants // are moved from Ready/Submitted to Incomplete queue diff --git a/bridges/relays/headers/src/sync.rs b/bridges/relays/headers/src/sync.rs index e992b1f8e5..cd5ab0906f 100644 --- a/bridges/relays/headers/src/sync.rs +++ b/bridges/relays/headers/src/sync.rs @@ -35,7 +35,7 @@ pub struct HeadersSyncParams { /// Maximal total headers size in single submit request. pub max_headers_size_in_single_submit: usize, /// We only may store and accept (from Ethereum node) headers that have - /// number >= than best_substrate_header.number - prune_depth. + /// number >= than "best_substrate_header.number" - "prune_depth". pub prune_depth: u32, /// Target transactions mode. pub target_tx_mode: TargetTransactionMode, @@ -58,9 +58,9 @@ pub enum TargetTransactionMode { pub struct HeadersSync { /// Synchronization parameters. params: HeadersSyncParams, - /// Best header number known to source node. + /// The best header number known to source node. source_best_number: Option, - /// Best header known to target node. + /// The best header known to target node. target_best_header: Option>, /// Headers queue. headers: QueuedHeaders

, @@ -85,7 +85,7 @@ impl HeadersSync

{ self.source_best_number } - /// Best header known to target node. + /// The best header known to target node. pub fn target_best_header(&self) -> Option> { self.target_best_header } @@ -150,7 +150,7 @@ impl HeadersSync

{ Some(best_downloaded_number + One::one()) } - /// Selech orphan header to downoload. + /// Selech orphan header to download. pub fn select_orphan_header_to_download(&self) -> Option<&QueuedHeader

> { let orphan_header = self.headers.header(HeaderStatus::Orphan)?; diff --git a/bridges/relays/headers/src/sync_loop.rs b/bridges/relays/headers/src/sync_loop.rs index 5ccec4bbab..c373f41520 100644 --- a/bridges/relays/headers/src/sync_loop.rs +++ b/bridges/relays/headers/src/sync_loop.rs @@ -80,7 +80,7 @@ pub trait SourceClient: RelayClient { /// Target client trait. #[async_trait] pub trait TargetClient: RelayClient { - /// Returns ID of best header known to the target node. + /// Returns ID of the best header known to the target node. async fn best_header_id(&self) -> Result, Self::Error>; /// Returns true if header is known to the target node. diff --git a/bridges/relays/headers/src/sync_types.rs b/bridges/relays/headers/src/sync_types.rs index 5809ebab59..f6c36758b8 100644 --- a/bridges/relays/headers/src/sync_types.rs +++ b/bridges/relays/headers/src/sync_types.rs @@ -156,8 +156,8 @@ pub struct SubmittedHeaders { /// IDs of incomplete headers. These headers were submitted (so this id is also in `submitted` vec), /// but all descendants are not. pub incomplete: Vec, - /// IDs of ignored headers that we have decided not to submit (they're either rejected by - /// target node immediately, or they're descendants of incomplete headers). + /// IDs of ignored headers that we have decided not to submit (they are either rejected by + /// target node immediately, or their descendants of incomplete headers). pub rejected: Vec, /// Fatal target node error, if it has occured during submission. pub fatal_error: Option, diff --git a/bridges/relays/messages/src/lib.rs b/bridges/relays/messages/src/lib.rs index cdd94bca95..861091ab20 100644 --- a/bridges/relays/messages/src/lib.rs +++ b/bridges/relays/messages/src/lib.rs @@ -18,7 +18,7 @@ //! data. Message lane allows sending arbitrary messages between bridged chains. This //! module provides entrypoint that starts reading messages from given message lane //! of source chain and submits proof-of-message-at-source-chain transactions to the -//! target chain. Additionaly, proofs-of-messages-delivery are sent back from the +//! target chain. Additionally, proofs-of-messages-delivery are sent back from the //! target chain to the source chain. // required for futures::select! diff --git a/bridges/relays/messages/src/message_lane_loop.rs b/bridges/relays/messages/src/message_lane_loop.rs index 282c3bc8b6..84b0c72408 100644 --- a/bridges/relays/messages/src/message_lane_loop.rs +++ b/bridges/relays/messages/src/message_lane_loop.rs @@ -175,7 +175,7 @@ pub trait TargetClient: RelayClient { id: TargetHeaderIdOf

, ) -> Result<(TargetHeaderIdOf

, MessageNonce), Self::Error>; - /// Get nonce of latest confirmed message. + /// Get nonce of the latest confirmed message. async fn latest_confirmed_received_nonce( &self, id: TargetHeaderIdOf

, @@ -218,7 +218,7 @@ pub trait TargetClient: RelayClient { /// State of the client. #[derive(Clone, Debug, Default, PartialEq)] pub struct ClientState { - /// Best header id of this chain. + /// The best header id of this chain. pub best_self: SelfHeaderId, /// Best finalized header id of this chain. pub best_finalized_self: SelfHeaderId, diff --git a/bridges/relays/messages/src/message_race_delivery.rs b/bridges/relays/messages/src/message_race_delivery.rs index 260a72f3f0..2e94bbee8b 100644 --- a/bridges/relays/messages/src/message_race_delivery.rs +++ b/bridges/relays/messages/src/message_race_delivery.rs @@ -11,7 +11,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -//! Message delivery race delivers proof-of-messages from lane.source to lane.target. +//! Message delivery race delivers proof-of-messages from "lane.source" to "lane.target". use crate::message_lane::{MessageLane, SourceHeaderIdOf, TargetHeaderIdOf}; use crate::message_lane_loop::{ @@ -219,7 +219,7 @@ where /// Additional nonces data from the target client used by message delivery race. #[derive(Debug, Clone)] struct DeliveryRaceTargetNoncesData { - /// Latest nonce that we know: (1) has been delivered to us (2) has been confirmed + /// The latest nonce that we know: (1) has been delivered to us (2) has been confirmed /// back to the source node (by confirmations race) and (3) relayer has received /// reward for (and this has been confirmed by the message delivery race). confirmed_nonce: MessageNonce, diff --git a/bridges/relays/messages/src/message_race_loop.rs b/bridges/relays/messages/src/message_race_loop.rs index 3b427a2d0e..399f871980 100644 --- a/bridges/relays/messages/src/message_race_loop.rs +++ b/bridges/relays/messages/src/message_race_loop.rs @@ -76,7 +76,7 @@ pub struct SourceClientNonces { /// New nonces range known to the client. `New` here means all nonces generated after /// `prev_latest_nonce` passed to the `SourceClient::nonces` method. pub new_nonces: NoncesRange, - /// Latest nonce that is confirmed to the bridged client. This nonce only makes + /// The latest nonce that is confirmed to the bridged client. This nonce only makes /// sense in some races. In other races it is `None`. pub confirmed_nonce: Option, } @@ -84,7 +84,7 @@ pub struct SourceClientNonces { /// Nonces on the race target client. #[derive(Debug, Clone)] pub struct TargetClientNonces { - /// Latest nonce that is known to the target client. + /// The latest nonce that is known to the target client. pub latest_nonce: MessageNonce, /// Additional data from target node that may be used by the race. pub nonces_data: TargetNoncesData, @@ -93,7 +93,7 @@ pub struct TargetClientNonces { /// One of message lane clients, which is source client for the race. #[async_trait] pub trait SourceClient { - /// Type of error this clients returns. + /// Type of error these clients returns. type Error: std::fmt::Debug + MaybeConnectionError; /// Type of nonces range returned by the source client. type NoncesRange: NoncesRange; @@ -118,7 +118,7 @@ pub trait SourceClient { /// One of message lane clients, which is target client for the race. #[async_trait] pub trait TargetClient { - /// Type of error this clients returns. + /// Type of error these clients returns. type Error: std::fmt::Debug + MaybeConnectionError; /// Type of the additional data from the target client, used by the race. type TargetNoncesData: std::fmt::Debug; @@ -156,12 +156,12 @@ pub trait RaceStrategy: Debug { fn is_empty(&self) -> bool; /// Return id of source header that is required to be on target to continue synchronization. fn required_source_header_at_target(&self, current_best: &SourceHeaderId) -> Option; - /// Return best nonce at source node. + /// Return the best nonce at source node. /// /// `Some` is returned only if we are sure that the value is greater or equal /// than the result of `best_at_target`. fn best_at_source(&self) -> Option; - /// Return best nonce at target node. + /// Return the best nonce at target node. /// /// May return `None` if value is yet unknown. fn best_at_target(&self) -> Option; @@ -197,7 +197,7 @@ pub struct RaceState { /// Best finalized source header id at the best block on the target /// client (at the `best_finalized_source_header_id_at_best_target`). pub best_finalized_source_header_id_at_best_target: Option, - /// Best header id at the target client. + /// The best header id at the target client. pub best_target_header_id: Option, /// Best finalized header id at the target client. pub best_finalized_target_header_id: Option, diff --git a/bridges/relays/messages/src/message_race_receiving.rs b/bridges/relays/messages/src/message_race_receiving.rs index 4381b63591..f9ac61352f 100644 --- a/bridges/relays/messages/src/message_race_receiving.rs +++ b/bridges/relays/messages/src/message_race_receiving.rs @@ -11,7 +11,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -//! Message receiving race delivers proof-of-messages-delivery from lane.target to lane.source. +//! Message receiving race delivers proof-of-messages-delivery from "lane.target" to "lane.source". use crate::message_lane::{MessageLane, SourceHeaderIdOf, TargetHeaderIdOf}; use crate::message_lane_loop::{ diff --git a/bridges/relays/messages/src/message_race_strategy.rs b/bridges/relays/messages/src/message_race_strategy.rs index ed4a276e14..bc04ad5bcd 100644 --- a/bridges/relays/messages/src/message_race_strategy.rs +++ b/bridges/relays/messages/src/message_race_strategy.rs @@ -40,7 +40,7 @@ pub struct BasicStrategy< > { /// All queued nonces. source_queue: SourceRangesQueue, - /// Best nonce known to target node (at its best block). `None` if it has not been received yet. + /// The best nonce known to target node (at its best block). `None` if it has not been received yet. best_target_nonce: Option, /// Unused generic types dump. _phantom: PhantomData<(TargetHeaderNumber, TargetHeaderHash, Proof)>, diff --git a/bridges/relays/messages/src/metrics.rs b/bridges/relays/messages/src/metrics.rs index 51a4118be8..8f11517052 100644 --- a/bridges/relays/messages/src/metrics.rs +++ b/bridges/relays/messages/src/metrics.rs @@ -87,21 +87,21 @@ impl MessageLaneLoopMetrics { .set(source_latest_generated_nonce); } - /// Update latest confirmed nonce at source. + /// Update the latest confirmed nonce at source. pub fn update_source_latest_confirmed_nonce(&self, source_latest_confirmed_nonce: MessageNonce) { self.lane_state_nonces .with_label_values(&["source_latest_confirmed"]) .set(source_latest_confirmed_nonce); } - /// Update latest received nonce at target. + /// Update the latest received nonce at target. pub fn update_target_latest_received_nonce(&self, target_latest_generated_nonce: MessageNonce) { self.lane_state_nonces .with_label_values(&["target_latest_received"]) .set(target_latest_generated_nonce); } - /// Update latest confirmed nonce at target. + /// Update the latest confirmed nonce at target. pub fn update_target_latest_confirmed_nonce(&self, target_latest_confirmed_nonce: MessageNonce) { self.lane_state_nonces .with_label_values(&["target_latest_confirmed"]) diff --git a/bridges/relays/utils/src/relay_loop.rs b/bridges/relays/utils/src/relay_loop.rs index ea9d627521..38b636a599 100644 --- a/bridges/relays/utils/src/relay_loop.rs +++ b/bridges/relays/utils/src/relay_loop.rs @@ -27,7 +27,7 @@ pub const RECONNECT_DELAY: Duration = Duration::from_secs(10); /// Basic blockchain client from relay perspective. #[async_trait] pub trait Client: 'static + Clone + Send + Sync { - /// Type of error this clients returns. + /// Type of error these clients returns. type Error: 'static + Debug + MaybeConnectionError + Send + Sync; /// Try to reconnect to source node.