Skip to content

Commit

Permalink
Adds benchmarking and try-runtime support in frame crate (#4406)
Browse files Browse the repository at this point in the history
  • Loading branch information
codekitz authored May 8, 2024
1 parent 17b56fa commit 37b1544
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
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.

10 changes: 10 additions & 0 deletions prdoc/pr_4406.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: Adds benchmarking and try-runtime support in `polkadot-sdk-frame` crate

doc:
- audience: Runtime Dev
description: |
Adds benchmarking and try-runtime support in `polkadot-sdk-frame` crate

crates:
- name: polkadot-sdk-frame
bump: minor
28 changes: 28 additions & 0 deletions substrate/frame/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,18 @@ sp-session = { default-features = false, path = "../primitives/session", optiona
sp-consensus-aura = { default-features = false, path = "../primitives/consensus/aura", optional = true }
sp-consensus-grandpa = { default-features = false, path = "../primitives/consensus/grandpa", optional = true }
sp-inherents = { default-features = false, path = "../primitives/inherents", optional = true }
sp-storage = { default-features = false, path = "../primitives/storage", optional = true }

frame-executive = { default-features = false, path = "../frame/executive", optional = true }
frame-system-rpc-runtime-api = { default-features = false, path = "../frame/system/rpc/runtime-api", optional = true }

# Used for runtime benchmarking
frame-benchmarking = { default-features = false, path = "../frame/benchmarking", optional = true }
frame-system-benchmarking = { default-features = false, path = "../frame/system/benchmarking", optional = true }

# Used for try-runtime
frame-try-runtime = { default-features = false, path = "../frame/try-runtime", optional = true }

docify = "0.2.8"
log = { workspace = true }

Expand All @@ -67,17 +75,21 @@ runtime = [
"sp-inherents",
"sp-offchain",
"sp-session",
"sp-storage",
"sp-transaction-pool",
"sp-version",

"frame-executive",
"frame-system-rpc-runtime-api",
]
std = [
"frame-benchmarking?/std",
"frame-executive?/std",
"frame-support/std",
"frame-system-benchmarking?/std",
"frame-system-rpc-runtime-api?/std",
"frame-system/std",
"frame-try-runtime?/std",
"log/std",
"parity-scale-codec/std",
"scale-info/std",
Expand All @@ -93,6 +105,22 @@ std = [
"sp-runtime/std",
"sp-session?/std",
"sp-std/std",
"sp-storage/std",
"sp-transaction-pool?/std",
"sp-version?/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"frame-executive/try-runtime",
"frame-support/try-runtime",
"frame-system/try-runtime",
"frame-try-runtime/try-runtime",
"pallet-examples/try-runtime",
"sp-runtime/try-runtime",
]
10 changes: 10 additions & 0 deletions substrate/frame/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,5 +363,15 @@ pub mod deps {
#[cfg(feature = "runtime")]
pub use sp_offchain;
#[cfg(feature = "runtime")]
pub use sp_storage;
#[cfg(feature = "runtime")]
pub use sp_version;

#[cfg(feature = "runtime-benchmarks")]
pub use frame_benchmarking;
#[cfg(feature = "runtime-benchmarks")]
pub use frame_system_benchmarking;

#[cfg(feature = "frame-try-runtime")]
pub use frame_try_runtime;
}

0 comments on commit 37b1544

Please sign in to comment.