-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix small issues on benchmark overhead command #11893
Fix small issues on benchmark overhead command #11893
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work!
I think the JSON storage part can go into a second MR, as it is also not really important right now.
|
||
/// Add a header file to your outputted benchmarks. | ||
#[clap(long)] | ||
pub header: Option<PathBuf>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason not to put it into the OverheadParams
?
I think its cleaner to only pass around the OverheadParams
instead of the whole OverheadCmd
.
@@ -49,6 +49,10 @@ pub struct WeightParams { | |||
/// Is applied after `weight_mul`. | |||
#[clap(long = "add", default_value = "0")] | |||
pub weight_add: u64, | |||
|
|||
/// The block weight key | |||
#[clap(long = "key", default_value = "26aa394eea5630e07c48ae0c9558cef734abf5cb34d6244378cddbf18e849d96")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This key is needed here.
You can probably add it to the BenchmarkParams
there.
@@ -1,3 +1,4 @@ | |||
{{header}} | |||
// This file is part of Substrate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 2 to 17 can now be removed as they are already in the root file HEADER-APACHE2
. Then we can actually use the correct copyright header in Polkadot and Cumulus 😆
Same as in utils/frame/benchmarking-cli/src/pallet/template.hbs
.
@@ -23,6 +24,7 @@ | |||
//! WARMUPS: `{{params.bench.warmup}}`, REPEAT: `{{params.bench.repeat}}` | |||
//! WEIGHT-PATH: `{{params.weight.weight_path}}` | |||
//! WEIGHT-METRIC: `{{params.weight.weight_metric}}`, WEIGHT-MUL: `{{params.weight.weight_mul}}`, WEIGHT-ADD: `{{params.weight.weight_add}}` | |||
//! WASM-EXECUTION-METHOD: `{{execution_strategy}}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that this always prints something, even when --execution native
is used.
I'm not sure if its possible to print the executor name so Native
or WASM
instead of the WASM strategy, but would be nice.
@@ -96,21 +100,28 @@ impl OverheadCmd { | |||
BA: ClientBackend<Block>, | |||
C: BlockBuilderProvider<BA, Block, C> + ProvideRuntimeApi<Block>, | |||
C::Api: ApiExt<Block, StateBackend = BA::State> + BlockBuilderApi<Block>, | |||
<<<Block as BlockT>::Header as HeaderT>::Number as std::str::FromStr>::Err: std::fmt::Debug, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont see where this is needed, maybe stale code?
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
Fixes paritytech/polkadot-sdk#391