Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds benchmarking and try-runtime support in frame crate #4406

Merged
merged 5 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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;
}
Loading