Questions tagged [benchmarking]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
10 votes
3 answers
328 views

How to generate `WeightInfo` for pallets?

Some pallets configure this field like so : type WeightInfo = pallet_pallet_name::weights::SubstrateWeight<Runtime>; However I've seen some runtimes in which they have an extra WeightInfo module ...
Purple_Turtle's user avatar
9 votes
1 answer
232 views

Single node performance

I've a couple of questions: I'm running a the node-template on a machine that has 8 cores and 64GB of RAM and its using an SSD. I have some pallets working there and I'm using the python client to ...
andresvsm's user avatar
  • 1,104
8 votes
2 answers
216 views

Logging in benchmarking mode

I am implementing benchmark to calculate weight in my pallet and need to print some data I was trying to use if_std println! but got nothing. What the best way to make printouts for debugging ...
Boris Ivanov's user avatar
8 votes
1 answer
193 views

Performance tuning of Substrate node

I was recently wondering what kind of performance tuning options can be specified while building a Substrate node. Motivation for doing this is based on the benchmark I ran on machines that utilize ...
Petr Mensik's user avatar
7 votes
1 answer
473 views

What is the possible minimum block time?

Is there a way to determine/calculate what the minimum block time would be? If not, what could we consider before lowering the block time, and how to monitor the side effects of small block time? I ...
Burak's user avatar
  • 903
7 votes
1 answer
68 views

Proof Skipped in benchmark

We're updating our weights to weights 2.0 but we're getting a lot of Proof Skipped lines in the output. What is the impact of this, and how do we fix it? Example output: /// Proof Skipped: Escrow ...
Sander's user avatar
  • 402
7 votes
1 answer
154 views

How does the benchmark calculate the proof size?

I have no idea why this call uses such a lot proof size (around 4MB). It looks like it doesn't change too many storage items. https://github.com/darwinia-network/darwinia-messages-substrate/blob/...
AurevoirXavier's user avatar
6 votes
1 answer
114 views

How do I get weight for my pallet?

I developed a pallet with one extrinsic: #[pallet::weight(0)] pub fn sum(_: OriginFor<T>, values: Vec<u64>) { // Sum up `values` } The Extrinsic accepts a vector and uses it. ...
Oliver Tale-Yazdi's user avatar
6 votes
1 answer
74 views

Benchmarking multiple instances

We have two instances of a pallet with different runtime configurations. How can we run the benchmarks separately to generate two distinct sets of weights? As far as I can tell this is not possible ...
Gregory Hill's user avatar
6 votes
1 answer
114 views

cannot create module: instance allocation for this module requires 74376 bytes which exceeds the configured maximum of 65536 bytes

Try in to benchmark node pallets after Polkadot upgrade from 0.9.36 to 0.9.38 and get cannot create module: instance allocation for this module requires 74376 bytes which exceeds the configured ...
Dzmitry Lahoda's user avatar
5 votes
2 answers
159 views

Hardware: Benchmark Standard vs Ecosystem Nodes

During the last Substrate Builders Program Office Hours, the Mangata team raised awareness around some potential confusion around the Substrate Benchmarking System and how it is being applied in the ...
Bernardo Rodrigues's user avatar
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
5 votes
1 answer
142 views

Benchmark session pallet fails without pallet_staking

my lovely Substrate-Heros, at the moment I try to benchmark the FRAME pallets of our custom runtime. Unfortunately, I ran into an error while benchmarking the session pallet. I copied the ...
Janislav's user avatar
  • 319
5 votes
2 answers
128 views

Large event payloads unsafe?

Premise Substrate will, by default, store every event in a block in a storage value Event of type Vec<EventRecord> in the system module, which involves reading & writing this full vector ...
Bedeho Mender's user avatar
5 votes
1 answer
166 views

Unable to run election provider multiphase benchmark

I am trying to benchmark pallet_election_provider_multi_phase and after quite some time of normal running I get this error which halts the benchmark: Running Benchmark: ...
Purple_Turtle'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
5 votes
1 answer
51 views

frame-benchmarking::v2 doesn't work for force_origin

In Config of my pallet I have: type FilteredOrigin: EnsureOriginWithArg< Self::RuntimeOrigin, SomeEnum, Success = Self::AccountId >; And there is an ...
Данила Алексеев's user avatar
5 votes
0 answers
37 views

Benchmarks not getting skipped with Err(BenchmarkError::Skip)

I am using the pallet_xcm_benchmarks, in the config for pallet_xcm_benchmarks::generic, I have used impl pallet_xcm_benchmarks::generic::Config for Runtime { fn worst_case_asset_exchange() -> ...
hooda's user avatar
  • 51
5 votes
2 answers
117 views

Runtime api not available just after client creation? Exported method is not found

I am trying to incorporate benchmark overhead command to our parachain. The issue i have is that runtime api methods are not available right away after client is created. https://github.com/mangata-...
Mateusz Nowakowski's user avatar
4 votes
1 answer
59 views

How to benchmark frame-system on parachain?

After upgrading the Substrate to polkadot-v0.9.43. I got the following error while running the runtime benchmarks. 2023-07-21 19:55:56 Starting benchmark: frame_system::set_code Error: Input("...
AurevoirXavier's user avatar
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
4 votes
1 answer
38 views

Associated types in benchmark `where` bound

I'm trying to constrain the value of an associated type of a trait inside a benchmark's where bound, like this: #[benchmarks(where T: currency::Config<Balance = u128>)] pub mod benchmarks { ...
Sander's user avatar
  • 402
4 votes
3 answers
92 views

Custom benchmarks for external pallets

We use some external pallets that are highly configurable. The weight of the extrinsics in these pallets is highly dependent on the callback supplied in the config, and the existing benchmarks don't ...
Sander's user avatar
  • 402
4 votes
1 answer
62 views

Benchmarking generates files with possibly missing or unnecessary trait impls

After building my node (tag monthly-10-2021) with --features runtime-benchmarks and/or --all-features, I tried to run benchmarks for the pallets and then use them for WeightInfo on various pallet ...
Purple_Turtle's user avatar
4 votes
1 answer
77 views

Missing XCM benchmark `reserve_asset_deposited`

I'm upgrading our parachain based on Polkadot 0.9.40 here. Now in the process of benchmarking xcm operations, I notice there is no benchmark for reserve_asset_deposited in XCM fungible benchmarks! I ...
Alex Sed's user avatar
  • 580
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
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
3 votes
1 answer
156 views

Missing `successful_origin` in implementation when running runtime-benchmarks

With a fresh substrate-parachain-template I ran cargo build --features runtime-benchmarks I got errors from a deep dependency in pallet_society, which doesn't seem relevant to the parachain-template's ...
Ramsey - Decentration's user avatar
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
3 votes
1 answer
119 views

How to see the hardware benchmark results?

Substrate has introduced a flag called --no-hardware-benchmarks to disable automatic hardware benchmarks. This implies if the flag is not set, the benchmark should run automatically at startup and ...
Alex Sed's user avatar
  • 580
3 votes
1 answer
100 views

Using another pallet calls for FRAME-based benchmarking

I need to mint an NFT and create metaverse for our auction pallet benchmarking. Both of these are handled by external pallet functionality and wondered if there is a FRAME-base benchmarking solution ...
chexware's user avatar
  • 325
3 votes
1 answer
180 views

How to mock trait in benchmarking

Can you tell me how to mock a trait in benchmarking? We have a pallet which takes NFTTrait as one of the configs. See below. #[pallet::config] pub trait Config: frame_system::Config { ...
Jerry Ren's user avatar
3 votes
2 answers
57 views

How to use bounded_vec macro in benchmarking.rs

I was using substrate-node-template, and created some benchmarking functions. I was able to use bounded_vec macro in tests.rs but, can't able to use it in the benchmarking.rs file my code #![cfg(...
Mojo's user avatar
  • 95
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
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
1 answer
125 views

How to test my bench-marking functions?

I have written benchmarking functions from my pallet. How I can test these benchmarking functions please?
Syed Kamran's user avatar
3 votes
1 answer
68 views

Why would benchmarking a simple setter has a linear behaviour

I came across this basic example in the substrate repo, where a range 1..1000 is used when benchmarking it. The generated weights.rs shows fn set_dummy_benchmark(b: u32, ) -> Weight { Weight::...
Kailai's user avatar
  • 373
3 votes
1 answer
80 views

How to read the benchmark result?

A benchmark test for function with a param like this: runner_execute { let x in 1..10000000; ... let gas_limit_call = x as u64; }: { ... let call_runner_results = T::Runner::...
boundless-forest's user avatar
3 votes
1 answer
100 views

Error running benchmarks on substrate node

Hello guys I've been trying to benchmark my runtime but I keep stumbling on this error, so far I've tested it with balances, collective and babe, and I get the same error message. Most likely it's ...
Purple_Turtle's user avatar
3 votes
1 answer
76 views

Quadratic complexity in Benchmarking

I am trying to understand if quadratic complexity is bad (gives inaccurate results) when used for benchmarking: I have a pallet whose weight would ideally depend on x * y where x and y are lengths of ...
Purple_Turtle's user avatar
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
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
3 votes
1 answer
50 views

Block number in the benchmark code is 0, but is 1 in the running code

If I'm running a benchmark and I get the current block number from inside the benchmark code (i.e. in the setup before I actually call the call I'm trying to benchmark) using frame_system::Pallet::<...
Kyle's user avatar
  • 299
3 votes
2 answers
70 views

Get results of some std operations in benchmarks

We faced a situation the other day where we needed some result of std operations inside of our benchmarks. Specifically, we were looking to generate key pairs and signatures from types given by ...
Justin Frevert's user avatar
3 votes
1 answer
65 views

Error: "Did not find the benchmarking metadata" after building runtime for benchmarking

After upgrading our chain to polkadot 0.9.38 I managed to build the benchmarking using cargo build --release --features runtime-benchmarks but when I try to benchmark any pallet after the build I ...
chexware's user avatar
  • 325
3 votes
2 answers
96 views

Using Autogenerated Weights

I'm wondering about weights. The docs are quite outdated here and I do not understand what is going on. I've managed to create benchmarks and generate a weight.rs. https://github.com/paritytech/...
shredding's user avatar
  • 294
3 votes
0 answers
105 views

Cannot create a runtime on benchmark run

Using polkadot-v0.9.19 branch I've created benchmarks for a pallet, added it into runtime, compiled. On run of any of created benchmarks getting this error: Error: Service(Client(RuntimeApiError(...
Ivan Temchenko's user avatar
2 votes
2 answers
63 views

How to reference the function with udf type parameters from another pallet in benchmarking

Pallet token: #[pallet::config] pub trait Config: frame_system::Config + pallet_balances::Config { type TokenId: Member + Parameter + AtLeast32BitUnsigned ...
Ben2077's user avatar
  • 21
2 votes
1 answer
40 views

Weight selection for extrinsic in case of multiple bechmarks

In my benchmarks, I've written multiple benchmarks for an extrinsic to cover different scenarios, which gave me WeightIinfo for each of my benchmarks. Now the question here is how I can pick the worst ...
Pawan Bisht's user avatar
2 votes
1 answer
71 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