Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
Browse files Browse the repository at this point in the history
…ation-2
  • Loading branch information
niklasad1 committed Nov 22, 2021
2 parents 44a3e3d + c0da7c3 commit 7034e6e
Show file tree
Hide file tree
Showing 49 changed files with 79 additions and 73 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bin/node/bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sc-client-api = { version = "4.0.0-dev", path = "../../../client/api/" }
sp-runtime = { version = "4.0.0-dev", path = "../../../primitives/runtime" }
sp-state-machine = { version = "0.10.0-dev", path = "../../../primitives/state-machine" }
serde = "1.0.126"
serde_json = "1.0.68"
serde_json = "1.0.71"
structopt = "0.3"
derive_more = "0.99.16"
kvdb = "0.10.0"
Expand Down
2 changes: 1 addition & 1 deletion bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ assert_cmd = "2.0.2"
nix = "0.23"
serde_json = "1.0"
regex = "1"
platforms = "1.1"
platforms = "2.0"
async-std = { version = "1.10.0", features = ["attributes"] }
soketto = "0.4.2"
criterion = { version = "0.3.5", features = [ "async_tokio" ] }
Expand Down
2 changes: 1 addition & 1 deletion client/chain-spec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl-trait-for-tuples = "0.2.1"
sc-network = { version = "0.10.0-dev", path = "../network" }
sp-core = { version = "4.0.0-dev", path = "../../primitives/core" }
serde = { version = "1.0.126", features = ["derive"] }
serde_json = "1.0.68"
serde_json = "1.0.71"
sp-runtime = { version = "4.0.0-dev", path = "../../primitives/runtime" }
sc-telemetry = { version = "4.0.0-dev", path = "../telemetry" }
codec = { package = "parity-scale-codec", version = "2.0.0" }
Expand Down
2 changes: 1 addition & 1 deletion client/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ parity-scale-codec = "2.3.1"
hex = "0.4.2"
rand = "0.7.3"
tiny-bip39 = "0.8.2"
serde_json = "1.0.68"
serde_json = "1.0.71"
sc-keystore = { version = "4.0.0-dev", path = "../keystore" }
sp-panic-handler = { version = "4.0.0-dev", path = "../../primitives/panic-handler" }
sc-client-api = { version = "4.0.0-dev", path = "../api" }
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/babe/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sp-keystore = { version = "0.10.0-dev", path = "../../../../primitives/keystore"

[dev-dependencies]
sc-consensus = { version = "0.10.0-dev", path = "../../../consensus/common" }
serde_json = "1.0.68"
serde_json = "1.0.71"
sp-keyring = { version = "4.0.0-dev", path = "../../../../primitives/keyring" }
sc-keystore = { version = "4.0.0-dev", path = "../../../keystore" }
substrate-test-runtime-client = { version = "2.0.0", path = "../../../../test-utils/runtime/client" }
Expand Down
4 changes: 2 additions & 2 deletions client/consensus/pow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
//! started via the [`start_mining_worker`] function. It returns a worker
//! handle together with a future. The future must be pulled. Through
//! the worker handle, you can pull the metadata needed to start the
//! mining process via [`MiningWorker::metadata`], and then do the actual
//! mining process via [`MiningHandle::metadata`], and then do the actual
//! mining on a standalone thread. Finally, when a seal is found, call
//! [`MiningWorker::submit`] to build the block.
//! [`MiningHandle::submit`] to build the block.
//!
//! The auxiliary storage for PoW engine only stores the total difficulty.
//! For other storage requirements for particular PoW algorithm (such as
Expand Down
8 changes: 4 additions & 4 deletions client/executor/wasmtime/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,11 @@ pub struct Config {
/// The total amount of memory in bytes an instance can request.
///
/// If specified, the runtime will be able to allocate only that much of wasm memory.
/// This is the total number and therefore the [`heap_pages`] is accounted for.
/// This is the total number and therefore the [`Config::heap_pages`] is accounted for.
///
/// That means that the initial number of pages of a linear memory plus the [`heap_pages`]
/// multiplied by the wasm page size (64KiB) should be less than or equal to `max_memory_size`,
/// otherwise the instance won't be created.
/// That means that the initial number of pages of a linear memory plus the
/// [`Config::heap_pages`] multiplied by the wasm page size (64KiB) should be less than or
/// equal to `max_memory_size`, otherwise the instance won't be created.
///
/// Moreover, `memory.grow` will fail (return -1) if the sum of sizes of currently mounted
/// and additional pages exceeds `max_memory_size`.
Expand Down
2 changes: 1 addition & 1 deletion client/finality-grandpa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sp-keystore = { version = "0.10.0-dev", path = "../../primitives/keystore" }
sp-api = { version = "4.0.0-dev", path = "../../primitives/api" }
sc-telemetry = { version = "4.0.0-dev", path = "../telemetry" }
sc-keystore = { version = "4.0.0-dev", path = "../keystore" }
serde_json = "1.0.68"
serde_json = "1.0.71"
sc-client-api = { version = "4.0.0-dev", path = "../api" }
sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" }
sc-network = { version = "0.10.0-dev", path = "../network" }
Expand Down
2 changes: 1 addition & 1 deletion client/keystore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sp-core = { version = "4.0.0-dev", path = "../../primitives/core" }
sp-keystore = { version = "0.10.0-dev", path = "../../primitives/keystore" }
hex = "0.4.0"
parking_lot = "0.11.1"
serde_json = "1.0.68"
serde_json = "1.0.71"

[dev-dependencies]
tempfile = "3.1.0"
2 changes: 1 addition & 1 deletion client/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ sc-block-builder = { version = "0.10.0-dev", path = "../block-builder" }
sc-client-api = { version = "4.0.0-dev", path = "../api" }
sc-peerset = { version = "4.0.0-dev", path = "../peerset" }
serde = { version = "1.0.126", features = ["derive"] }
serde_json = "1.0.68"
serde_json = "1.0.71"
smallvec = "1.7.0"
sp-arithmetic = { version = "4.0.0-dev", path = "../../primitives/arithmetic" }
sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" }
Expand Down
2 changes: 1 addition & 1 deletion client/peerset/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ futures = "0.3.9"
libp2p = { version = "0.39.1", default-features = false }
sc-utils = { version = "4.0.0-dev", path = "../utils"}
log = "0.4.8"
serde_json = "1.0.68"
serde_json = "1.0.71"
wasm-timer = "0.2"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion client/rpc-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ sp-rpc = { version = "4.0.0-dev", path = "../../primitives/rpc" }
sp-tracing = { version = "4.0.0-dev", path = "../../primitives/tracing" }

serde = { version = "1.0.126", features = ["derive"] }
serde_json = "1.0.68"
serde_json = "1.0.71"
jsonrpsee = { git = "https:/paritytech/jsonrpsee", rev = "9a3c1e981bcdbbb558b1457bbd78277a14dca2da", features = ["server", "macros"] }
2 changes: 1 addition & 1 deletion client/rpc-servers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ anyhow = "1"
jsonrpsee = { git = "https:/paritytech/jsonrpsee", rev = "9a3c1e981bcdbbb558b1457bbd78277a14dca2da", features = ["server"] }
log = "0.4.8"
prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../utils/prometheus", version = "0.10.0-dev"}
serde_json = "1.0.68"
serde_json = "1.0.71"
tokio = { version = "1.14" }
2 changes: 1 addition & 1 deletion client/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ futures = "0.3.1"
log = "0.4.8"
sp-core = { version = "4.0.0-dev", path = "../../primitives/core" }
sp-version = { version = "4.0.0-dev", path = "../../primitives/version" }
serde_json = "1.0.68"
serde_json = "1.0.71"
sp-session = { version = "4.0.0-dev", path = "../../primitives/session" }
sp-offchain = { version = "4.0.0-dev", path = "../../primitives/offchain" }
sp-runtime = { version = "4.0.0-dev", path = "../../primitives/runtime" }
Expand Down
2 changes: 1 addition & 1 deletion client/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ exit-future = "0.2.0"
pin-project = "1.0.8"
hash-db = "0.15.2"
serde = "1.0.126"
serde_json = "1.0.68"
serde_json = "1.0.71"
sc-keystore = { version = "4.0.0-dev", path = "../keystore" }
sp-runtime = { version = "4.0.0-dev", path = "../../primitives/runtime" }
sp-trie = { version = "4.0.0-dev", path = "../../primitives/trie" }
Expand Down
2 changes: 1 addition & 1 deletion client/sync-state-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sc-consensus-babe = { version = "0.10.0-dev", path = "../consensus/babe" }
sc-consensus-epochs = { version = "0.10.0-dev", path = "../consensus/epochs" }
sc-finality-grandpa = { version = "0.10.0-dev", path = "../finality-grandpa" }
sc-rpc-api = { version = "0.10.0-dev", path = "../rpc-api" }
serde_json = "1.0.68"
serde_json = "1.0.71"
serde = { version = "1.0.126", features = ["derive"] }
sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" }
sp-runtime = { version = "4.0.0-dev", path = "../../primitives/runtime" }
Expand Down
2 changes: 1 addition & 1 deletion client/telemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ log = "0.4.8"
pin-project = "1.0.8"
rand = "0.7.2"
serde = { version = "1.0.126", features = ["derive"] }
serde_json = "1.0.68"
serde_json = "1.0.71"
chrono = "0.4.19"
thiserror = "1.0.30"
2 changes: 1 addition & 1 deletion client/telemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ enum Register {

/// Report a telemetry.
///
/// Translates to [`tracing::info`], but contains an additional verbosity parameter which the log
/// Translates to `tracing::info`, but contains an additional verbosity parameter which the log
/// record is tagged with. Additionally the verbosity parameter is added to the record as a
/// key-value pair.
///
Expand Down
11 changes: 6 additions & 5 deletions frame/bags-list/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
//!
//! A semi-sorted list, where items hold an `AccountId` based on some `VoteWeight`. The `AccountId`
//! (`id` for short) might be synonym to a `voter` or `nominator` in some context, and `VoteWeight`
//! signifies the chance of each id being included in the final [`VoteWeightProvider::iter`].
//! signifies the chance of each id being included in the final [`SortedListProvider::iter`].
//!
//! It implements [`sp_election_provider_support::SortedListProvider`] to provide a semi-sorted list
//! of accounts to another pallet. It needs some other pallet to give it some information about the
//! weights of accounts via [`sp_election_provider_support::VoteWeightProvider`].
//! It implements [`frame_election_provider_support::SortedListProvider`] to provide a semi-sorted
//! list of accounts to another pallet. It needs some other pallet to give it some information about
//! the weights of accounts via [`frame_election_provider_support::VoteWeightProvider`].
//!
//! This pallet is not configurable at genesis. Whoever uses it should call appropriate functions of
//! the `SortedListProvider` (e.g. `on_insert`, or `regenerate`) at their genesis.
Expand All @@ -38,7 +38,8 @@
//!
//! # Details
//!
//! - items are kept in bags, which are delineated by their range of weight (See [`BagThresholds`]).
//! - items are kept in bags, which are delineated by their range of weight (See
//! [`Config::BagThresholds`]).
//! - for iteration, bags are chained together from highest to lowest and elements within the bag
//! are iterated from head to tail.
//! - items within a bag are iterated in order of insertion. Thus removing an item and re-inserting
Expand Down
6 changes: 3 additions & 3 deletions frame/bags-list/src/list/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

//! Implementation of a "bags list": a semi-sorted list where ordering granularity is dictated by
//! configurable thresholds that delineate the boundaries of bags. It uses a pattern of composite
//! data structures, where multiple storage items are masked by one outer API. See [`ListNodes`],
//! [`ListBags`] for more information.
//! data structures, where multiple storage items are masked by one outer API. See
//! [`crate::ListNodes`], [`crate::ListBags`] for more information.
//!
//! The outer API of this module is the [`List`] struct. It wraps all acceptable operations on top
//! of the aggregate linked list. All operations with the bags list should happen through this
Expand Down Expand Up @@ -460,7 +460,7 @@ impl<T: Config> List<T> {
}
}

/// A Bag is a doubly-linked list of ids, where each id is mapped to a [`ListNode`].
/// A Bag is a doubly-linked list of ids, where each id is mapped to a [`Node`].
///
/// Note that we maintain both head and tail pointers. While it would be possible to get away with
/// maintaining only a head pointer and cons-ing elements onto the front of the list, it's more
Expand Down
5 changes: 3 additions & 2 deletions frame/beefy-mmr/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ pub type Hash = [u8; 32];
/// Generic hasher trait.
///
/// Implement the function to support custom way of hashing data.
/// The implementation must return a [Hash] type, so only 32-byte output hashes are supported.
/// The implementation must return a [Hash](type@Hash) type, so only 32-byte output hashes are
/// supported.
pub trait Hasher {
/// Hash given arbitrary-length piece of data.
fn hash(data: &[u8]) -> Hash;
Expand Down Expand Up @@ -173,7 +174,7 @@ impl Visitor for () {
///
/// # Panic
///
/// The function will panic if given [`leaf_index`] is greater than the number of leaves.
/// The function will panic if given `leaf_index` is greater than the number of leaves.
pub fn merkle_proof<H, I, T>(leaves: I, leaf_index: usize) -> MerkleProof<T>
where
H: Hasher,
Expand Down
2 changes: 1 addition & 1 deletion frame/beefy-mmr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub mod pallet {

/// Details of next BEEFY authority set.
///
/// This storage entry is used as cache for calls to [`update_beefy_next_authority_set`].
/// This storage entry is used as cache for calls to `update_beefy_next_authority_set`.
#[pallet::storage]
#[pallet::getter(fn beefy_next_authorities)]
pub type BeefyNextAuthorities<T: Config> =
Expand Down
6 changes: 3 additions & 3 deletions frame/benchmarking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1266,21 +1266,21 @@ macro_rules! impl_benchmark_test {
/// fn bench_accumulate_dummy() {
/// new_test_ext().execute_with(|| {
/// assert_ok!(test_benchmark_accumulate_dummy::<Test>());
/// }
/// })
/// }
///
/// #[test]
/// fn bench_set_dummy() {
/// new_test_ext().execute_with(|| {
/// assert_ok!(test_benchmark_set_dummy::<Test>());
/// }
/// })
/// }
///
/// #[test]
/// fn bench_sort_vector() {
/// new_test_ext().execute_with(|| {
/// assert_ok!(test_benchmark_sort_vector::<Test>());
/// }
/// })
/// }
/// }
/// ```
Expand Down
2 changes: 1 addition & 1 deletion frame/contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ pub mod pallet {
type Schedule: Get<Schedule<Self>>;

/// The deposit that must be placed into the contract's account to instantiate it.
/// This is in **addition** to the [`pallet_balances::Pallet::ExistenialDeposit`].
/// This is in **addition** to the [`Currency::minimum_balance`].
/// The minimum balance for a contract's account can be queried using
/// [`Pallet::subsistence_threshold`].
#[pallet::constant]
Expand Down
8 changes: 4 additions & 4 deletions frame/election-provider-multi-phase/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@
//! are helpful for logging and are thus nested as:
//! - [`ElectionError::Miner`]: wraps a [`unsigned::MinerError`].
//! - [`ElectionError::Feasibility`]: wraps a [`FeasibilityError`].
//! - [`ElectionError::OnChainFallback`]: wraps a
//! [`frame_election_provider_support::onchain::Error`].
//! - [`ElectionError::Fallback`]: wraps a fallback error.
//! - [`ElectionError::DataProvider`]: wraps a static str.
//!
//! Note that there could be an overlap between these sub-errors. For example, A
//! `SnapshotUnavailable` can happen in both miner and feasibility check phase.
Expand Down Expand Up @@ -1244,14 +1244,14 @@ impl<T: Config> Pallet<T> {
}
}

/// Logic for [`<Pallet as Hooks>::on_initialize`] when signed phase is being opened.
/// Logic for `<Pallet as Hooks>::on_initialize` when signed phase is being opened.
pub fn on_initialize_open_signed() {
log!(info, "Starting signed phase round {}.", Self::round());
<CurrentPhase<T>>::put(Phase::Signed);
Self::deposit_event(Event::SignedPhaseStarted { round: Self::round() });
}

/// Logic for [`<Pallet as Hooks<T>>::on_initialize`] when unsigned phase is being opened.
/// Logic for `<Pallet as Hooks<T>>::on_initialize` when unsigned phase is being opened.
pub fn on_initialize_open_unsigned(enabled: bool, now: T::BlockNumber) {
let round = Self::round();
log!(info, "Starting unsigned phase round {} enabled {}.", round, enabled);
Expand Down
6 changes: 3 additions & 3 deletions frame/election-provider-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ pub trait NposSolver {
) -> Result<ElectionResult<Self::AccountId, Self::Accuracy>, Self::Error>;
}

/// A wrapper for [`sp_npos_elections::seq_phragmen`] that implements [`super::NposSolver`]. See the
/// A wrapper for [`sp_npos_elections::seq_phragmen`] that implements [`NposSolver`]. See the
/// documentation of [`sp_npos_elections::seq_phragmen`] for more info.
pub struct SequentialPhragmen<AccountId, Accuracy, Balancing = ()>(
sp_std::marker::PhantomData<(AccountId, Accuracy, Balancing)>,
Expand All @@ -408,8 +408,8 @@ impl<
}
}

/// A wrapper for [`sp_npos_elections::phragmms`] that implements [`NposSolver`]. See the
/// documentation of [`sp_npos_elections::phragmms`] for more info.
/// A wrapper for [`sp_npos_elections::phragmms()`] that implements [`NposSolver`]. See the
/// documentation of [`sp_npos_elections::phragmms()`] for more info.
pub struct PhragMMS<AccountId, Accuracy, Balancing = ()>(
sp_std::marker::PhantomData<(AccountId, Accuracy, Balancing)>,
);
Expand Down
2 changes: 1 addition & 1 deletion frame/election-provider-support/src/onchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct OnChainSequentialPhragmen<T: Config>(PhantomData<T>);
///
/// WARNING: the user of this pallet must ensure that the `Accuracy` type will work nicely with the
/// normalization operation done inside `seq_phragmen`. See
/// [`sp_npos_elections::assignment::try_normalize`] for more info.
/// [`sp_npos_elections::Assignment::try_normalize`] for more info.
pub trait Config: frame_system::Config {
/// The accuracy used to compute the election:
type Accuracy: PerThing128;
Expand Down
2 changes: 1 addition & 1 deletion frame/executive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ where
weight
}

/// Execute given block, but don't do any of the [`final_checks`].
/// Execute given block, but don't do any of the `final_checks`.
///
/// Should only be used for testing.
#[cfg(feature = "try-runtime")]
Expand Down
2 changes: 1 addition & 1 deletion frame/merkle-mountain-range/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0" }
jsonrpsee = { git = "https:/paritytech/jsonrpsee", rev = "9a3c1e981bcdbbb558b1457bbd78277a14dca2da", features = ["server"] }
serde_json = "1"
serde_json = "1.0.71"
serde = { version = "1.0.126", features = ["derive"] }

sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" }
Expand Down
5 changes: 3 additions & 2 deletions frame/staking/src/pallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ pub mod pallet {

/// Convert a balance into a number used for election calculation. This must fit into a
/// `u64` but is allowed to be sensibly lossy. The `u64` is used to communicate with the
/// [`sp_npos_elections`] crate which accepts u64 numbers and does operations in 128.
/// [`frame_election_provider_support`] crate which accepts u64 numbers and does operations
/// in 128.
/// Consequently, the backward convert is used convert the u128s from sp-elections back to a
/// [`BalanceOf`].
type CurrencyToVote: CurrencyToVote<BalanceOf<Self>>;
Expand Down Expand Up @@ -146,7 +147,7 @@ pub mod pallet {
type OffendingValidatorsThreshold: Get<Perbill>;

/// Something that can provide a sorted list of voters in a somewhat sorted way. The
/// original use case for this was designed with [`pallet_bags_list::Pallet`] in mind. If
/// original use case for this was designed with `pallet_bags_list::Pallet` in mind. If
/// the bags-list is not desired, [`impls::UseNominatorsMap`] is likely the desired option.
type SortedListProvider: SortedListProvider<Self::AccountId>;

Expand Down
Loading

0 comments on commit 7034e6e

Please sign in to comment.