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

Fix small issues on benchmark overhead command #11893

Conversation

omadoyeabraham
Copy link
Contributor

Copy link
Member

@ggwpez ggwpez left a 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>,
Copy link
Member

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")]
Copy link
Member

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.
Copy link
Member

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}}`
Copy link
Member

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,
Copy link
Member

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?

@ggwpez ggwpez added A3-in_progress Pull request is in progress. No review needed at this stage. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit. labels Jul 25, 2022
@stale
Copy link

stale bot commented Aug 31, 2022

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.

@stale stale bot added the A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. label Aug 31, 2022
@stale stale bot closed this Sep 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A3-in_progress Pull request is in progress. No review needed at this stage. A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

☂️ Small benchmarking issues
2 participants