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

Commit bd29c35

Browse files
committed
Merge branch 'master' into ao-update-kvdb-and-co
* master: (42 commits) Adapt `pallet-contracts` to WeightV2 (#12421) Improved election pallet testing (#12327) Bump prost to 0.11+ (#12419) Use saturating add for alliance::disband witness data (#12418) [Fix] Rename VoterBagsList -> VoterList to match pdot (#12416) client/beefy: small code improvements (#12414) BEEFY: Simplify hashing for pallet-beefy-mmr (#12393) Add @koute to `docs/CODEOWNERS` and update stale paths (#12408) docs/CODEOWNERS: add @acatangiu as MMR owner (#12406) Remove unnecessary Clone trait bounds on CountedStorageMap (#12402) Fix `Weight::is_zero` (#12396) Beefy on-demand justifications as a custom RequestResponse protocol (#12124) Remove contracts RPCs (#12358) pallet-mmr: generate historical proofs (#12324) unsafe_pruning flag removed (#12385) Carry over where clauses defined in Config to Call and Hook (#12388) Properly set the max proof size weight on defaults and tests (#12383) BEEFY: impl TypeInfo for SignedCommitment (#12382) bounding staking: `BoundedElectionProvider` trait (#12362) New Pallet: Root offences (#11943) ...
2 parents 45adc12 + 7a8de49 commit bd29c35

171 files changed

Lines changed: 5515 additions & 3217 deletions

File tree

Some content is hidden

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

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ members = [
8686
"frame/child-bounties",
8787
"frame/collective",
8888
"frame/contracts",
89-
"frame/contracts/rpc",
90-
"frame/contracts/rpc/runtime-api",
89+
"frame/contracts/primitives",
90+
"frame/contracts/runtime-api",
9191
"frame/conviction-voting",
9292
"frame/democracy",
9393
"frame/fast-unstake",
@@ -135,6 +135,7 @@ members = [
135135
"frame/staking/reward-fn",
136136
"frame/state-trie-migration",
137137
"frame/sudo",
138+
"frame/root-offences",
138139
"frame/support",
139140
"frame/support/procedural",
140141
"frame/support/procedural/tools",

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pub fn new_partial(
126126
slot_duration,
127127
);
128128

129-
Ok((timestamp, slot))
129+
Ok((slot, timestamp))
130130
},
131131
spawner: &task_manager.spawn_essential_handle(),
132132
registry: config.prometheus_registry(),
@@ -191,7 +191,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
191191
Vec::default(),
192192
));
193193

194-
let (network, system_rpc_tx, network_starter) =
194+
let (network, system_rpc_tx, tx_handler_controller, network_starter) =
195195
sc_service::build_network(sc_service::BuildNetworkParams {
196196
config: &config,
197197
client: client.clone(),
@@ -238,6 +238,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
238238
rpc_builder: rpc_extensions_builder,
239239
backend,
240240
system_rpc_tx,
241+
tx_handler_controller,
241242
config,
242243
telemetry: telemetry.as_mut(),
243244
})?;
@@ -269,7 +270,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
269270
slot_duration,
270271
);
271272

272-
Ok((timestamp, slot))
273+
Ok((slot, timestamp))
273274
},
274275
force_authoring,
275276
backoff_authoring_blocks,

bin/node-template/runtime/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,11 @@ parameter_types! {
139139
pub const BlockHashCount: BlockNumber = 2400;
140140
pub const Version: RuntimeVersion = VERSION;
141141
/// We allow for 2 seconds of compute with a 6 second average block time.
142-
pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights
143-
::with_sensible_defaults(2u64 * WEIGHT_PER_SECOND, NORMAL_DISPATCH_RATIO);
142+
pub BlockWeights: frame_system::limits::BlockWeights =
143+
frame_system::limits::BlockWeights::with_sensible_defaults(
144+
(2u64 * WEIGHT_PER_SECOND).set_proof_size(u64::MAX),
145+
NORMAL_DISPATCH_RATIO,
146+
);
144147
pub BlockLength: frame_system::limits::BlockLength = frame_system::limits::BlockLength
145148
::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
146149
pub const SS58Prefix: u8 = 42;

bin/node/cli/benches/block_production.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn new_node(tokio_handle: Handle) -> node_cli::service::NewFullBase {
7474
database: DatabaseSource::RocksDb { path: root.join("db"), cache_size: 128 },
7575
trie_cache_maximum_size: Some(64 * 1024 * 1024),
7676
state_pruning: Some(PruningMode::ArchiveAll),
77-
blocks_pruning: BlocksPruning::All,
77+
blocks_pruning: BlocksPruning::KeepAll,
7878
chain_spec: spec,
7979
wasm_method: WasmExecutionMethod::Compiled {
8080
instantiation_strategy: WasmtimeInstantiationStrategy::PoolingCopyOnWrite,

bin/node/cli/benches/transaction_pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fn new_node(tokio_handle: Handle) -> node_cli::service::NewFullBase {
6868
database: DatabaseSource::RocksDb { path: root.join("db"), cache_size: 128 },
6969
trie_cache_maximum_size: Some(64 * 1024 * 1024),
7070
state_pruning: Some(PruningMode::ArchiveAll),
71-
blocks_pruning: BlocksPruning::All,
71+
blocks_pruning: BlocksPruning::KeepAll,
7272
chain_spec: spec,
7373
wasm_method: WasmExecutionMethod::Interpreted,
7474
// NOTE: we enforce the use of the native runtime to make the errors more debuggable

bin/node/cli/src/service.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ pub fn new_partial(
223223
let uncles =
224224
sp_authorship::InherentDataProvider::<<Block as BlockT>::Header>::check_inherents();
225225

226-
Ok((timestamp, slot, uncles))
226+
Ok((slot, timestamp, uncles))
227227
},
228228
&task_manager.spawn_essential_handle(),
229229
config.prometheus_registry(),
@@ -354,7 +354,7 @@ pub fn new_full_base(
354354
Vec::default(),
355355
));
356356

357-
let (network, system_rpc_tx, network_starter) =
357+
let (network, system_rpc_tx, tx_handler_controller, network_starter) =
358358
sc_service::build_network(sc_service::BuildNetworkParams {
359359
config: &config,
360360
client: client.clone(),
@@ -392,6 +392,7 @@ pub fn new_full_base(
392392
transaction_pool: transaction_pool.clone(),
393393
task_manager: &mut task_manager,
394394
system_rpc_tx,
395+
tx_handler_controller,
395396
telemetry: telemetry.as_mut(),
396397
})?;
397398

@@ -453,7 +454,7 @@ pub fn new_full_base(
453454
&parent,
454455
)?;
455456

456-
Ok((timestamp, slot, uncles, storage_proof))
457+
Ok((slot, timestamp, uncles, storage_proof))
457458
}
458459
},
459460
force_authoring,

bin/node/executor/tests/basic.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,19 @@ fn full_native_block_import_works() {
311311
let mut alice_last_known_balance: Balance = Default::default();
312312
let mut fees = t.execute_with(|| transfer_fee(&xt()));
313313

314-
let transfer_weight = default_transfer_call().get_dispatch_info().weight;
314+
let transfer_weight = default_transfer_call().get_dispatch_info().weight.saturating_add(
315+
<Runtime as frame_system::Config>::BlockWeights::get()
316+
.get(DispatchClass::Normal)
317+
.base_extrinsic,
318+
);
315319
let timestamp_weight = pallet_timestamp::Call::set::<Runtime> { now: Default::default() }
316320
.get_dispatch_info()
317-
.weight;
321+
.weight
322+
.saturating_add(
323+
<Runtime as frame_system::Config>::BlockWeights::get()
324+
.get(DispatchClass::Mandatory)
325+
.base_extrinsic,
326+
);
318327

319328
executor_call(&mut t, "Core_execute_block", &block1.0, true).0.unwrap();
320329

bin/node/rpc/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ targets = ["x86_64-unknown-linux-gnu"]
1414
[dependencies]
1515
jsonrpsee = { version = "0.15.1", features = ["server"] }
1616
node-primitives = { version = "2.0.0", path = "../primitives" }
17-
pallet-contracts-rpc = { version = "4.0.0-dev", path = "../../../frame/contracts/rpc/" }
1817
pallet-mmr-rpc = { version = "3.0.0", path = "../../../frame/merkle-mountain-range/rpc/" }
1918
pallet-transaction-payment-rpc = { version = "4.0.0-dev", path = "../../../frame/transaction-payment/rpc/" }
2019
sc-chain-spec = { version = "4.0.0-dev", path = "../../../client/chain-spec" }

bin/node/rpc/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ where
108108
+ Send
109109
+ 'static,
110110
C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,
111-
C::Api: pallet_contracts_rpc::ContractsRuntimeApi<Block, AccountId, Balance, BlockNumber, Hash>,
112111
C::Api: pallet_mmr_rpc::MmrRuntimeApi<Block, <Block as sp_runtime::traits::Block>::Hash>,
113112
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
114113
C::Api: BabeApi<Block>,
@@ -118,7 +117,6 @@ where
118117
B: sc_client_api::Backend<Block> + Send + Sync + 'static,
119118
B::State: sc_client_api::backend::StateBackend<sp_runtime::traits::HashFor<Block>>,
120119
{
121-
use pallet_contracts_rpc::{Contracts, ContractsApiServer};
122120
use pallet_mmr_rpc::{Mmr, MmrApiServer};
123121
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
124122
use sc_consensus_babe_rpc::{Babe, BabeApiServer};
@@ -150,7 +148,6 @@ where
150148
// Making synchronous calls in light client freezes the browser currently,
151149
// more context: https://github.com/paritytech/substrate/pull/3480
152150
// These RPCs should use an asynchronous caller instead.
153-
io.merge(Contracts::new(client.clone()).into_rpc())?;
154151
io.merge(Mmr::new(client.clone()).into_rpc())?;
155152
io.merge(TransactionPayment::new(client.clone()).into_rpc())?;
156153
io.merge(

0 commit comments

Comments
 (0)