mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 03:31:10 +00:00
Benchmark Polkadot Claims Pallet (#876)
* fix * Starting to add benchmarks * make compile * add benchmarks * Make work with Substrate master * Bench validate unsigned * back to polkadot master * starting to add cli with feature flag * more stuff * Add to kusama * Update Cargo.lock * fix dev dep * bump wasm builder * Remove encode from keccak benchmark * bump spec * Add weight documentation * Update Cargo.lock * Update check_runtime.sh * Update publish_draft_release.sh * Update Cargo.lock Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
@@ -17,7 +17,6 @@ crate-type = ["cdylib", "rlib"]
|
||||
log = "0.4.8"
|
||||
futures = { version = "0.3.4", features = ["compat"] }
|
||||
structopt = "0.3.8"
|
||||
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", optional = true }
|
||||
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
|
||||
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
|
||||
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
|
||||
@@ -28,6 +27,8 @@ sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polka
|
||||
service = { package = "polkadot-service", path = "../service", default-features = false }
|
||||
|
||||
tokio = { version = "0.2.10", features = ["rt-threaded"], optional = true }
|
||||
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", optional = true }
|
||||
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", optional = true }
|
||||
|
||||
wasm-bindgen = { version = "0.2.57", optional = true }
|
||||
wasm-bindgen-futures = { version = "0.4.7", optional = true }
|
||||
@@ -40,6 +41,7 @@ rocksdb = [ "service/rocksdb" ]
|
||||
cli = [
|
||||
"tokio",
|
||||
"sc-cli",
|
||||
"frame-benchmarking-cli",
|
||||
"service/full-node",
|
||||
]
|
||||
browser = [
|
||||
@@ -47,3 +49,4 @@ browser = [
|
||||
"wasm-bindgen-futures",
|
||||
"browser-utils",
|
||||
]
|
||||
runtime-benchmarks = ["service/runtime-benchmarks"]
|
||||
|
||||
@@ -29,6 +29,13 @@ pub enum Subcommand {
|
||||
#[allow(missing_docs)]
|
||||
#[structopt(name = "validation-worker", setting = structopt::clap::AppSettings::Hidden)]
|
||||
ValidationWorker(ValidationWorkerCommand),
|
||||
|
||||
/// The custom benchmark subcommmand benchmarking runtime pallets.
|
||||
#[structopt(
|
||||
name = "benchmark",
|
||||
about = "Benchmark runtime pallets."
|
||||
)]
|
||||
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
|
||||
}
|
||||
|
||||
#[allow(missing_docs)]
|
||||
|
||||
@@ -98,6 +98,18 @@ pub fn run(version: VersionInfo) -> sc_cli::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
},
|
||||
Some(Subcommand::Benchmark(cmd)) => {
|
||||
cmd.init(&version)?;
|
||||
cmd.update_config(&mut config, load_spec, &version)?;
|
||||
|
||||
let is_kusama = config.chain_spec.as_ref().map_or(false, |s| s.is_kusama());
|
||||
|
||||
if is_kusama {
|
||||
cmd.run::<_, _, service::kusama_runtime::Block, service::KusamaExecutor>(config)
|
||||
} else {
|
||||
cmd.run::<_, _, service::polkadot_runtime::Block, service::PolkadotExecutor>(config)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user