-
Notifications
You must be signed in to change notification settings - Fork 695
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
Follow up work on TransactionExtension
- fix weights and clean up UncheckedExtrinsic
#6418
Follow up work on TransactionExtension
- fix weights and clean up UncheckedExtrinsic
#6418
Conversation
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
bot bench-all substrate -v PIPELINE_SCRIPTS_REF=george/substrate-ext |
@georgepisaltu https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7726182 was started for your command Comment |
@georgepisaltu Command |
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.
Looks good to me, but one comment
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` | ||
|
||
// Executed Command: | ||
// ./target/debug/substrate-node |
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.
Lol these weights were def wrong.
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.
Yes it's a new and currently unused extension introduced in #3685 and those weights were generated on my machine just to make sure the benchmarks work.
.saturating_add(Weight::from_parts(155_577_516, 0).saturating_mul(v.into())) | ||
.saturating_add(T::DbWeight::get().reads(9010_u64)) | ||
.saturating_add(T::DbWeight::get().reads((9_u64).saturating_mul(v.into()))) | ||
.saturating_add(T::DbWeight::get().writes(7008_u64)) |
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.
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.
good find. this is indeed an error: https://github.com/paritytech/polkadot-sdk/pull/6025/files#r1839635371
I didn't review the weight carefully I will do another review.
a PR is opened: #6463
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 normally use this tool when comparing weights (have to run it locally when using forks).
It has a CLI and web version. Outputs for proof-size.pdf and ref-time.pdf. Url would be this for the self-hosted version.
// Minimum execution time: 229_000 picoseconds. | ||
Weight::from_parts(268_000, 0) | ||
// Minimum execution time: 0_000 picoseconds. | ||
Weight::from_parts(0, 0) |
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.
enable_auto_renew
went from quite a lot to zero.
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.
It was reading into Authorship::Author
and System::Digest
, which are now both whitelisted, but that shouldn't have anything to do with this result.
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.
Possibly one of the origins is set to NeverEnsure
and triggers the Weightless
path here:
.map_err(|_| BenchmarkError::Weightless)?; |
/// Storage: `Broker::Workplan` (r:0 w:1) | ||
/// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`) | ||
fn enable_auto_renew() -> Weight { | ||
fn disable_auto_renew() -> Weight { |
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.
disable_auto_renew
went from little to zero.
// Measured: `0` | ||
// Estimated: `0` | ||
// Minimum execution time: 2_846_000 picoseconds. | ||
Weight::from_parts(3_058_000, 0) |
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.
a bit surprising that this call do 0 read and writes.
there is a call apply_slash
that allows a reporter to apply a pending slash to a member account. It is quite unexpected that the operation doesn't read and write anything considering it seems possible the reporter is unrelated to the slashed account.
// Measured: `0` | ||
// Estimated: `0` | ||
// Minimum execution time: 2_858_000 picoseconds. | ||
Weight::from_parts(3_010_000, 0) |
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.
Also surprising that applying a slash doesn't read any storage.
// Minimum execution time: 759_000 picoseconds. | ||
Weight::from_parts(819_000, 0) | ||
// Minimum execution time: 2_719_000 picoseconds. | ||
Weight::from_parts(2_828_000, 0) |
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.
Also surprising that this operation doesn't read or write anything.
The caller is not related to the operation.
// Measured: `0` | ||
// Estimated: `0` | ||
// Minimum execution time: 2_776_000 picoseconds. | ||
Weight::from_parts(2_987_000, 0) |
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.
Also surprising that this operation doesn't read or write anything.
The caller is not related to the operation.
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
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.
The bridge modifications look good
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
…UncheckedExtrinsic` (#6418) Follow up to #3685 Partially fixes #6403 The main PR introduced bare support for the new extension version byte as well as extension weights and benchmarking. This PR: - Removes the redundant extension version byte from the signed v4 extrinsic, previously unused and defaulted to 0. - Adds the extension version byte to the inherited implication passed to `General` transactions. - Whitelists the `pallet_authorship::Author`, `frame_system::Digest` and `pallet_transaction_payment::NextFeeMultiplier` storage items as they are read multiple times by extensions for each transaction, but are hot in memory and currently overestimate the weight. - Whitelists the benchmark caller for `CheckEra` and `CheckGenesis` as the reads are performed for every transaction and overestimate the weight. - Updates the umbrella frame weight template to work with the system extension changes. - Plans on re-running the benchmarks at least for the `frame_system` extensions. --------- Signed-off-by: georgepisaltu <[email protected]> Co-authored-by: command-bot <> Co-authored-by: gui <[email protected]>
ae4b68b
Follow up to #3685
Partially fixes #6403
The main PR introduced bare support for the new extension version byte as well as extension weights and benchmarking.
This PR:
General
transactions.pallet_authorship::Author
,frame_system::Digest
andpallet_transaction_payment::NextFeeMultiplier
storage items as they are read multiple times by extensions for each transaction, but are hot in memory and currently overestimate the weight.CheckEra
andCheckGenesis
as the reads are performed for every transaction and overestimate the weight.frame_system
extensions.