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

Commit

Permalink
Add runtime-benchmarks for frame-benchmarking (#10324)
Browse files Browse the repository at this point in the history
* update frame/benchmarking/src/baseline.rs

* add runtime-benchmarks feature

* add runtime-benchmarks for frame-benchmarking

* update frame-benchmarking/runtime-benchmarks

* trigger GitHub actions
  • Loading branch information
zjb0807 authored and niklasad1 committed Dec 2, 2021
1 parent 07731fc commit 3bda1b7
Show file tree
Hide file tree
Showing 35 changed files with 36 additions and 33 deletions.
2 changes: 1 addition & 1 deletion bin/node-template/pallets/template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ std = [
'frame-benchmarking/std',
]

runtime-benchmarks = ["frame-benchmarking"]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
try-runtime = ["frame-support/try-runtime"]
2 changes: 1 addition & 1 deletion bin/node-template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ std = [
"sp-version/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking",
"frame-system/runtime-benchmarks",
Expand Down
2 changes: 1 addition & 1 deletion bin/node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ std = [
"sp-io/std"
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-election-provider-multi-phase/runtime-benchmarks",
Expand Down
2 changes: 1 addition & 1 deletion frame/assets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ std = [
"frame-benchmarking/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
Expand Down
2 changes: 1 addition & 1 deletion frame/babe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ std = [
"sp-std/std",
"log/std",
]
runtime-benchmarks = ["frame-benchmarking"]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
try-runtime = ["frame-support/try-runtime"]
2 changes: 1 addition & 1 deletion frame/bags-list/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ std = [
"log/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"sp-core",
"sp-io",
"pallet-balances",
Expand Down
2 changes: 1 addition & 1 deletion frame/balances/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ std = [
"frame-system/std",
"log/std",
]
runtime-benchmarks = ["frame-benchmarking"]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
try-runtime = ["frame-support/try-runtime"]
1 change: 1 addition & 0 deletions frame/benchmarking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ std = [
"linregress",
"log/std",
]
runtime-benchmarks = []
2 changes: 2 additions & 0 deletions frame/benchmarking/src/baseline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
//! A set of benchmarks which can establish a global baseline for all other
//! benchmarking.

#![cfg(feature = "runtime-benchmarks")]

use crate::benchmarks;
use codec::Encode;
use frame_system::Pallet as System;
Expand Down
2 changes: 1 addition & 1 deletion frame/bounties/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ std = [
"log/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
Expand Down
2 changes: 1 addition & 1 deletion frame/collective/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ std = [
"frame-system/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
Expand Down
2 changes: 1 addition & 1 deletion frame/contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ std = [
"libsecp256k1/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"libsecp256k1",
"rand",
"rand_pcg",
Expand Down
2 changes: 1 addition & 1 deletion frame/democracy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ std = [
"frame-system/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
Expand Down
2 changes: 1 addition & 1 deletion frame/election-provider-multi-phase/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ std = [
"log/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-election-provider-support/runtime-benchmarks",
"rand",
"strum",
Expand Down
2 changes: 1 addition & 1 deletion frame/elections-phragmen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ std = [
"log/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
Expand Down
2 changes: 1 addition & 1 deletion frame/examples/basic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ std = [
"sp-runtime/std",
"sp-std/std"
]
runtime-benchmarks = ["frame-benchmarking"]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
try-runtime = ["frame-support/try-runtime"]
2 changes: 1 addition & 1 deletion frame/gilt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ std = [
"frame-system/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
Expand Down
2 changes: 1 addition & 1 deletion frame/grandpa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ std = [
"pallet-session/std",
"log/std",
]
runtime-benchmarks = ["frame-benchmarking"]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
try-runtime = ["frame-support/try-runtime"]
2 changes: 1 addition & 1 deletion frame/identity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ std = [
"frame-system/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
Expand Down
2 changes: 1 addition & 1 deletion frame/im-online/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ std = [
"frame-system/std",
"log/std",
]
runtime-benchmarks = ["frame-benchmarking"]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
try-runtime = ["frame-support/try-runtime"]
2 changes: 1 addition & 1 deletion frame/indices/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ std = [
"frame-system/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
Expand Down
2 changes: 1 addition & 1 deletion frame/lottery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ std = [
"frame-system/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"frame-support/runtime-benchmarks",
]
Expand Down
2 changes: 1 addition & 1 deletion frame/membership/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ std = [
"frame-benchmarking/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
Expand Down
2 changes: 1 addition & 1 deletion frame/merkle-mountain-range/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ std = [
"frame-system/std",
"pallet-mmr-primitives/std",
]
runtime-benchmarks = ["frame-benchmarking"]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
try-runtime = ["frame-support/try-runtime"]
2 changes: 1 addition & 1 deletion frame/multisig/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ std = [
"sp-std/std"
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
Expand Down
2 changes: 1 addition & 1 deletion frame/proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ std = [
"sp-io/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
Expand Down
2 changes: 1 addition & 1 deletion frame/scheduler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ std = [
"log/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
Expand Down
2 changes: 1 addition & 1 deletion frame/staking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ std = [
"frame-election-provider-support/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-election-provider-support/runtime-benchmarks",
"rand_chacha",
]
Expand Down
2 changes: 1 addition & 1 deletion frame/timestamp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ std = [
"sp-timestamp/std",
"log/std",
]
runtime-benchmarks = ["frame-benchmarking", "sp-io"]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks", "sp-io"]
try-runtime = ["frame-support/try-runtime"]
2 changes: 1 addition & 1 deletion frame/tips/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ std = [
"pallet-treasury/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
Expand Down
2 changes: 1 addition & 1 deletion frame/transaction-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sp-core = { version = "4.0.0-dev", path = "../../primitives/core", default-featu

[features]
default = ["std"]
runtime-benchmarks = ["frame-benchmarking", "hex-literal"]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks", "hex-literal"]
std = [
"serde",
"codec/std",
Expand Down
2 changes: 1 addition & 1 deletion frame/treasury/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ std = [
"pallet-balances/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
Expand Down
2 changes: 1 addition & 1 deletion frame/uniques/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ std = [
"frame-benchmarking/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
Expand Down
2 changes: 1 addition & 1 deletion frame/utility/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ std = [
"sp-std/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
Expand Down
2 changes: 1 addition & 1 deletion frame/vesting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ std = [
"frame-support/std",
"frame-system/std",
]
runtime-benchmarks = ["frame-benchmarking"]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
try-runtime = ["frame-support/try-runtime"]

0 comments on commit 3bda1b7

Please sign in to comment.