-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[FRAME] Runtime Omni Bencher #3512
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
Changes from all commits
eedbe77
35a203a
1bab526
a0d27b8
b165650
e952e87
be0d71f
ca35646
9e52ca1
f9b3f13
b797ea2
9b00f0b
59cf796
351fa91
44c037f
8f66e72
96cdb1d
982ab5a
10cdffd
8cbd538
71e98bf
4d1dfbc
5ee9425
d3762e8
746c9b8
04133e6
ccdb8ff
59bddd1
b2e069d
29f2583
e7f4c21
7eeeee0
2d8203b
cbf5bd6
68d7e77
e0515a6
9ab5547
685e582
542d500
a4fef56
02f0514
b3507a7
a7717db
1a4db1a
86a40e4
10af924
76a8b0c
95b0e36
f04b21e
2e0e5e3
b420bdd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -231,7 +231,7 @@ pub struct HostConfiguration<BlockNumber> { | |
|
|
||
| impl<BlockNumber: Default + From<u32>> Default for HostConfiguration<BlockNumber> { | ||
| fn default() -> Self { | ||
| Self { | ||
| let ret = Self { | ||
| async_backing_params: AsyncBackingParams { | ||
| max_candidate_depth: 0, | ||
| allowed_ancestry_len: 0, | ||
|
|
@@ -270,7 +270,30 @@ impl<BlockNumber: Default + From<u32>> Default for HostConfiguration<BlockNumber | |
| minimum_backing_votes: LEGACY_MIN_BACKING_VOTES, | ||
| node_features: NodeFeatures::EMPTY, | ||
| scheduler_params: Default::default(), | ||
| } | ||
| }; | ||
|
|
||
| #[cfg(feature = "runtime-benchmarks")] | ||
| let ret = ret.with_benchmarking_default(); | ||
| ret | ||
| } | ||
| } | ||
|
|
||
| #[cfg(feature = "runtime-benchmarks")] | ||
| impl<BlockNumber: Default + From<u32>> HostConfiguration<BlockNumber> { | ||
| /// Mutate the values of self to be good estimates for benchmarking. | ||
| /// | ||
| /// The values do not need to be worst-case, since the benchmarking logic extrapolates. They | ||
| /// should be a bit more than usually expected. | ||
| fn with_benchmarking_default(mut self) -> Self { | ||
| self.max_head_data_size = self.max_head_data_size.max(1 << 20); | ||
| self.max_downward_message_size = self.max_downward_message_size.max(1 << 16); | ||
| self.hrmp_channel_max_capacity = self.hrmp_channel_max_capacity.max(1000); | ||
| self.hrmp_channel_max_message_size = self.hrmp_channel_max_message_size.max(1 << 16); | ||
| self.hrmp_max_parachain_inbound_channels = | ||
| self.hrmp_max_parachain_inbound_channels.max(100); | ||
| self.hrmp_max_parachain_outbound_channels = | ||
| self.hrmp_max_parachain_outbound_channels.max(100); | ||
| self | ||
|
Comment on lines
+288
to
+296
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe a comment about how this was derived, and how to keep it correclty updated?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also why and how was this not an issue so far? in the old code we didn't specialize any of these for benchmarks.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think these values are set properly in the chain spec. But not in the runtime genesis. |
||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| title: "[FRAME] Introduce Runtime Omni Bencher" | ||
|
|
||
| doc: | ||
| - audience: Node Dev | ||
| description: | | ||
| Introduces a new freestanding binary; the `frame-omni-bencher`. This can be used as alternative to the node-integrated `benchmark pallet` command. It currently only supports pallet benchmarking. | ||
|
|
||
| The optional change to integrate this MR is in the node. The `run` function is now deprecated in favour or `run_with_spec`. This should be rather easy to integrate: | ||
|
|
||
| ```patch | ||
| runner.sync_run(|config| cmd | ||
| - .run::<HashingFor<Block>, ReclaimHostFunctions>(config) | ||
| + .run_with_spec::<HashingFor<Block>, ReclaimHostFunctions>(Some(config.chain_spec)) | ||
| ) | ||
| ``` | ||
|
|
||
| Additionally, a new `--runtime` CLI arg was introduced to the `benchmark pallet` command. It allows to generate the genesis state directly by the runtime, instead of using a spec file. | ||
|
|
||
| crates: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems this isn't a complete list of changed crates? |
||
| - name: pallet-nis | ||
| bump: major | ||
| - name: frame-benchmarking-cli | ||
| bump: major | ||
| - name: polkadot-parachain-bin | ||
| bump: patch | ||
| - name: polkadot-cli | ||
| bump: patch | ||
| - name: polkadot-runtime-common | ||
| bump: patch | ||
| - name: polkadot-runtime-parachains | ||
| bump: patch | ||
| - name: rococo-runtime | ||
| bump: patch | ||
| - name: staging-node-cli | ||
| bump: patch | ||
| - name: kitchensink-runtime | ||
| bump: patch | ||
| - name: pallet-babe | ||
| bump: patch | ||
| - name: frame-benchmarking | ||
| bump: patch | ||
| - name: pallet-election-provider-multi-phase | ||
| bump: patch | ||
| - name: pallet-fast-unstake | ||
| bump: patch | ||
| - name: pallet-contracts | ||
| bump: patch | ||
Uh oh!
There was an error while loading. Please reload this page.