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

Commit

Permalink
Update Substrate branch (#4432)
Browse files Browse the repository at this point in the history
* Update Substrate branch

* add disputes to Kusama runtime (#4356)

* add disputes to Kusama runtime

* Update DisputesHandler

* fmt

* add the benchmarks

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::disputes --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_disputes.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Parity Bot <admin@parity.io>

* Add XCM pallet and config to Polkadot runtime (#4313)

* xcm added

* xcm pallet & config added Polkadot

* set advertise XCM version to 2 for Polkadot

* remove ChildSystemParachainAsSuperuser from Polkadot XCM config

* remove unpaid execution for system parachains

* remove unused imports

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Pin changelogerator to the latest compatible version for the current flow (#4392) (#4436)

* add missing feature (#4355)

* add pallet-babe/std (#4438)

* Apply v0.9.13 weights (#4444)

* Update weights for Westend

* Update weights for kusama

* Update weights for polkadot

* bump tx versions (#4447) (#4450)

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Ignacio Palacios <ignacio.palacios.santos@gmail.com>
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
Co-authored-by: zjb0807 <zjb0807@qq.com>
Co-authored-by: Martin Pugh <martin@parity.io>
  • Loading branch information
10 people committed Dec 2, 2021
1 parent 1e2e562 commit 7d8f00b
Show file tree
Hide file tree
Showing 83 changed files with 2,842 additions and 1,622 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-draft-release.yml
Expand Up @@ -82,7 +82,7 @@ jobs:
RUSTC_NIGHTLY: ${{ needs.get-rust-versions.outputs.rustc-nightly }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gem install changelogerator git toml
gem install changelogerator:0.0.16 git toml
ruby $GITHUB_WORKSPACE/polkadot/scripts/github/generate_release_text.rb | tee release_text.md
- name: Create draft release
id: create-release
Expand Down
4 changes: 4 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions node/service/src/chain_spec.rs
Expand Up @@ -365,6 +365,7 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene
config: default_parachains_host_configuration(),
},
paras: Default::default(),
xcm_pallet: polkadot::XcmPalletConfig { safe_xcm_version: Some(2) },
}
}

Expand Down Expand Up @@ -1306,6 +1307,7 @@ pub fn polkadot_testnet_genesis(
config: default_parachains_host_configuration(),
},
paras: Default::default(),
xcm_pallet: polkadot::XcmPalletConfig { safe_xcm_version: Some(2) },
}
}

Expand Down
20 changes: 15 additions & 5 deletions runtime/kusama/src/lib.rs
Expand Up @@ -37,9 +37,9 @@ use sp_core::u32_trait::{_1, _2, _3, _5};
use sp_std::{cmp::Ordering, collections::btree_map::BTreeMap, prelude::*};

use runtime_parachains::{
configuration as parachains_configuration, dmp as parachains_dmp, hrmp as parachains_hrmp,
inclusion as parachains_inclusion, initializer as parachains_initializer,
origin as parachains_origin, paras as parachains_paras,
configuration as parachains_configuration, disputes as parachains_disputes,
dmp as parachains_dmp, hrmp as parachains_hrmp, inclusion as parachains_inclusion,
initializer as parachains_initializer, origin as parachains_origin, paras as parachains_paras,
paras_inherent as parachains_paras_inherent, reward_points as parachains_reward_points,
runtime_api_impl::v1 as parachains_runtime_api_impl, scheduler as parachains_scheduler,
session_info as parachains_session_info, shared as parachains_shared, ump as parachains_ump,
Expand Down Expand Up @@ -125,7 +125,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
apis: RUNTIME_API_VERSIONS,
#[cfg(feature = "disable-runtime-api")]
apis: version::create_apis_vec![[]],
transaction_version: 7,
transaction_version: 8,
};

/// The BABE epoch configuration at genesis.
Expand Down Expand Up @@ -1172,7 +1172,7 @@ impl parachains_session_info::Config for Runtime {}

impl parachains_inclusion::Config for Runtime {
type Event = Event;
type DisputesHandler = ();
type DisputesHandler = ParasDisputes;
type RewardValidators = parachains_reward_points::RewardValidatorsWithEraPoints<Runtime>;
}

Expand Down Expand Up @@ -1213,6 +1213,13 @@ impl parachains_initializer::Config for Runtime {
type WeightInfo = weights::runtime_parachains_initializer::WeightInfo<Runtime>;
}

impl parachains_disputes::Config for Runtime {
type Event = Event;
type RewardValidators = ();
type PunishValidators = ();
type WeightInfo = weights::runtime_parachains_disputes::WeightInfo<Runtime>;
}

parameter_types! {
pub const ParaDeposit: Balance = 40 * UNITS;
}
Expand Down Expand Up @@ -1554,6 +1561,7 @@ construct_runtime! {
Ump: parachains_ump::{Pallet, Call, Storage, Event} = 59,
Hrmp: parachains_hrmp::{Pallet, Call, Storage, Event<T>} = 60,
ParaSessionInfo: parachains_session_info::{Pallet, Storage} = 61,
ParasDisputes: parachains_disputes::{Pallet, Call, Storage, Event<T>} = 62,

// Parachain Onboarding Pallets. Start indices at 70 to leave room.
Registrar: paras_registrar::{Pallet, Call, Storage, Event<T>} = 70,
Expand Down Expand Up @@ -1934,6 +1942,7 @@ sp_api::impl_runtime_apis! {
list_benchmark!(list, extra, runtime_common::slots, Slots);
list_benchmark!(list, extra, runtime_common::paras_registrar, Registrar);
list_benchmark!(list, extra, runtime_parachains::configuration, Configuration);
list_benchmark!(list, extra, runtime_parachains::disputes, ParasDisputes);
list_benchmark!(list, extra, runtime_parachains::initializer, Initializer);
list_benchmark!(list, extra, runtime_parachains::paras_inherent, ParaInherent);
list_benchmark!(list, extra, runtime_parachains::paras, Paras);
Expand Down Expand Up @@ -2012,6 +2021,7 @@ sp_api::impl_runtime_apis! {
add_benchmark!(params, batches, runtime_common::slots, Slots);
add_benchmark!(params, batches, runtime_common::paras_registrar, Registrar);
add_benchmark!(params, batches, runtime_parachains::configuration, Configuration);
add_benchmark!(params, batches, runtime_parachains::disputes, ParasDisputes);
add_benchmark!(params, batches, runtime_parachains::initializer, Initializer);
add_benchmark!(params, batches, runtime_parachains::paras_inherent, ParaInherent);
add_benchmark!(params, batches, runtime_parachains::paras, Paras);
Expand Down
1 change: 1 addition & 0 deletions runtime/kusama/src/weights/mod.rs
Expand Up @@ -45,6 +45,7 @@ pub mod runtime_common_crowdloan;
pub mod runtime_common_paras_registrar;
pub mod runtime_common_slots;
pub mod runtime_parachains_configuration;
pub mod runtime_parachains_disputes;
pub mod runtime_parachains_initializer;
pub mod runtime_parachains_paras;
pub mod runtime_parachains_paras_inherent;
9 changes: 4 additions & 5 deletions runtime/kusama/src/weights/pallet_bags_list.rs
Expand Up @@ -16,7 +16,7 @@
//! Autogenerated weights for `pallet_bags_list`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-09-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2021-12-01, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128

// Executed Command:
Expand All @@ -31,8 +31,7 @@
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/

// --output=./runtime/kusama/src/weights/pallet_bags_list.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand All @@ -49,7 +48,7 @@ impl<T: frame_system::Config> pallet_bags_list::WeightInfo for WeightInfo<T> {
// Storage: BagsList ListNodes (r:4 w:4)
// Storage: BagsList ListBags (r:1 w:1)
fn rebag_non_terminal() -> Weight {
(65_491_000 as Weight)
(65_474_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}
Expand All @@ -58,7 +57,7 @@ impl<T: frame_system::Config> pallet_bags_list::WeightInfo for WeightInfo<T> {
// Storage: BagsList ListNodes (r:3 w:3)
// Storage: BagsList ListBags (r:2 w:2)
fn rebag_terminal() -> Weight {
(64_253_000 as Weight)
(63_983_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}
Expand Down
29 changes: 18 additions & 11 deletions runtime/kusama/src/weights/pallet_balances.rs
@@ -1,4 +1,4 @@
// Copyright 2017-2020 Parity Technologies (UK) Ltd.
// Copyright 2017-2021 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.

// Polkadot is free software: you can redistribute it and/or modify
Expand All @@ -15,8 +15,8 @@
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_balances`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-07-01, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-12-01, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128

// Executed Command:
Expand All @@ -31,8 +31,9 @@
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/
// --output=./runtime/kusama/src/weights/pallet_balances.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]

Expand All @@ -42,39 +43,45 @@ use sp_std::marker::PhantomData;
/// Weight functions for `pallet_balances`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
// Storage: System Account (r:1 w:1)
fn transfer() -> Weight {
(73_559_000 as Weight)
(59_763_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn transfer_keep_alive() -> Weight {
(54_667_000 as Weight)
(45_798_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn set_balance_creating() -> Weight {
(29_203_000 as Weight)
(25_732_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn set_balance_killing() -> Weight {
(35_128_000 as Weight)
(30_837_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:2 w:2)
fn force_transfer() -> Weight {
(72_833_000 as Weight)
(60_536_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: System Account (r:1 w:1)
fn transfer_all() -> Weight {
(67_554_000 as Weight)
(55_368_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn force_unreserve() -> Weight {
(27_766_000 as Weight)
(24_374_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
Expand Down
62 changes: 44 additions & 18 deletions runtime/kusama/src/weights/pallet_bounties.rs
@@ -1,4 +1,4 @@
// Copyright 2017-2020 Parity Technologies (UK) Ltd.
// Copyright 2017-2021 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.

// Polkadot is free software: you can redistribute it and/or modify
Expand All @@ -15,8 +15,8 @@
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_bounties`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-07-01, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-12-01, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128

// Executed Command:
Expand All @@ -31,8 +31,9 @@
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/
// --output=./runtime/kusama/src/weights/pallet_bounties.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]

Expand All @@ -42,62 +43,87 @@ use sp_std::marker::PhantomData;
/// Weight functions for `pallet_bounties`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_bounties::WeightInfo for WeightInfo<T> {
fn propose_bounty(d: u32) -> Weight {
(43_276_000 as Weight)
// Storage: Bounties BountyCount (r:1 w:1)
// Storage: System Account (r:1 w:1)
// Storage: Bounties BountyDescriptions (r:0 w:1)
// Storage: Bounties Bounties (r:0 w:1)
fn propose_bounty(d: u32, ) -> Weight {
(38_664_000 as Weight)
// Standard Error: 0
.saturating_add((1_000 as Weight).saturating_mul(d as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
// Storage: Bounties Bounties (r:1 w:1)
// Storage: Bounties BountyApprovals (r:1 w:1)
fn approve_bounty() -> Weight {
(11_557_000 as Weight)
(10_293_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Bounties Bounties (r:1 w:1)
fn propose_curator() -> Weight {
(8_693_000 as Weight)
(8_255_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Bounties Bounties (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn unassign_curator() -> Weight {
(53_028_000 as Weight)
(58_181_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Bounties Bounties (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn accept_curator() -> Weight {
(36_603_000 as Weight)
(32_865_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Bounties Bounties (r:1 w:1)
fn award_bounty() -> Weight {
(24_706_000 as Weight)
(23_160_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Bounties Bounties (r:1 w:1)
// Storage: System Account (r:3 w:3)
// Storage: Bounties BountyDescriptions (r:0 w:1)
fn claim_bounty() -> Weight {
(126_167_000 as Weight)
(104_755_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}
// Storage: Bounties Bounties (r:1 w:1)
// Storage: System Account (r:1 w:1)
// Storage: Bounties BountyDescriptions (r:0 w:1)
fn close_bounty_proposed() -> Weight {
(51_788_000 as Weight)
(57_771_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
// Storage: Bounties Bounties (r:1 w:1)
// Storage: System Account (r:2 w:2)
// Storage: Bounties BountyDescriptions (r:0 w:1)
fn close_bounty_active() -> Weight {
(83_343_000 as Weight)
(71_817_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
// Storage: Bounties Bounties (r:1 w:1)
fn extend_bounty_expiry() -> Weight {
(23_740_000 as Weight)
(22_153_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn spend_funds(b: u32) -> Weight {
// Storage: Bounties BountyApprovals (r:1 w:1)
// Storage: Bounties Bounties (r:1 w:1)
// Storage: System Account (r:2 w:2)
fn spend_funds(b: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 14_000
.saturating_add((60_142_000 as Weight).saturating_mul(b as Weight))
// Standard Error: 29_000
.saturating_add((55_584_000 as Weight).saturating_mul(b as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(b as Weight)))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Expand Down

0 comments on commit 7d8f00b

Please sign in to comment.