Questions tagged [benchmark]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

Whitelisted keys when benchmarking extrinsic calls

There are a few storage keys that are always whitelisted before each benchmarking pallet extrinsic call (:transaction_level, :extrinsic_index, and :intrablock_entropy), apart from the whitelisted keys ...
lime's user avatar
  • 121
2 votes
1 answer
69 views

Testing benchmarks with V2

Im writing benchmarks for a pallet using benchmarking version 2. And it seems I cant call Pallet::<Test>::test_benchmarks_"extrinsic_name" inside of a test anymore. Is it no longer ...
Xavier's user avatar
  • 405
2 votes
1 answer
35 views

Benchmarking in a cusom pallet requires a storage put operation in Staking pallet

Let's say I have a pallet_x. In this pallet i have an extrinsic where I get the active_era using the below code : Staking::<T>::active_era() .map(|e| e....
Immanuel John's user avatar
4 votes
1 answer
30 views

Can we use std crates in benchmarking?

For benchmarking I can see a need to use random number generators for maybe verification of a random storage or such. Do we have utilities provided by the frame_benchmarking framework itself or is it ...
Purple_Turtle's user avatar
3 votes
1 answer
60 views

Can't write to StorageMap when benchmarking, EncodeLike is not implemented for any type even if it's the same in pallet

I have the following StorageMap defined in my pallet: #[pallet::storage] pub(super) type Signatures<T: Config> = StorageMap< _, Blake2_128Concat, T::Hash, BoundedBTreeMap<...
dadzerlaze's user avatar
  • 1,083
3 votes
2 answers
28 views

Does substrate offer benchmarking utilities in outer node?

I have some heavy computation done off-chain (in outer node) and i want to benchmark those functions, does substrate offer tools for doing it or should i rely on a third party library to do that?
dadzerlaze's user avatar
  • 1,083
4 votes
1 answer
68 views

How to create a bunch of key pairs when benchmarking?

I want to benchmark verifying sr25519 signatures and for that I need to create a bunch of key pairs, sign some data, then benchmark the verification process, however using sp_core::sr25519::Pair is ...
dadzerlaze's user avatar
  • 1,083
3 votes
1 answer
66 views

Benchmark failing extrinsics

Is there a way to benchmark an extrinsic whose expected behavior is to trigger an error? I stumbled on a project where we have two instances of the same pallet. Instance1 will proceed normally for a ...
Benjamin Gallois's user avatar
3 votes
1 answer
48 views

Reading from storage in weight annotation

We have an extrinsic where the complexity is dictated by the number of items held in storage. Is it appropriate to read from storage in the weight annotation? See for example: pub trait Tree<...
Gregory Hill's user avatar
4 votes
1 answer
50 views

How to benchmark a crate's WASM execution performance?

How to benchmark the code's WASM execution performance? I wrote a crate and want to use it in the runtime. I want to know its WASM execution time in ms. How can I get that?
AurevoirXavier's user avatar
3 votes
1 answer
58 views

`Currency::create_deposit` of `pallet_balance` fail on actual runtime but passes on mock rutime

The benchmark is written as: one_extrinsic { let caller: <T as frame_system::Config>::AccountId = make_account::<T>(1); assert_eq!( <T as crate::Config&...
Sudip Ghimire's user avatar
0 votes
1 answer
49 views

frame_benchmarking convert Vec to BoundedVec

I am unable to get benchmarks to work after changing an extrinsic argument from Vec<u8> to a custom type which is a BoundedVec defined in the pallet pallets config. Can someone provide me with ...
DJJ's user avatar
  • 63
2 votes
1 answer
52 views

`polkadot benchmark machine` does not pass (official documentation recommended configuration)

official configuration: https://wiki.polkadot.network/docs/maintain-guides-how-to-validate-polkadot#requirements We opened the appropriate server on aws according to the requirements in the official ...
99kies's user avatar
  • 753
0 votes
1 answer
43 views

How to benchmark huge bounded vectors?

I want to have a queue system in a pallet using a storage value and a bounded vector. /// Data related to tranmission queues. #[pallet::storage] #[pallet::getter(fn at_block_queue)] pub type ...
Leouarz's user avatar
  • 353
1 vote
1 answer
27 views

Build StorageProof for Benchmarks

Having some issues in fabricating a realistic StorageProof in substrate benchmarks. I can't use std and most examples are using std in tests via sp_state_machine. Currently, I've hard coded the (root, ...
nbaztec's user avatar
  • 197
2 votes
1 answer
62 views

why are complexity parameter or accounts seeding unnecessary for benchmarking transfers?

I am trying to understand why there is no complexity parameter on transfer benchmarks. The substrate benchmarks documentation states: For benchmarks, you want to execute the most computationally ...
Yatusabes's user avatar
  • 766
1 vote
1 answer
280 views

Cannot run benchmarking: "Did not find the benchmarking metadata."

I have problems with trying to benchmark my custom pallet. I tried different scenarios and received different errors: Using the same binary: I built my node with cargo build --release --features ...
pmikolajczyk41's user avatar
3 votes
1 answer
161 views

Access to ECDSA sign inside Runtime

Is there any way to access to ECDSA capabilities (like sign) inside the Runtime? I need to create benchmarks where the parameter of one extrinsic needs to be signed using ECDSA. I could create some '...
MigrosLiNX's user avatar
2 votes
1 answer
185 views

Error when trying to benchmark the substrate-node-template -- "Found argument 'Cargo.toml' which wasn't expected, or isn't valid in this context"

I'm trying to benchmark the pallet_template from the substrate-node-template example but am getting the error: Found argument 'Cargo.toml' which wasn't expected, or isn't valid in this context. I have ...
AKASH S M's user avatar
2 votes
1 answer
84 views

Use BoundedVec in benchmark

I have some code that benchmarks one of my extrinsic. benchmarks! { create_supersig { let z in 0 .. 10; let alice: T::AccountId = get_account::<T>("ALICE"); ...
Timothée Delabrouille's user avatar
5 votes
1 answer
236 views

How to weight `on_initialize`?

Is there any best practice how to count the weights in on_initialize correctly? I read through the Polkadot and Substrate on_initialize weight calculations and couldn't always figure out: When to ...
Chralt's user avatar
  • 543
3 votes
2 answers
59 views

benchmarks: Significant different between 99th and worst case

I'm running benchmark-cli storage tool to calculate average weights for DB read and writes and one thing that I've noticed is that there are significant difference between even 99th percentile and ...
Aramik M's user avatar
  • 129
2 votes
1 answer
34 views

Do I need to re-run frame-support weight constants?

I notice that frame-support has some constant weights: ExtrinsicBaseWeight RocksDbWeight BlockExecutionWeight ParityDbWeight (not using) Sean recommends that we run weights on all pallets as ...
Yatusabes's user avatar
  • 766
1 vote
0 answers
52 views

Can `benchmark overhead` support `pre-runtime digests`?

Our runtime uses an inherent which itself requires a pre-runtime digest to be present. I don't believe this is supported; from what I can tell, the benchmarking only handles the inherents provided by ...
notlesh's user avatar
  • 123
1 vote
1 answer
56 views

Why the state in benchmark didn't reset?

# steps to reproduce git clone https://github.com/darwinia-network/darwinia-common cd darwinia-common git checkout xavier/bench cargo build --release --features runtime-benchmarks target/release/drml ...
AurevoirXavier's user avatar
1 vote
0 answers
75 views

Error when trying to use an account in Benchmarks expected associated type, found enum `RawOrigin`

I have the following account initialisation on benchmarking.rs file. The following configuration works on mock.rs and test.rs files but getting errors in benchmarking pub(crate) fn test_pub(n: u8) -&...
not 0x12's user avatar
  • 353
2 votes
1 answer
84 views

How to benchmark pallet Grandpa?

at the moment I struggle a bit with the question of "How to benchmark the Grandpa pallet". Like it seems it's not possible to auto-generate weights at the moment (see here: https://github....
Janislav's user avatar
  • 319
3 votes
3 answers
134 views

How to create and mint assets in benchmarks

I am building a pallet which uses assets in a loosely-coupled manner. In the pallet's Config, there's an associated type Assets with Inspect and Transfer bounds. Now, when writing benchmarks, I need ...
Adam Wierzbicki's user avatar
2 votes
1 answer
50 views

What's the difference between add_benchmarks and add_benchmark?

I am trying to migrate my pallet over to the parachain template, and while adding it to the runtime I noticed a slight difference between how benchmarks are defined. On the old runtime, all (or most) ...
islami00's user avatar
  • 561
5 votes
1 answer
172 views

Benchmark FRAME pallets

Hello Substrate Experts, at the moment I try to figure out how to benchmark FRAME pallets for our runtime and I have basically three points that are not 100% clear to me. Based on my understanding it'...
Janislav's user avatar
  • 319
2 votes
2 answers
242 views

Benchmarking Mock

We’re trying to do the exact thing as referenced in How to mock trait in benchmarking, and we have implemented the struct + trait we need in our mocks, however, the benchmarks are calling the runtime ...
Yatusabes's user avatar
  • 766
2 votes
1 answer
52 views

Do benchmarks consider cached reads?

When running benchmarks do the result consider that multiple reads to the same value per block are cached as mentioned in the documentation referenced below? If caching is not considered in the ...
Yatusabes's user avatar
  • 766
0 votes
1 answer
67 views

Range in benchmarking

What if we don't provide range inside benchmark and provide 10 in steps while running benchmark? Is there any default range provided by framework or is there anything else will happen in this case?
Pawan Bisht's user avatar
1 vote
3 answers
124 views

Setting static parameter types in benchmarks

There is very little information to be found on static parameter types. All I could find is a docstring that says: In testing, StaticArgument can be altered later: StaticArgument::set(8). I need to ...
fbielejec's user avatar
  • 331
1 vote
2 answers
131 views

How do I access current block number within Benchmarks

Trying to establish this function to be able to run to a specific block to test progressive extrinsics across blocks to simulate real execution within benchmarks: while System::block_number() < ...
Kanthan's user avatar
  • 37
3 votes
2 answers
55 views

How do I pass a sp_runtime::traits::Hash value into benchmark function

pallet code: use sp_runtime::traits::{AccountIdConversion, Hash}; ....... ....... pub do_something(...) -> DispatchResultWithPostInfo { ...... } pub fn say_hello( ...
99kies's user avatar
  • 753
3 votes
2 answers
186 views

Error: Input("No benchmarks found which match your input.")

$ cargo build --release --features runtime-benchmarks $ ./target/release/dorafactory-node benchmark --chain dev --execution=wasm --wasm-execution=compiled --pallet pallet_template --extrinsic ...
99kies's user avatar
  • 753
2 votes
1 answer
46 views

Lower resulting weights, for substrate as is, upon benchmarking as compared to the weights file provided

We are using a machine, similar to reference: https://github.com/paritytech/substrate/pull/5848, to benchmark our runtime. To ascertain that our machine is close enough to the reference, we ran ...
Shoeb Siddiqui's user avatar
3 votes
2 answers
180 views

Benchmarking: RawOrigin::Root as AccountId

One of benchmarked extrinsic of custom pallet requires Root sender (or Sudo), uses pallet_assets from runtime trait implementation (no coupling here). To verify I'm using balance() method to confirm ...
Ivan Temchenko's user avatar