mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 05:51:02 +00:00
WIP: CI: add spellcheck (#3421)
* CI: add spellcheck * revert me * CI: explicit command for spellchecker * spellcheck: edit misspells * CI: run spellcheck on diff * spellcheck: edits * spellcheck: edit misspells * spellcheck: add rules * spellcheck: mv configs * spellcheck: more edits * spellcheck: chore * spellcheck: one more thing * spellcheck: and another one * spellcheck: seems like it doesn't get to an end * spellcheck: new words after rebase * spellcheck: new words appearing out of nowhere * chore * review edits * more review edits * more edits * wonky behavior * wonky behavior 2 * wonky behavior 3 * change git behavior * spellcheck: another bunch of new edits * spellcheck: new words are koming out of nowhere * CI: finding the master * CI: fetching master implicitly * CI: undebug * new errors * a bunch of new edits * and some more * Update node/core/approval-voting/src/approval_db/v1/mod.rs Co-authored-by: Andronik Ordian <write@reusable.software> * Update xcm/xcm-executor/src/assets.rs Co-authored-by: Andronik Ordian <write@reusable.software> * Apply suggestions from code review Co-authored-by: Andronik Ordian <write@reusable.software> * Suggestions from the code review * CI: scan only changed files Co-authored-by: Andronik Ordian <write@reusable.software>
This commit is contained in:
@@ -146,7 +146,7 @@ pub struct HostConfiguration<BlockNumber> {
|
||||
///
|
||||
/// `None` means no maximum.
|
||||
pub max_validators_per_core: Option<u32>,
|
||||
/// The maximum number of valdiators to use for parachain consensus, period.
|
||||
/// The maximum number of validators to use for parachain consensus, period.
|
||||
///
|
||||
/// `None` means no maximum.
|
||||
pub max_validators: Option<u32>,
|
||||
@@ -170,7 +170,7 @@ pub struct HostConfiguration<BlockNumber> {
|
||||
pub zeroth_delay_tranche_width: u32,
|
||||
/// The number of validators needed to approve a block.
|
||||
pub needed_approvals: u32,
|
||||
/// The number of samples to do of the RelayVRFModulo approval assignment criterion.
|
||||
/// The number of samples to do of the `RelayVRFModulo` approval assignment criterion.
|
||||
pub relay_vrf_modulo_samples: u32,
|
||||
}
|
||||
|
||||
@@ -527,7 +527,7 @@ decl_module! {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Set the number of samples to do of the RelayVRFModulo approval assignment criterion.
|
||||
/// Set the number of samples to do of the `RelayVRFModulo` approval assignment criterion.
|
||||
#[weight = (1_000, DispatchClass::Operational)]
|
||||
pub fn set_relay_vrf_modulo_samples(origin, new: u32) -> DispatchResult {
|
||||
ensure_root(origin)?;
|
||||
|
||||
@@ -242,7 +242,7 @@ decl_storage! {
|
||||
HrmpOpenChannelRequests: map hasher(twox_64_concat) HrmpChannelId => Option<HrmpOpenChannelRequest>;
|
||||
HrmpOpenChannelRequestsList: Vec<HrmpChannelId>;
|
||||
|
||||
/// This mapping tracks how many open channel requests are inititated by a given sender para.
|
||||
/// This mapping tracks how many open channel requests are initiated by a given sender para.
|
||||
/// Invariant: `HrmpOpenChannelRequests` should contain the same number of items that has `(X, _)`
|
||||
/// as the number of `HrmpOpenChannelRequestCount` for `X`.
|
||||
HrmpOpenChannelRequestCount: map hasher(twox_64_concat) ParaId => u32;
|
||||
@@ -291,7 +291,7 @@ decl_storage! {
|
||||
/// Invariant: cannot be non-empty if the corresponding channel in `HrmpChannels` is `None`.
|
||||
HrmpChannelContents: map hasher(twox_64_concat) HrmpChannelId => Vec<InboundHrmpMessage<T::BlockNumber>>;
|
||||
/// Maintains a mapping that can be used to answer the question:
|
||||
/// What paras sent a message at the given block number for a given reciever.
|
||||
/// What paras sent a message at the given block number for a given receiver.
|
||||
/// Invariants:
|
||||
/// - The inner `Vec<ParaId>` is never empty.
|
||||
/// - The inner `Vec<ParaId>` cannot store two same `ParaId`.
|
||||
@@ -384,11 +384,11 @@ decl_error! {
|
||||
decl_event! {
|
||||
pub enum Event {
|
||||
/// Open HRMP channel requested.
|
||||
/// \[sender, recipient, proposed_max_capacity, proposed_max_message_size\]
|
||||
/// `[sender, recipient, proposed_max_capacity, proposed_max_message_size]`
|
||||
OpenChannelRequested(ParaId, ParaId, u32, u32),
|
||||
/// Open HRMP channel accepted. \[sender, recipient\]
|
||||
/// Open HRMP channel accepted. `[sender, recipient]`
|
||||
OpenChannelAccepted(ParaId, ParaId),
|
||||
/// HRMP channel closed. \[by_parachain, channel_id\]
|
||||
/// HRMP channel closed. `[by_parachain, channel_id]`
|
||||
ChannelClosed(ParaId, HrmpChannelId),
|
||||
}
|
||||
}
|
||||
@@ -468,7 +468,7 @@ decl_module! {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Force process hrmp open channel requests.
|
||||
/// Force process HRMP open channel requests.
|
||||
///
|
||||
/// If there are pending HRMP open channel requests, you can use this
|
||||
/// function process all of those requests immediately.
|
||||
@@ -480,7 +480,7 @@ decl_module! {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Force process hrmp close channel requests.
|
||||
/// Force process HRMP close channel requests.
|
||||
///
|
||||
/// If there are pending HRMP close channel requests, you can use this
|
||||
/// function process all of those requests immediately.
|
||||
@@ -667,7 +667,7 @@ impl<T: Config> Module<T> {
|
||||
///
|
||||
/// This includes returning the deposits.
|
||||
///
|
||||
/// This function is indempotent, meaning that after the first application it should have no
|
||||
/// This function is idempotent, meaning that after the first application it should have no
|
||||
/// effect (i.e. it won't return the deposits twice).
|
||||
fn close_hrmp_channel(channel_id: &HrmpChannelId) {
|
||||
if let Some(HrmpChannel {
|
||||
|
||||
@@ -92,7 +92,7 @@ impl<H, N> CandidatePendingAvailability<H, N> {
|
||||
self.hash
|
||||
}
|
||||
|
||||
/// Get the canddiate descriptor.
|
||||
/// Get the candidate descriptor.
|
||||
pub(crate) fn candidate_descriptor(&self) -> &CandidateDescriptor<H> {
|
||||
&self.descriptor
|
||||
}
|
||||
@@ -131,7 +131,7 @@ decl_storage! {
|
||||
PendingAvailability: map hasher(twox_64_concat) ParaId
|
||||
=> Option<CandidatePendingAvailability<T::Hash, T::BlockNumber>>;
|
||||
|
||||
/// The commitments of candidates pending availability, by ParaId.
|
||||
/// The commitments of candidates pending availability, by `ParaId`.
|
||||
PendingAvailabilityCommitments: map hasher(twox_64_concat) ParaId
|
||||
=> Option<CandidateCommitments>;
|
||||
}
|
||||
@@ -192,11 +192,11 @@ decl_error! {
|
||||
|
||||
decl_event! {
|
||||
pub enum Event<T> where <T as frame_system::Config>::Hash {
|
||||
/// A candidate was backed. [candidate, head_data]
|
||||
/// A candidate was backed. `[candidate, head_data]`
|
||||
CandidateBacked(CandidateReceipt<Hash>, HeadData, CoreIndex, GroupIndex),
|
||||
/// A candidate was included. [candidate, head_data]
|
||||
/// A candidate was included. `[candidate, head_data]`
|
||||
CandidateIncluded(CandidateReceipt<Hash>, HeadData, CoreIndex, GroupIndex),
|
||||
/// A candidate timed out. [candidate, head_data]
|
||||
/// A candidate timed out. `[candidate, head_data]`
|
||||
CandidateTimedOut(CandidateReceipt<Hash>, HeadData, CoreIndex),
|
||||
}
|
||||
}
|
||||
@@ -232,7 +232,7 @@ impl<T: Config> Module<T> {
|
||||
for _ in <AvailabilityBitfields<T>>::drain() { }
|
||||
}
|
||||
|
||||
/// Process a set of incoming bitfields. Return a vec of cores freed by candidates
|
||||
/// Process a set of incoming bitfields. Return a `vec` of cores freed by candidates
|
||||
/// becoming available.
|
||||
pub(crate) fn process_bitfields(
|
||||
expected_bits: usize,
|
||||
@@ -781,7 +781,7 @@ impl<T: Config> Module<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the CommittedCandidateReceipt pending availability for the para provided, if any.
|
||||
/// Returns the `CommittedCandidateReceipt` pending availability for the para provided, if any.
|
||||
pub(crate) fn candidate_pending_availability(para: ParaId)
|
||||
-> Option<CommittedCandidateReceipt<T::Hash>>
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ pub use pallet::*;
|
||||
pub struct SessionChangeNotification<BlockNumber> {
|
||||
/// The new validators in the session.
|
||||
pub validators: Vec<ValidatorId>,
|
||||
/// The qeueud validators for the following session.
|
||||
/// The queued validators for the following session.
|
||||
pub queued: Vec<ValidatorId>,
|
||||
/// The configuration before handling the session change
|
||||
pub prev_config: HostConfiguration<BlockNumber>,
|
||||
@@ -99,10 +99,10 @@ pub mod pallet {
|
||||
|
||||
/// Whether the parachains modules have been initialized within this block.
|
||||
///
|
||||
/// Semantically a bool, but this guarantees it should never hit the trie,
|
||||
/// Semantically a `bool`, but this guarantees it should never hit the trie,
|
||||
/// as this is cleared in `on_finalize` and Frame optimizes `None` values to be empty values.
|
||||
///
|
||||
/// As a bool, `set(false)` and `remove()` both lead to the next `get()` being false, but one of
|
||||
/// As a `bool`, `set(false)` and `remove()` both lead to the next `get()` being false, but one of
|
||||
/// them writes to the trie and one does not. This confusion makes `Option<()>` more suitable for
|
||||
/// the semantics of this variable.
|
||||
#[pallet::storage]
|
||||
|
||||
@@ -287,15 +287,15 @@ pub mod pallet {
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event {
|
||||
/// Current code has been updated for a Para. \[para_id\]
|
||||
/// Current code has been updated for a Para. `para_id`
|
||||
CurrentCodeUpdated(ParaId),
|
||||
/// Current head has been updated for a Para. \[para_id\]
|
||||
/// Current head has been updated for a Para. `para_id`
|
||||
CurrentHeadUpdated(ParaId),
|
||||
/// A code upgrade has been scheduled for a Para. \[para_id\]
|
||||
/// A code upgrade has been scheduled for a Para. `para_id`
|
||||
CodeUpgradeScheduled(ParaId),
|
||||
/// A new head has been noted for a Para. \[para_id\]
|
||||
/// A new head has been noted for a Para. `para_id`
|
||||
NewHeadNoted(ParaId),
|
||||
/// A para has been queued to execute pending actions. \[para_id\]
|
||||
/// A para has been queued to execute pending actions. `para_id`
|
||||
ActionQueued(ParaId, SessionIndex),
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ pub mod pallet {
|
||||
CannotDowngrade,
|
||||
}
|
||||
|
||||
/// All parachains. Ordered ascending by ParaId. Parathreads are not included.
|
||||
/// All parachains. Ordered ascending by `ParaId`. Parathreads are not included.
|
||||
#[pallet::storage]
|
||||
#[pallet::getter(fn parachains)]
|
||||
pub(super) type Parachains<T: Config> = StorageValue<_, Vec<ParaId>, ValueQuery>;
|
||||
@@ -1443,7 +1443,7 @@ mod tests {
|
||||
|
||||
run_to_block(expected_at + 1 + 4, None);
|
||||
|
||||
// the candidate is in the context of the first descendent of `expected_at`, and triggers
|
||||
// the candidate is in the context of the first descendant of `expected_at`, and triggers
|
||||
// the upgrade.
|
||||
{
|
||||
Paras::note_new_head(para_id, Default::default(), expected_at + 4);
|
||||
|
||||
@@ -53,7 +53,7 @@ decl_storage! {
|
||||
trait Store for Module<T: Config> as ParaInherent {
|
||||
/// Whether the paras inherent was included within this block.
|
||||
///
|
||||
/// The `Option<()>` is effectively a bool, but it never hits storage in the `None` variant
|
||||
/// The `Option<()>` is effectively a `bool`, but it never hits storage in the `None` variant
|
||||
/// due to the guarantees of FRAME's storage APIs.
|
||||
///
|
||||
/// If this is `None` at the end of the block, we panic and render the block invalid.
|
||||
|
||||
@@ -236,7 +236,7 @@ pub fn session_index_for_child<T: initializer::Config>() -> SessionIndex {
|
||||
|
||||
/// Implementation for the `AuthorityDiscoveryApi::authorities()` function of the runtime API.
|
||||
/// It is a heavy call, but currently only used for authority discovery, so it is fine.
|
||||
/// Gets next, current and some historical authority ids using session_info module.
|
||||
/// Gets next, current and some historical authority ids using `session_info` module.
|
||||
pub fn relevant_authority_ids<T: initializer::Config + pallet_authority_discovery::Config>() -> Vec<AuthorityDiscoveryId> {
|
||||
let current_session_index = session_index_for_child::<T>();
|
||||
let earliest_stored_session = <session_info::Module<T>>::earliest_stored_session();
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! The scheduler module for parachains and parathreads.
|
||||
//!
|
||||
//! This module is responsible for two main tasks:
|
||||
//! - Paritioning validators into groups and assigning groups to parachains and parathreads
|
||||
//! - Partitioning validators into groups and assigning groups to parachains and parathreads
|
||||
//! - Scheduling parachains and parathreads
|
||||
//!
|
||||
//! It aims to achieve these tasks with these goals in mind:
|
||||
@@ -183,7 +183,7 @@ decl_storage! {
|
||||
ParathreadClaimIndex: Vec<ParaId>;
|
||||
/// The block number where the session start occurred. Used to track how many group rotations have occurred.
|
||||
///
|
||||
/// Note that in the context of parachains modules the session change is signalled during
|
||||
/// Note that in the context of parachains modules the session change is signaled during
|
||||
/// the block and enacted at the end of the block (at the finalization stage, to be exact).
|
||||
/// Thus for all intents and purposes the effect of the session change is observed at the
|
||||
/// block following the session change, block number of which we save in this storage value.
|
||||
@@ -644,7 +644,7 @@ impl<T: Config> Module<T> {
|
||||
/// occupied and the candidate occupying it became available.
|
||||
///
|
||||
/// For parachains, this is always the ID of the parachain and no specified collator.
|
||||
/// For parathreads, this is based on the next item in the ParathreadQueue assigned to that
|
||||
/// For parathreads, this is based on the next item in the `ParathreadQueue` assigned to that
|
||||
/// core, and is None if there isn't one.
|
||||
pub(crate) fn next_up_on_available(core: CoreIndex) -> Option<ScheduledCore> {
|
||||
let parachains = <paras::Pallet<T>>::parachains();
|
||||
@@ -667,7 +667,7 @@ impl<T: Config> Module<T> {
|
||||
/// occupied and the candidate occupying it became available.
|
||||
///
|
||||
/// For parachains, this is always the ID of the parachain and no specified collator.
|
||||
/// For parathreads, this is based on the next item in the ParathreadQueue assigned to that
|
||||
/// For parathreads, this is based on the next item in the `ParathreadQueue` assigned to that
|
||||
/// core, or if there isn't one, the claim that is currently occupying the core, as long
|
||||
/// as the claim's retries would not exceed the limit. Otherwise None.
|
||||
pub(crate) fn next_up_on_time_out(core: CoreIndex) -> Option<ScheduledCore> {
|
||||
|
||||
@@ -59,7 +59,7 @@ impl UmpSink for () {
|
||||
/// if the message content is unique.
|
||||
pub type MessageId = [u8; 32];
|
||||
|
||||
/// A specific implementation of a UmpSink where messages are in the XCM format
|
||||
/// A specific implementation of a `UmpSink` where messages are in the XCM format
|
||||
/// and will be forwarded to the XCM Executor.
|
||||
pub struct XcmSink<XcmExecutor, Config>(PhantomData<(XcmExecutor, Config)>);
|
||||
|
||||
@@ -181,7 +181,7 @@ decl_storage! {
|
||||
/// First item in the tuple is the count of messages and second
|
||||
/// is the total length (in bytes) of the message payloads.
|
||||
///
|
||||
/// Note that this is an auxilary mapping: it's possible to tell the byte size and the number of
|
||||
/// Note that this is an auxiliary mapping: it's possible to tell the byte size and the number of
|
||||
/// messages only looking at `RelayDispatchQueues`. This mapping is separate to avoid the cost of
|
||||
/// loading the whole message queue if only the total size and count are required.
|
||||
///
|
||||
@@ -430,7 +430,7 @@ impl<T: Config> Module<T> {
|
||||
/// thus increasing the peak memory consumption of the wasm runtime. Under such conditions persisting
|
||||
/// queues might play better since it's unlikely that they are going to be requested once more.
|
||||
///
|
||||
/// On the other hand, the situation when deep queues exist and it takes more than one dipsatcher
|
||||
/// On the other hand, the situation when deep queues exist and it takes more than one dispatcher
|
||||
/// cycle to traverse the queues is already sub-optimal and better be avoided.
|
||||
///
|
||||
/// This struct is not supposed to be dropped but rather to be consumed by [`flush`].
|
||||
|
||||
Reference in New Issue
Block a user