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

add weights that need to be generated for rococo #5052

Merged
merged 63 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
99ad878
add weights that need to be generated for rococo
brunopgalvao Mar 7, 2022
f3966d0
remove frame_system
brunopgalvao Mar 10, 2022
3086a9f
touch balances weight file
brunopgalvao Mar 10, 2022
f5b73eb
add empty im-online weight file
brunopgalvao Mar 10, 2022
e6e6a0b
add empty pallet indices weight file
brunopgalvao Mar 10, 2022
a79546b
add empty pallet multisig weight file
brunopgalvao Mar 10, 2022
7d87439
add empty pallet proxy weight file
brunopgalvao Mar 10, 2022
87554cf
add empty pallet session weight file
brunopgalvao Mar 10, 2022
3183510
add empty pallet timestamp weight file
brunopgalvao Mar 10, 2022
a6e431a
add empty pallet utility weight file
brunopgalvao Mar 10, 2022
d9daff8
add empty para pallets weight files
brunopgalvao Mar 10, 2022
5259233
remove utility for now
brunopgalvao Mar 10, 2022
e92fa94
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Mar 10, 2022
d79a223
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 10, 2022
eac4c95
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 10, 2022
6adbf04
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Mar 10, 2022
d0531f8
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 10, 2022
fefaa65
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Mar 10, 2022
9886887
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 10, 2022
38214e0
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 10, 2022
0488b49
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Mar 10, 2022
f0e919a
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 10, 2022
70a75ad
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Mar 11, 2022
0af49c1
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 11, 2022
9d23a6b
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Mar 11, 2022
7924a15
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 11, 2022
6b115ce
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 11, 2022
8bae26c
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 12, 2022
426baee
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 12, 2022
696546b
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Mar 14, 2022
84d500f
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 14, 2022
1dd3d43
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Mar 14, 2022
7c89d28
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 14, 2022
098aec7
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 14, 2022
698edca
update ump for weights sink_process_upward_message -> process_upward_…
nuke-web3 Mar 14, 2022
3cd6b49
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Mar 14, 2022
cd3b046
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 14, 2022
ca04dc5
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 14, 2022
8f2ad0a
add frame_system weights for Rococo
brunopgalvao Mar 15, 2022
6282974
Merge branch 'rococo-weights' of https://github.com/paritytech/polkad…
brunopgalvao Mar 15, 2022
b01c3f8
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Mar 15, 2022
a0f8c8a
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 15, 2022
c0ace0b
add pallet-utility runtime benchmarks
brunopgalvao Mar 15, 2022
1c51ef5
Merge branch 'rococo-weights' of https://github.com/paritytech/polkad…
brunopgalvao Mar 15, 2022
8c4ad25
add utility benchmark
brunopgalvao Mar 15, 2022
fd2e837
add utility pallet
brunopgalvao Mar 15, 2022
416a123
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Mar 15, 2022
bc2c493
cargo run --quiet --profile=production --features=runtime-benchmarks…
Mar 15, 2022
9c7b9ff
Merge branch 'master' into rococo-weights
brunopgalvao Mar 17, 2022
fe96f36
fix cargo format issues
brunopgalvao Mar 17, 2022
0d1d3c4
Merge branch 'rococo-weights' of https://github.com/paritytech/polkad…
brunopgalvao Mar 17, 2022
1af0a64
Merge remote-tracking branch 'origin/master' into rococo-weights
brunopgalvao Mar 22, 2022
dd92016
add pallet_session weights
brunopgalvao Mar 22, 2022
8878f28
remove newline
brunopgalvao Mar 22, 2022
4992520
use some of the new weights
shawntabrizi Mar 22, 2022
04ea6dd
add pallet-utility/std
brunopgalvao Mar 22, 2022
7b36b50
Merge branch 'rococo-weights' of https://github.com/paritytech/polkad…
brunopgalvao Mar 22, 2022
b9b811a
add collective and membership benchmarks
brunopgalvao Mar 22, 2022
8a02fac
add WeightInfo
brunopgalvao Mar 22, 2022
0d26529
copy weights from Polkadot for now, needs to be updated with relevant…
brunopgalvao Mar 22, 2022
08fa45d
add weights
brunopgalvao Mar 22, 2022
5a3095f
copy weights from Polkadot pallet session
brunopgalvao Mar 22, 2022
b9bfe9b
remove newline
brunopgalvao Mar 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 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 runtime/kusama/src/weights/runtime_parachains_ump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use sp_std::marker::PhantomData;
/// Weight functions for `runtime_parachains::ump`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> runtime_parachains::ump::WeightInfo for WeightInfo<T> {
fn sink_process_upward_message(s: u32, ) -> Weight {
fn process_upward_message(s: u32, ) -> Weight {
(4_768_000 as Weight)
// Standard Error: 0
.saturating_add((2_000 as Weight).saturating_mul(s as Weight))
Expand Down
6 changes: 3 additions & 3 deletions runtime/parachains/src/ump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl<XcmExecutor: xcm::latest::ExecuteXcm<C::Call>, C: Config> UmpSink for XcmSi
// The benchmark is timing this whole function with different message sizes and a NOOP extrinsic to
// measure the size-dependent weight. But as we use the weight funtion **in** the benchmarked funtion we
// are taking call and control-flow overhead into account twice.
<C as Config>::WeightInfo::sink_process_upward_message(data.len() as u32),
<C as Config>::WeightInfo::process_upward_message(data.len() as u32),
)
});
match maybe_msg_and_weight {
Expand Down Expand Up @@ -186,7 +186,7 @@ impl fmt::Debug for AcceptanceCheckErr {
/// Weight information of this pallet.
pub trait WeightInfo {
fn service_overweight() -> Weight;
fn sink_process_upward_message(s: u32) -> Weight;
fn process_upward_message(s: u32) -> Weight;
fn clean_ump_after_outgoing() -> Weight;
}

Expand All @@ -197,7 +197,7 @@ impl WeightInfo for TestWeightInfo {
Weight::MAX
}

fn sink_process_upward_message(_msg_size: u32) -> Weight {
fn process_upward_message(_msg_size: u32) -> Weight {
Weight::MAX
}

Expand Down
5 changes: 5 additions & 0 deletions runtime/rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ pallet-bridge-messages = { path = "../../bridges/modules/messages", default-feat
# Benchmarking Dependencies
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
hex-literal = { version = "0.3.4", optional = true }
frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }

[build-dependencies]
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }
Expand Down Expand Up @@ -151,6 +152,7 @@ std = [
"xcm-executor/std",
"xcm-builder/std",
"pallet-xcm/std",
"pallet-utility/std",
"log/std",
"pallet-multisig/std",
]
Expand All @@ -171,14 +173,17 @@ runtime-benchmarks = [
"pallet-grandpa/runtime-benchmarks",
"pallet-im-online/runtime-benchmarks",
"pallet-indices/runtime-benchmarks",
"pallet-membership/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
"pallet-staking/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"hex-literal",
"frame-system-benchmarking",
"runtime-parachains/runtime-benchmarks",
]
try-runtime = [
Expand Down
65 changes: 47 additions & 18 deletions runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ impl frame_system::Config for Runtime {
type AccountData = pallet_balances::AccountData<Balance>;
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SystemWeightInfo = weights::frame_system::WeightInfo<Runtime>;
type SS58Prefix = SS58Prefix;
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
Expand Down Expand Up @@ -388,7 +388,7 @@ impl pallet_im_online::Config for Runtime {
type NextSessionRotation = Babe;
type ReportUnresponsiveness = Offences;
type UnsignedPriority = ImOnlineUnsignedPriority;
type WeightInfo = ();
type WeightInfo = weights::pallet_im_online::WeightInfo<Runtime>;
type MaxKeys = MaxKeys;
type MaxPeerInHeartbeats = MaxPeerInHeartbeats;
type MaxPeerDataEncodingSize = MaxPeerDataEncodingSize;
Expand All @@ -409,7 +409,7 @@ impl pallet_balances::Config for Runtime {
type MaxLocks = MaxLocks;
type MaxReserves = MaxReserves;
type ReserveIdentifier = [u8; 8];
type WeightInfo = ();
type WeightInfo = weights::pallet_balances::WeightInfo<Runtime>;
}

impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime
Expand Down Expand Up @@ -442,7 +442,7 @@ impl pallet_timestamp::Config for Runtime {
type Moment = u64;
type OnTimestampSet = Babe;
type MinimumPeriod = MinimumPeriod;
type WeightInfo = ();
type WeightInfo = weights::pallet_timestamp::WeightInfo<Runtime>;
}

parameter_types! {
Expand Down Expand Up @@ -523,7 +523,7 @@ impl pallet_indices::Config for Runtime {
type Currency = Balances;
type Deposit = IndexDeposit;
type Event = Event;
type WeightInfo = ();
type WeightInfo = weights::pallet_indices::WeightInfo<Runtime>;
}

parameter_types! {
Expand Down Expand Up @@ -568,7 +568,7 @@ impl pallet_authorship::Config for Runtime {
impl parachains_origin::Config for Runtime {}

impl parachains_configuration::Config for Runtime {
type WeightInfo = parachains_configuration::TestWeightInfo;
type WeightInfo = weights::runtime_parachains_configuration::WeightInfo<Runtime>;
}

impl parachains_shared::Config for Runtime {}
Expand Down Expand Up @@ -618,7 +618,7 @@ impl parachains_hrmp::Config for Runtime {
type Event = Event;
type Origin = Origin;
type Currency = Balances;
type WeightInfo = weights::runtime_parachains_hrmp::WeightInfo<Self>;
type WeightInfo = weights::runtime_parachains_hrmp::WeightInfo<Runtime>;
}

impl parachains_paras_inherent::Config for Runtime {
Expand All @@ -630,7 +630,7 @@ impl parachains_scheduler::Config for Runtime {}
impl parachains_initializer::Config for Runtime {
type Randomness = pallet_babe::RandomnessFromOneEpochAgo<Runtime>;
type ForceOrigin = EnsureRoot<AccountId>;
type WeightInfo = ();
type WeightInfo = weights::runtime_parachains_initializer::WeightInfo<Runtime>;
}

impl paras_sudo_wrapper::Config for Runtime {}
Expand Down Expand Up @@ -666,7 +666,7 @@ impl paras_registrar::Config for Runtime {
type OnSwap = (Crowdloan, Slots);
type ParaDeposit = ParaDeposit;
type DataDepositPerByte = DataDepositPerByte;
type WeightInfo = paras_registrar::TestWeightInfo;
type WeightInfo = weights::runtime_common_paras_registrar::WeightInfo<Runtime>;
}

impl pallet_beefy::Config for Runtime {
Expand Down Expand Up @@ -873,7 +873,7 @@ impl auctions::Config for Runtime {
type SampleLength = SampleLength;
type Randomness = pallet_babe::RandomnessFromOneEpochAgo<Runtime>;
type InitiateOrigin = EnsureRoot<AccountId>;
type WeightInfo = auctions::TestWeightInfo;
type WeightInfo = weights::runtime_common_auctions::WeightInfo<Runtime>;
}

parameter_types! {
Expand All @@ -887,7 +887,7 @@ impl slots::Config for Runtime {
type LeasePeriod = LeasePeriod;
type LeaseOffset = ();
type ForceOrigin = EnsureRoot<AccountId>;
type WeightInfo = slots::TestWeightInfo;
type WeightInfo = weights::runtime_common_slots::WeightInfo<Runtime>;
}

parameter_types! {
Expand All @@ -908,7 +908,7 @@ impl crowdloan::Config for Runtime {
type Registrar = Registrar;
type Auctioneer = Auctions;
type MaxMemoLength = MaxMemoLength;
type WeightInfo = crowdloan::TestWeightInfo;
type WeightInfo = weights::runtime_common_crowdloan::WeightInfo<Runtime>;
}

impl pallet_sudo::Config for Runtime {
Expand All @@ -925,7 +925,7 @@ impl pallet_utility::Config for Runtime {
type Event = Event;
type Call = Call;
type PalletsOrigin = OriginCaller;
type WeightInfo = ();
type WeightInfo = weights::pallet_utility::WeightInfo<Runtime>;
}

parameter_types! {
Expand Down Expand Up @@ -995,7 +995,7 @@ impl pallet_proxy::Config for Runtime {
type ProxyDepositBase = ProxyDepositBase;
type ProxyDepositFactor = ProxyDepositFactor;
type MaxProxies = MaxProxies;
type WeightInfo = ();
type WeightInfo = weights::pallet_proxy::WeightInfo<Runtime>;
type MaxPending = MaxPending;
type CallHasher = BlakeTwo256;
type AnnouncementDepositBase = AnnouncementDepositBase;
Expand All @@ -1016,7 +1016,7 @@ impl pallet_collective::Config for Runtime {
type MaxProposals = MaxProposals;
type DefaultVote = pallet_collective::PrimeDefaultVote;
type MaxMembers = MaxMembers;
type WeightInfo = ();
type WeightInfo = weights::pallet_collective::WeightInfo<Runtime>;
}

impl pallet_membership::Config for Runtime {
Expand All @@ -1029,7 +1029,7 @@ impl pallet_membership::Config for Runtime {
type MembershipInitialized = Collective;
type MembershipChanged = Collective;
type MaxMembers = MaxMembers;
type WeightInfo = ();
type WeightInfo = weights::pallet_membership::WeightInfo<Runtime>;
}

parameter_types! {
Expand All @@ -1047,7 +1047,7 @@ impl pallet_multisig::Config for Runtime {
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
type MaxSignatories = MaxSignatories;
type WeightInfo = ();
type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
}

#[cfg(feature = "runtime-benchmarks")]
Expand All @@ -1057,11 +1057,32 @@ extern crate frame_benchmarking;
#[cfg(feature = "runtime-benchmarks")]
mod benches {
define_benchmarks!(
// Polkadot
// NOTE: Make sure to prefix these with `runtime_common::` so
// the that path resolves correctly in the generated file.
[runtime_common::auctions, Auctions]
[runtime_common::crowdloan, Crowdloan]
[runtime_common::paras_registrar, Registrar]
[runtime_common::slots, Slots]
[runtime_parachains::configuration, Configuration]
[runtime_parachains::hrmp, Hrmp]
[runtime_parachains::initializer, Initializer]
[runtime_parachains::paras, Paras]
[runtime_parachains::disputes, ParasDisputes]
[runtime_parachains::paras_inherent, ParaInherent]
[runtime_parachains::paras, Paras]
[runtime_parachains::ump, Ump]
// Substrate
[frame_benchmarking::baseline, Baseline::<Runtime>]
[pallet_balances, Balances]
[pallet_collective, Collective]
[pallet_im_online, ImOnline]
[pallet_indices, Indices]
[pallet_membership, Membership]
[pallet_multisig, Multisig]
[pallet_proxy, Proxy]
[frame_system, SystemBench::<Runtime>]
[pallet_timestamp, Timestamp]
[pallet_utility, Utility]
);
}

Expand Down Expand Up @@ -1477,6 +1498,9 @@ sp_api::impl_runtime_apis! {
use frame_benchmarking::{Benchmarking, BenchmarkList};
use frame_support::traits::StorageInfoTrait;

use frame_system_benchmarking::Pallet as SystemBench;
use frame_benchmarking::baseline::Pallet as Baseline;

let mut list = Vec::<BenchmarkList>::new();
list_benchmarks!(list, extra);

Expand All @@ -1491,6 +1515,11 @@ sp_api::impl_runtime_apis! {
sp_runtime::RuntimeString,
> {
use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey};
use frame_system_benchmarking::Pallet as SystemBench;
use frame_benchmarking::baseline::Pallet as Baseline;

impl frame_system_benchmarking::Config for Runtime {}
impl frame_benchmarking::baseline::Config for Runtime {}

let mut batches = Vec::<BenchmarkBatch>::new();
let whitelist: Vec<TrackedStorageKey> = vec![
Expand Down
82 changes: 82 additions & 0 deletions runtime/rococo/src/weights/frame_system.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.

// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `frame_system`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-03-15, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024

// Executed Command:
// target/production/polkadot
// benchmark
// --chain=rococo-dev
// --steps=50
// --repeat=20
// --pallet=frame_system
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --output=./runtime/rococo/src/weights/

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

use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;

/// Weight functions for `frame_system`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
fn remark(_b: u32, ) -> Weight {
(0 as Weight)
}
fn remark_with_event(b: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 0
.saturating_add((2_000 as Weight).saturating_mul(b as Weight))
}
// Storage: System Digest (r:1 w:1)
// Storage: unknown [0x3a686561707061676573] (r:0 w:1)
fn set_heap_pages() -> Weight {
(2_271_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Skipped Metadata (r:0 w:0)
fn set_storage(i: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 0
.saturating_add((320_000 as Weight).saturating_mul(i as Weight))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
}
// Storage: Skipped Metadata (r:0 w:0)
fn kill_storage(i: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 0
.saturating_add((232_000 as Weight).saturating_mul(i as Weight))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
}
// Storage: Skipped Metadata (r:0 w:0)
fn kill_prefix(p: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 0
.saturating_add((588_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
}
}
16 changes: 16 additions & 0 deletions runtime/rococo/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,25 @@

//! A list of the different weight modules for our runtime.

pub mod frame_system;
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
pub mod pallet_balances;
pub mod pallet_collective;
pub mod pallet_im_online;
pub mod pallet_indices;
pub mod pallet_membership;
pub mod pallet_multisig;
pub mod pallet_proxy;
pub mod pallet_session;
pub mod pallet_timestamp;
pub mod pallet_utility;
pub mod runtime_common_auctions;
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_hrmp;
pub mod runtime_parachains_initializer;
pub mod runtime_parachains_paras;
pub mod runtime_parachains_paras_inherent;
pub mod runtime_parachains_ump;
Loading