Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions prdoc/pr_8335.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title: Backport fix for pallet-multisig benchmarks
doc:
- audience: Runtime Dev
description: |-
Closes: https://github.com/paritytech/polkadot-sdk/issues/8334
Relates to: https://github.com/paritytech/polkadot-sdk/pull/6789
crates:
- name: pallet-multisig
bump: patch
21 changes: 10 additions & 11 deletions substrate/frame/multisig/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,14 @@ mod benchmarks {
Ok(())
}

/// `z`: Transaction Length, not a component
/// `s`: Signatories, need at least 2 people
#[benchmark]
fn approve_as_multi_create(
s: Linear<2, { T::MaxSignatories::get() }>,
z: Linear<0, 10_000>,
) -> Result<(), BenchmarkError> {
let (mut signatories, call) = setup_multi::<T>(s, z)?;
// The call is neither in storage or an argument, so just use any:
let call_len = 10_000;
let (mut signatories, call) = setup_multi::<T>(s, call_len)?;
let multi_account_id = Multisig::<T>::multi_account_id(&signatories, s.try_into().unwrap());
let caller = signatories.pop().ok_or("signatories should have len 2 or more")?;
let call_hash = call.using_encoded(blake2_256);
Expand All @@ -225,14 +225,15 @@ mod benchmarks {
Ok(())
}

/// `z`: Transaction Length, not a component
/// `s`: Signatories, need at least 2 people
#[benchmark]
fn approve_as_multi_approve(
s: Linear<2, { T::MaxSignatories::get() }>,
z: Linear<0, 10_000>,
) -> Result<(), BenchmarkError> {
let (mut signatories, call) = setup_multi::<T>(s, z)?;
// The call is neither in storage or an argument, so just use any:
let call_len = 10_000;
let (mut signatories, call) = setup_multi::<T>(s, call_len)?;
let mut signatories2 = signatories.clone();
let multi_account_id = Multisig::<T>::multi_account_id(&signatories, s.try_into().unwrap());
let caller = signatories.pop().ok_or("signatories should have len 2 or more")?;
Expand Down Expand Up @@ -270,14 +271,12 @@ mod benchmarks {
Ok(())
}

/// `z`: Transaction Length, not a component
/// `s`: Signatories, need at least 2 people
#[benchmark]
fn cancel_as_multi(
s: Linear<2, { T::MaxSignatories::get() }>,
z: Linear<0, 10_000>,
) -> Result<(), BenchmarkError> {
let (mut signatories, call) = setup_multi::<T>(s, z)?;
fn cancel_as_multi(s: Linear<2, { T::MaxSignatories::get() }>) -> Result<(), BenchmarkError> {
// The call is neither in storage or an argument, so just use any:
let call_len = 10_000;
let (mut signatories, call) = setup_multi::<T>(s, call_len)?;
let multi_account_id = Multisig::<T>::multi_account_id(&signatories, s.try_into().unwrap());
let caller = signatories.pop().ok_or("signatories should have len 2 or more")?;
let call_hash = call.using_encoded(blake2_256);
Expand Down
Loading