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

Commit 2c5a20c

Browse files
committed
Merge branch 'master' of https://github.com/paritytech/substrate into prgn-nominator-unsorted-bags
2 parents c1c4fcd + 7be311a commit 2c5a20c

File tree

56 files changed

+841
-221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+841
-221
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/node-template/node/src/command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ pub fn run() -> sc_cli::Result<()> {
121121

122122
runner.sync_run(|config| cmd.run::<Block, service::Executor>(config))
123123
} else {
124-
Err("Benchmarking wasn't enabled when building the node. \
125-
You can enable it with `--features runtime-benchmarks`."
124+
Err("Benchmarking wasn't enabled when building the node. You can enable it with \
125+
`--features runtime-benchmarks`."
126126
.into())
127127
},
128128
None => {

bin/node/executor/benches/bench.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ criterion_main!(benches);
4040
/// The wasm runtime code.
4141
pub fn compact_code_unwrap() -> &'static [u8] {
4242
node_runtime::WASM_BINARY.expect(
43-
"Development wasm binary is not available. \
44-
Testing is only supported with the flag disabled.",
43+
"Development wasm binary is not available. Testing is only supported with the flag \
44+
disabled.",
4545
)
4646
}
4747

bin/node/executor/tests/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ impl AppCrypto<MultiSigner, MultiSignature> for TestAuthorityId {
7171
/// runtime.
7272
pub fn compact_code_unwrap() -> &'static [u8] {
7373
node_runtime::WASM_BINARY.expect(
74-
"Development wasm binary is not available. \
75-
Testing is only supported with the flag disabled.",
74+
"Development wasm binary is not available. Testing is only supported with the flag \
75+
disabled.",
7676
)
7777
}
7878

bin/node/runtime/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
104104
#[cfg(feature = "std")]
105105
pub fn wasm_binary_unwrap() -> &'static [u8] {
106106
WASM_BINARY.expect(
107-
"Development wasm binary is not available. This means the client is \
108-
built with `SKIP_WASM_BUILD` flag and it is only usable for \
109-
production chains. Please rebuild with the flag disabled.",
107+
"Development wasm binary is not available. This means the client is built with \
108+
`SKIP_WASM_BUILD` flag and it is only usable for production chains. Please rebuild with \
109+
the flag disabled.",
110110
)
111111
}
112112

@@ -578,6 +578,7 @@ impl pallet_election_provider_multi_phase::BenchmarkingConfig for BenchmarkConfi
578578
impl pallet_election_provider_multi_phase::Config for Runtime {
579579
type Event = Event;
580580
type Currency = Balances;
581+
type EstimateCallFee = TransactionPayment;
581582
type SignedPhase = SignedPhase;
582583
type UnsignedPhase = UnsignedPhase;
583584
type SolutionImprovementThreshold = SolutionImprovementThreshold;

client/allocator/src/freeing_bump.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
//! sizes.
6969
7070
use crate::Error;
71+
pub use sp_core::MAX_POSSIBLE_ALLOCATION;
7172
use sp_wasm_interface::{Pointer, WordSize};
7273
use std::{
7374
convert::{TryFrom, TryInto},
@@ -95,15 +96,13 @@ const LOG_TARGET: &'static str = "wasm-heap";
9596
// The minimum possible allocation size is chosen to be 8 bytes because in that case we would have
9697
// easier time to provide the guaranteed alignment of 8.
9798
//
98-
// The maximum possible allocation size was chosen rather arbitrary. 32 MiB should be enough for
99-
// everybody.
99+
// The maximum possible allocation size is set in the primitives to 32MiB.
100100
//
101101
// N_ORDERS - represents the number of orders supported.
102102
//
103103
// This number corresponds to the number of powers between the minimum possible allocation and
104104
// maximum possible allocation, or: 2^3...2^25 (both ends inclusive, hence 23).
105105
const N_ORDERS: usize = 23;
106-
const MAX_POSSIBLE_ALLOCATION: u32 = 33554432; // 2^25 bytes, 32 MiB
107106
const MIN_POSSIBLE_ALLOCATION: u32 = 8; // 2^3 bytes, 8 bytes
108107

109108
/// The exponent for the power of two sized block adjusted to the minimum size.
@@ -922,4 +921,13 @@ mod tests {
922921
assert!(heap.poisoned);
923922
assert!(heap.deallocate(mem.as_mut(), alloc_ptr).is_err());
924923
}
924+
925+
#[test]
926+
fn test_n_orders() {
927+
// Test that N_ORDERS is consistent with min and max possible allocation.
928+
assert_eq!(
929+
MIN_POSSIBLE_ALLOCATION * 2u32.pow(N_ORDERS as u32 - 1),
930+
MAX_POSSIBLE_ALLOCATION
931+
);
932+
}
925933
}

client/chain-spec/derive/src/impls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn group_derive(ast: &DeriveInput) -> proc_macro::TokenStream {
7676
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
7777
let fork_name = Ident::new(&format!("{}Fork", name), Span::call_site());
7878

79-
let fork_fields = generate_fork_fields(&crate_name, &field_names, &field_types);
79+
let fork_fields = generate_fork_fields(crate_name, &field_names, &field_types);
8080
let to_fork = generate_base_to_fork(&fork_name, &field_names);
8181
let combine_with = generate_combine_with(&field_names);
8282
let to_base = generate_fork_to_base(name, &field_names);
@@ -88,7 +88,7 @@ pub fn group_derive(ast: &DeriveInput) -> proc_macro::TokenStream {
8888
Error::new(Span::call_site(), &format!("Could not find `serde` crate: {}", e))
8989
.to_compile_error();
9090

91-
return quote!( #err ).into()
91+
return quote!( #err )
9292
},
9393
};
9494

client/cli/src/commands/run_cmd.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pub struct RunCmd {
105105
#[structopt(long = "rpc-max-payload")]
106106
pub rpc_max_payload: Option<usize>,
107107

108-
/// Listen to all Prometheus data source interfaces.
108+
/// Expose Prometheus exporter on all interfaces.
109109
///
110110
/// Default is local.
111111
#[structopt(long = "prometheus-external")]
@@ -140,11 +140,11 @@ pub struct RunCmd {
140140
#[structopt(long = "rpc-cors", value_name = "ORIGINS", parse(try_from_str = parse_cors))]
141141
pub rpc_cors: Option<Cors>,
142142

143-
/// Specify Prometheus data source server TCP Port.
143+
/// Specify Prometheus exporter TCP Port.
144144
#[structopt(long = "prometheus-port", value_name = "PORT")]
145145
pub prometheus_port: Option<u16>,
146146

147-
/// Do not expose a Prometheus metric endpoint.
147+
/// Do not expose a Prometheus exporter endpoint.
148148
///
149149
/// Prometheus metric endpoint is enabled by default.
150150
#[structopt(long = "no-prometheus")]
@@ -487,10 +487,9 @@ fn rpc_interface(
487487
) -> Result<IpAddr> {
488488
if is_external && is_validator && rpc_methods != RpcMethods::Unsafe {
489489
return Err(Error::Input(
490-
"--rpc-external and --ws-external options shouldn't be \
491-
used if the node is running as a validator. Use `--unsafe-rpc-external` \
492-
or `--rpc-methods=unsafe` if you understand the risks. See the options \
493-
description for more information."
490+
"--rpc-external and --ws-external options shouldn't be used if the node is running as \
491+
a validator. Use `--unsafe-rpc-external` or `--rpc-methods=unsafe` if you understand \
492+
the risks. See the options description for more information."
494493
.to_owned(),
495494
))
496495
}
@@ -499,7 +498,7 @@ fn rpc_interface(
499498
if rpc_methods == RpcMethods::Unsafe {
500499
log::warn!(
501500
"It isn't safe to expose RPC publicly without a proxy server that filters \
502-
available set of RPC methods."
501+
available set of RPC methods."
503502
);
504503
}
505504

client/cli/src/params/network_params.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,13 @@ pub struct NetworkParams {
128128
pub ipfs_server: bool,
129129

130130
/// Blockchain syncing mode.
131-
/// Full - Download and validate full blockchain history (Default).
132-
/// Fast - Download blocks and the latest state only.
133-
/// FastUnsafe - Same as Fast, but do skips downloading state proofs.
134-
#[structopt(long, default_value = "Full")]
131+
///
132+
/// - `Full`: Download and validate full blockchain history.
133+
///
134+
/// - `Fast`: Download blocks and the latest state only.
135+
///
136+
/// - `FastUnsafe`: Same as `Fast`, but skip downloading state proofs.
137+
#[structopt(long, value_name = "SYNC_MODE", default_value = "Full")]
135138
pub sync: SyncMode,
136139
}
137140

client/consensus/aura/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ fn slot_author<P: Pair>(slot: Slot, authorities: &[AuthorityId<P>]) -> Option<&A
108108
);
109109

110110
let current_author = authorities.get(idx as usize).expect(
111-
"authorities not empty; index constrained to list length;\
112-
this is a valid index; qed",
111+
"authorities not empty; index constrained to list length;this is a valid index; qed",
113112
);
114113

115114
Some(current_author)

0 commit comments

Comments
 (0)