diff --git a/bridges/bin/millau/node/src/cli.rs b/bridges/bin/millau/node/src/cli.rs index 46323ed25c9ed2e39ebc6089b5bfa0e2ad29ddfd..49f4fc092fac08b09799a6c52942df6f682b4d13 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 ff5b39439b60bcd5966d5017abbc4027782a7e72..8d9f5edcf1baa557173c1b6358594edcf0fb2d2b 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 46323ed25c9ed2e39ebc6089b5bfa0e2ad29ddfd..49f4fc092fac08b09799a6c52942df6f682b4d13 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 a054962a79c71d1aef21d52c76bc3f4b925355cb..e259856f3755998d3b6306b4079a457205f5701d 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 03b0ca8a07163635b723eebb94c0ba8b45018fa3..15c73fc6ea3f0dd74258b4b401649bd82db77654 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 762ef1710220f1429958f0692bbebc058b3e4059..3a40139d6d938e7beea5d9b1aa7e5d38b2742cd6 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 9ca3ca42ff5e51eab3c1cbd5ee9181a5384f9ed0..2fc210ed7a56e68e00b5ed8a41f75944f279917a 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 d3533fcfcb0a4f103d1ff1190fca9a0a7c2e3b26..b27295481a2c76d3af5ac0ae622bc61184538be3 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 a07f838cf8d64d7a0fabe051c5593d75a502ca57..75004fd2a92f6d8d5ae021869154bd9ede7858e3 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 58987c6b29bc51e00a56b4f3e51e630ce27e7dd1..25f1ecdb2c3dfa1edbdf1b5e463072c60b05c923 100644 --- a/bridges/modules/ethereum/src/finality.rs +++ b/bridges/modules/ethereum/src/finality.rs @@ -36,7 +36,7 @@ pub struct CachedFinalityVotes<Submitter> { /// 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<Submitter>, 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<Submitter> { pub struct FinalityVotes<Submitter> { /// Number of votes per each validator. pub votes: BTreeMap<Address, u64>, - /// 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<FinalityAncestor<Submitter>>, } diff --git a/bridges/modules/ethereum/src/import.rs b/bridges/modules/ethereum/src/import.rs index 8cd4c8a17c771c8c0ee36954616f9fceb1be172f..89ee39f7b3c41cf0776605149b1ecd025b435443 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 facf377d51b82df1c0e1b7f2d91024cc0517ab9b..ebb36edbe54d6570c07148fcb0b8f5a1d7f90da9 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 41161089ba6d07e0eb056a66890558df80fe8553..853ad0930bb0d953bee2175a50dffde95b0ec1c5 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 c8c4deca87f1de6be266d6b2275b78e31378b475..638da68af46ad6df776047a4638321502e9c2084 100644 --- a/bridges/modules/ethereum/src/verification.rs +++ b/bridges/modules/ethereum/src/verification.rs @@ -43,7 +43,7 @@ pub fn is_importable_header<S: Storage>(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<S: Storage, CT: ChainTime>( diff --git a/bridges/modules/grandpa/src/benchmarking.rs b/bridges/modules/grandpa/src/benchmarking.rs index bc027e86a4b59863b216bc87b6c31b2c40de66ac..02600201f7466513d44c7d1721c590285ac88312 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 4cca1c78273830f53032c3bb22e226340285edd8..6c25968630e279e475c6e530f2ccde7f881cf8df 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<T: Config<I>, 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<T: Config<I>, I: 'static>( justification: &GrandpaJustification<BridgedHeader<T, I>>, @@ -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<T: Config<I>, I: 'static>(header: BridgedHeader<T, I>, hash: BridgedBlockHash<T, I>) { let index = <ImportedHashesPointer<T, I>>::get(); let pruning = <ImportedHashes<T, I>>::try_get(index); diff --git a/bridges/modules/messages/src/instant_payments.rs b/bridges/modules/messages/src/instant_payments.rs index 524a3765d6ad4924c56c6d6e55b117f03915e774..80bc32f294a6d01eb97a6ce3ad68bebdeb0d9c8d 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 ed57baaf6e4fa6d167cfe6e76b09d7824e8ce2f7..842c28bd4b7d38fc2fd9bb7d189663e2cb2018f2 100644 --- a/bridges/modules/messages/src/lib.rs +++ b/bridges/modules/messages/src/lib.rs @@ -86,7 +86,7 @@ mod mock; pub trait Config<I = DefaultInstance>: frame_system::Config { // General types - /// They overarching event type. + /// They are overarching event type. type Event: From<Event<Self, I>> + Into<<Self as frame_system::Config>::Event>; /// Benchmarks results from runtime we're plugged into. type WeightInfo: WeightInfoExt; @@ -786,22 +786,22 @@ impl<T: Config<I>, I: Instance> Pallet<T, I> { OutboundMessages::<T, I>::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::<I>::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::<I>::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::<T, I>::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::<T, I>::get(&lane).last_confirmed_nonce } diff --git a/bridges/modules/messages/src/mock.rs b/bridges/modules/messages/src/mock.rs index 063bbfaa5aea7115b5b4d08efb12ccfde4dd4942..f2a42ab55e49f2230ddc4932b85f1977d5ed16b2 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 7130bd1bb53d2ff0b961090867a54ea7897e9248..5888fa7fd7f85812155330a96f492e574da31715 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 e1b8c7e885362f80ef352c8e19977304b4277c13..b17be922f5dbb33f2f2171449e450ae8ca6972ee 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 d0e9e3acd503aededbbff4b5066bb202c7cad513..e5ab47259e54c2fe31d6d0441fabf49460037f1a 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 0efc54e96e6ad8532f99e067e75f3ed45bb5bef4..d9f4fd51f9696e9f506055fac521d5d30825c231 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 = <BlakeTwoAndKeccak256 as HasherT>::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 7ab1c7f4390b733adc38330912e3426571b48e41..b0ba77c66ffc34cc7dbb9fd5534832e74cce5c23 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 4fe05547b530bb310419442b7e56d83cad9fe49a..10eac7deb8f547d86af372b951f4e4b74e2b0cb6 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 = <BlakeTwo256 as HasherT>::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 8df064e891833fbdd0eb337b6ca3c404afd3cb2c..d76ec8e679d3104a25e27518c82eeb28b8020aa4 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 a0895da259d4e1404321c88fa5877177bcaa53f1..4f8b9cccf4c75520bdba0dd7aff7c8253ba7ae0a 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 24572e141b20fb001179d676131cf1eb5089fb7d..e0d49ffe85506f98f1fbfbe5aa4aa486204007d8 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 88695dbb5ef406cedd997fe434aa8f5e39befb35..c85a9d4ff7d2b2f200594f39bdadbac7169efce0 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 382e6f81ee5d35b900f75801b689722a38f1f27e..b2e00760c01d6618fd19cab0a752e00ff7ea5f99 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<u64>, 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 625d7762597a188d2badef33e45b93a40bffc0bd..760369fe0d87072cf15425a0f90a86495f585400 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: HeaderT> { /// Header hash => parent header hash mapping. pub parents: BTreeMap<Header::Hash, Header::Hash>, - /// 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<Header::Hash>, } diff --git a/bridges/primitives/message-dispatch/src/lib.rs b/bridges/primitives/message-dispatch/src/lib.rs index 859dc5e469ad9a58397c367927046eddc4eb3d2a..65f9fc15dc2330fa44008382e2726a3c2c5ad025 100644 --- a/bridges/primitives/message-dispatch/src/lib.rs +++ b/bridges/primitives/message-dispatch/src/lib.rs @@ -77,7 +77,7 @@ pub enum CallOrigin<SourceChainAccountId, TargetChainAccountPublic, TargetChainS /// from a derived account. /// /// The derived account represents the source Root account on the target chain. This is useful - /// if the target chain needs some way of knowing that a call came from a priviledged origin on + /// if the target chain needs some way of knowing that a call came from a privileged origin on /// the source chain (maybe to allow a configuration change for example). SourceRoot, diff --git a/bridges/primitives/messages/src/lib.rs b/bridges/primitives/messages/src/lib.rs index 4ec7c1f9d2b006c2b099caa2dc36688843f58e1b..9e1de98a9f6f93f4f659539413b70da31b254def 100644 --- a/bridges/primitives/messages/src/lib.rs +++ b/bridges/primitives/messages/src/lib.rs @@ -113,7 +113,7 @@ pub struct InboundLaneData<RelayerId> { /// 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<RelayerId> Default for InboundLaneData<RelayerId> { } impl<RelayerId> InboundLaneData<RelayerId> { - /// 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 ed69f39c7630fb1ff8ee95623150ff6136f50988..a1ec0f19b4ffeb3abf08abc7987573b349906e86 100644 --- a/bridges/primitives/messages/src/source_chain.rs +++ b/bridges/primitives/messages/src/source_chain.rs @@ -56,14 +56,14 @@ pub trait TargetHeaderChain<Payload, AccountId> { /// /// 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<AccountId>), Self::Error>; @@ -102,7 +102,7 @@ pub trait LaneMessageVerifier<Submitter, Payload, Fee> { /// 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<AccountId, Balance> { /// Error type. diff --git a/bridges/primitives/messages/src/target_chain.rs b/bridges/primitives/messages/src/target_chain.rs index d1b87fd02323a4f2db30240cef517d2e4b5fa5da..38ce9e800da43f9bc20f5f3408f99b192d97d568 100644 --- a/bridges/primitives/messages/src/target_chain.rs +++ b/bridges/primitives/messages/src/target_chain.rs @@ -75,7 +75,7 @@ pub trait SourceHeaderChain<Fee> { /// 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 a1619b27bcf4717bdae0a930a5a8a04633c30954..4744e29492714ae892789e59023ef167a5f44cf4 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<sp_core::H256, AccountId> 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::<Runtime>::storage_map_final_key(&account_id);` pub fn account_info_storage_key(id: &AccountId) -> Vec<u8> { diff --git a/bridges/primitives/runtime/src/lib.rs b/bridges/primitives/runtime/src/lib.rs index 7b17a2947fce9a9e3f4909939fdebe88992e7410..ed915b72886404094eab00948310b9c4abf32207 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<T> { - /// 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<T> { /// 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 f6e04619c7230fe17b6886e9ab56d126420a932b..1b00c10fa4930945300c2605d072f0f4fe839ce4 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 64109754086cf6cfd710afb68f666d098d436678..83aac614ab8096f7c1cbeffe3f920cb803bf2357 100644 --- a/bridges/primitives/test-utils/src/lib.rs +++ b/bridges/primitives/test-utils/src/lib.rs @@ -49,7 +49,7 @@ pub struct JustificationGeneratorParams<H> { 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 71a3f38859b78996c49e4158730a0dd322452fb6..007bef49fea07908d8c3af3b9a09e2386340376a 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<T> = std::result::Result<T, RpcError>; /// 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<RialtoHeaderId>; /// 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 1ec1e7df7940347bc8efae55fc0ebe500028629f..311bc9edbc706a060d60ef7a6497c47cc7b4fb5c 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<T> = std::result::Result<T, RpcError>; /// 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<EthereumHeaderId>; /// Returns best finalized Ethereum block that Substrate runtime knows of. async fn best_ethereum_finalized_block(&self) -> RpcResult<EthereumHeaderId>; - /// 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<bool>; - /// 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<bool>; } diff --git a/bridges/relays/bin-substrate/src/chains/rococo.rs b/bridges/relays/bin-substrate/src/chains/rococo.rs index ec94450a63de5f3acefe85f89af7d52ffa407998..ec34d9cd33fc7b5bb93957e64bf0b17239c4d2be 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 f1967df8c74527fff341916952bff46b7c59b479..1903d42c1fcb0835390e5c155001a794d1af1201 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 a2d8a422b5dcf725a09a6ef804cb75311091ecc9..d002ab28f4996cb8655ba94730cbf418e0cad0e7 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 1ff39ede5cea68d8304c858d73e62c3227e8ac17..647978e430a81f8e4ab2fcc27098e2f32f045140 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 3088b06eb05ed3a9a83db0556a91abdbe62f20a1..d108c71f7b44d06f93a06cbe37b7f1ad3b1443ac 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 2834474579644d95a23a58c60d94b1c22fecabaf..6259c85b50ce4c413155d5ef450bb5457a8f7c5a 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 19fa0917df3904448aa014c0918cd1cb71bb9088..2013ec646b252107fbd3d90e99b9ce0ff568a7cb 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 1920137f140dc0d13da5b8ccc21a8cd0ba86088e..cea43058d8ed5dcf53c38a084f05e1a12c26ebe9 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 58ef268a29f780df195ca23584ce37b71fe38971..4a2b04328b8624a47e9cc515832e0c53d8ddab2b 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<SourceChain, TargetChain, TargetSign>( } } -/// 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<C: Chain>( best_finalized_source_header_at_source: Option<C::BlockNumber>, diff --git a/bridges/relays/client-ethereum/src/sign.rs b/bridges/relays/client-ethereum/src/sign.rs index 6f479ab7d5cd4c8d4984593e5047e0c444326dda..da1dbc4842e4a86028bdf9b78812d6b7f187d4d9 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 6dbd40bee56086fff1cd102fd251223c51ab3945..77d10529bf2d65e2a27a9c257ce0072605f96d14 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 63432c9701fc32f1a79d9315191484c2256dea07..03cbaef2d81afe3437884e2d7b92e5e3063b4a11 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 7449dda100f616c8bfc095f2912338a3140187a2..8164501348f475ee2447c88f3f925210b31383c8 100644 --- a/bridges/relays/client-substrate/src/client.rs +++ b/bridges/relays/client-substrate/src/client.rs @@ -85,7 +85,7 @@ impl<C: Chain> std::fmt::Debug for Client<C> { impl<C: Chain> Client<C> { /// 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<C: Chain> Client<C> { /// 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<C::Index> { self.jsonrpsee_execute(move |client| async move { Ok(Substrate::<C>::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 e7159bf27109e6cc635afd4edda79b2b38552b8b..37a7c2aa275c5b62e265cae7229566e776475a5b 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<C: ChainWithBalances>(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<C: ChainWithBalances>( mut env: impl Environment<C>, diff --git a/bridges/relays/client-wococo/src/runtime.rs b/bridges/relays/client-wococo/src/runtime.rs index e973c3a6d028055e5767b8987e07664d26b3be88..e3e7ce7b31dd65aa5f45fbdafc6b2bef9e607658 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 0b948d9da4cc6e0bc6ae89cb133dd410e513aec5..b9095e1931099711baa84d90f78e631d42af0cc2 100644 --- a/bridges/relays/headers/src/headers.rs +++ b/bridges/relays/headers/src/headers.rs @@ -65,7 +65,7 @@ pub struct QueuedHeaders<P: HeadersSyncPipeline> { /// Headers that are (we believe) currently submitted to target node by our, /// not-yet mined transactions. submitted: HeadersQueue<P>, - /// 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<P>, /// Pointers to all headers that we ever seen and we believe we can touch in the future. @@ -191,7 +191,7 @@ impl<P: HeadersSyncPipeline> QueuedHeaders<P> { .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<P>> { match status { HeaderStatus::Unknown | HeaderStatus::Synced => None, @@ -205,7 +205,7 @@ impl<P: HeadersSyncPipeline> QueuedHeaders<P> { } } - /// 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<P: HeadersSyncPipeline> QueuedHeaders<P> { ); } - /// 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<P>) { self.header_synced(id) } @@ -453,7 +453,7 @@ impl<P: HeadersSyncPipeline> QueuedHeaders<P> { } } - /// 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<HeaderIdOf<P>>) { // 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 e992b1f8e583c14a109a240da8c3c7dc676d6192..cd5ab0906fd541abedf790b3ef696e3a7dab27be 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<P: HeadersSyncPipeline> { /// Synchronization parameters. params: HeadersSyncParams, - /// Best header number known to source node. + /// The best header number known to source node. source_best_number: Option<P::Number>, - /// Best header known to target node. + /// The best header known to target node. target_best_header: Option<HeaderIdOf<P>>, /// Headers queue. headers: QueuedHeaders<P>, @@ -85,7 +85,7 @@ impl<P: HeadersSyncPipeline> HeadersSync<P> { self.source_best_number } - /// Best header known to target node. + /// The best header known to target node. pub fn target_best_header(&self) -> Option<HeaderIdOf<P>> { self.target_best_header } @@ -150,7 +150,7 @@ impl<P: HeadersSyncPipeline> HeadersSync<P> { 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<P>> { 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 5ccec4bbab5551b39445a41b7c9cb8037b36fbee..c373f41520070d8bb61be46e7dde76ccb149752d 100644 --- a/bridges/relays/headers/src/sync_loop.rs +++ b/bridges/relays/headers/src/sync_loop.rs @@ -80,7 +80,7 @@ pub trait SourceClient<P: HeadersSyncPipeline>: RelayClient { /// Target client trait. #[async_trait] pub trait TargetClient<P: HeadersSyncPipeline>: 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<HeaderIdOf<P>, 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 5809ebab59e1c47b1b9e8a02c690ee3523bc3521..f6c36758b8d106358820de81077eae73a17a44eb 100644 --- a/bridges/relays/headers/src/sync_types.rs +++ b/bridges/relays/headers/src/sync_types.rs @@ -156,8 +156,8 @@ pub struct SubmittedHeaders<Id, Error> { /// IDs of incomplete headers. These headers were submitted (so this id is also in `submitted` vec), /// but all descendants are not. pub incomplete: Vec<Id>, - /// 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<Id>, /// Fatal target node error, if it has occured during submission. pub fatal_error: Option<Error>, diff --git a/bridges/relays/messages/src/lib.rs b/bridges/relays/messages/src/lib.rs index cdd94bca9541260a4705256f67e9ff4c65fda873..861091ab20506e4aee68572d60241f8c05f34b6b 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 282c3bc8b6b85d3afa47ff93bddac216bb5066b2..84b0c72408dfa691548088685e52a787e6a7a4f6 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<P: MessageLane>: RelayClient { id: TargetHeaderIdOf<P>, ) -> Result<(TargetHeaderIdOf<P>, 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<P>, @@ -218,7 +218,7 @@ pub trait TargetClient<P: MessageLane>: RelayClient { /// State of the client. #[derive(Clone, Debug, Default, PartialEq)] pub struct ClientState<SelfHeaderId, PeerHeaderId> { - /// 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 260a72f3f0c72c755cae5ed1ff808239ee07bfb9..2e94bbee8b1c455daee1d2db02a1446f3277ef75 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 3b427a2d0e27f28102b27197e35310f26731e284..399f8719804979e2092996258aa2ca497006390b 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<NoncesRange> { /// 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<MessageNonce>, } @@ -84,7 +84,7 @@ pub struct SourceClientNonces<NoncesRange> { /// Nonces on the race target client. #[derive(Debug, Clone)] pub struct TargetClientNonces<TargetNoncesData> { - /// 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<TargetNoncesData> { /// One of message lane clients, which is source client for the race. #[async_trait] pub trait SourceClient<P: MessageRace> { - /// 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<P: MessageRace> { /// One of message lane clients, which is target client for the race. #[async_trait] pub trait TargetClient<P: MessageRace> { - /// 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<SourceHeaderId, TargetHeaderId, Proof>: 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<SourceHeaderId>; - /// 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<MessageNonce>; - /// 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<MessageNonce>; @@ -197,7 +197,7 @@ pub struct RaceState<SourceHeaderId, TargetHeaderId, Proof> { /// 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<SourceHeaderId>, - /// Best header id at the target client. + /// The best header id at the target client. pub best_target_header_id: Option<TargetHeaderId>, /// Best finalized header id at the target client. pub best_finalized_target_header_id: Option<TargetHeaderId>, diff --git a/bridges/relays/messages/src/message_race_receiving.rs b/bridges/relays/messages/src/message_race_receiving.rs index 4381b63591f718b8fe8301443bffff153a23232e..f9ac61352fbd1723c511dc8392f6adbcdd898a2c 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 ed4a276e1429dc32277f9bb3af05e7eb2df6ce25..bc04ad5bcd9bccaeb652f3d7aba78b87ecd7925e 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<SourceHeaderHash, SourceHeaderNumber, SourceNoncesRange>, - /// 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<MessageNonce>, /// 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 51a4118be8582a5a692e6563b14d903e99b678dd..8f115170523b4be3f510f33f6f3ae730a14301e3 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<P: MessageLane>(&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<P: MessageLane>(&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<P: MessageLane>(&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 ea9d62752110ee4f064236653307c8c872ce5f52..38b636a599c2492fb7c96558543189fe51e5e869 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.