Questions tagged [benchmarking]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
33 views

Exported method Benchmark_benchmark_metadata is not found

Upon upgrading dependencies from polkadot-v1.0.0 to polkadot-v1.3.0, we encounnter this error when we try to run benchmarks: cargo build --release --features runtime-benchmarks ./target/release/...
brenzi's user avatar
  • 513
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
1 vote
0 answers
30 views

Get weights data from a benchmarked pallet

Is there a way to get some informations for an already benchmarked pallet on the weights like the minimum and maximum weights that can be used for a function (worst case/best case) ?
SailorSnoW's user avatar
0 votes
1 answer
35 views

Weight consumed inside the on_idle hook?

The documentation of the on_idle hook states that "Any implementation should always respect _remaining_weight and never consume (and therefore return) more than this amount." In the ...
Benjamin Gallois's user avatar
1 vote
0 answers
22 views

Run benchmark fail test in pallet-evm

test_benchmarks fail Repo: https://github.com/paritytech/frontier Command: cargo t -p pallet-evm --features runtime-benchmarks Issue: failures: ---- benchmarking::benchmark_tests::test_benchmarks ...
CocDap's user avatar
  • 658
2 votes
1 answer
34 views

Witness data for Benchmarking

I have been looking into the hrmp pallets where some of the extrinsics needs to have a witness data variable provided as a parameter. Example: /// Total number of opening channels must be provided as ...
Alex Bean's user avatar
  • 5,629
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
1 vote
0 answers
51 views

Error when trying to run benchmarks on runtime but no in test benchmarks

i´m writing benchmarks for a pallet that manages sending tokens from assets pallet from one account to other. I have written the benchmarks and run it with no problem using the command: cargo test -p ...
Xavier's user avatar
  • 405
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
1 vote
1 answer
40 views

Weight for an extrinsic that schedule another call in the future?

I have an extrinsic for a poll that will end in the future. I used scheduller pallet to make the end of the poll execute. The end of the poll is then made by a root call. Should I add the weight of ...
Xavier's user avatar
  • 405
0 votes
1 answer
23 views

Do struct allocations' weight consumption depend linearly on input data length?

I am writing some benchmarking code and I came across a situation where I had to benchmark a few let bindings. let sig = ...; let data : Vec<u8> = vec![...]; // data is actually variable. Ranges ...
Purple_Turtle's user avatar
2 votes
1 answer
30 views

How does the benchmarking code add_benchmarks! work on the runtime?

I am trying to understand the runtime-benchmarks gated code on the runtime/src/lib.rs and I realize that we need to "list" and "add" benchmarks that we want to perform : https://...
b0zero's user avatar
  • 533
1 vote
1 answer
24 views

How to generate database weights?

As a chain grows the DB operations should get costlier. Is there a standard procedure that outlines how to generate these weights? Or should we continue using the default substrate weights for this ...
Purple_Turtle's user avatar
2 votes
1 answer
41 views

Benchmarking an extrinsic that validates a signature

I have an extrinsic in one of my pallets that looks validates a signature over a message, which is separate from the actual extrinsic being submitted. The code can be simplified to look like the below ...
Nate Armstrong's user avatar
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
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
1 vote
1 answer
25 views

How to account for ensure_signed calls?

Let's say our pallet dispatchable returns DispatchResultWithPostInfo, where we are trying to manually calculate the weight, albeit with helpers obtained from benchmarking, but that's not relevant to ...
Purple_Turtle'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
0 votes
1 answer
52 views

Who are whitelisted_callers?

On benchmarks one can often see whitelisted_caller() being used to test extrinsics and I wonder, how do they bypass the need for fee, and even pay for extrinsics like transfer_keep_alive for ...
Purple_Turtle'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
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
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
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
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
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
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
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
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
2 votes
1 answer
56 views

Estimated proof size less than measured

I was running some benchmark, and noticed that the estimated proof size was less than the measured size, despite MaxEncodedLen being used in this crate. The estimation of 0 is clearly wrong, but this ...
Sander's user avatar
  • 402
2 votes
1 answer
92 views

What is Dev Mode? And how can I use it?

I heard there is something called Dev Mode in Substrate for pallet development. What is Dev Mode? And how can I use it?
Bruno's user avatar
  • 8,260
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
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
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
246 views

1010: Invalid Transaction: Transaction would exhaust the block limits

How to specify limit weight for extrinsic?
rust.dev's user avatar
  • 509
0 votes
0 answers
50 views

Error: Input Runtime benchmarking wasn't enabled when building the node

I'm following along this benchmark docs to run benchmarking on my Substrate node (dependencies on branch = "polkadot-v0.9.25") with the command cargo build --release --features runtime-...
Kresna's user avatar
  • 71
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
0 votes
1 answer
29 views

How many (order of magnitude) Parachains can run on a Relaychain?

Does anyone have data/experience that indicates how many Substrate Parachains can run under one Substrate Relaychain? I understand this will be hardware specific, so it will help if you can give some ...
Begley Brothers Inc's user avatar
0 votes
1 answer
33 views

Use criterion for statistic driven benchmarking of Substrate pallets

Criterion version 0.4.0 seems to support WASM builds: https://www.tweag.io/blog/2022-03-03-criterion-rs/#first-class-wasm-support Can we us it to benchmark extrinsics of Substrate pallets?
Achim's user avatar
  • 575
0 votes
0 answers
20 views

How do i generate signatures in benchmarking.rs? [duplicate]

I am trying to generate an sr25519 signature within benchmarks. But i am facing an error that doesn't make sense to me. let sig: T::Signature = acc_pair.sign(&schema.encode()); | -...
master chief's user avatar
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
1 vote
1 answer
97 views

What reference hardware can a parachain use to benchmark & generate weights?

The 2022 tracking issue for Substrate benchmarks mentions that Polkadot uses this reference hardware of this specification to generate weights: Reference Hardware The transaction weights in Polkadot ...
Nuke's user avatar
  • 1,831
0 votes
1 answer
62 views

How to decrease time it takes to benchmark?

I have the following benchmark that takes a very long time to complete. What measures can I take to improve the time it takes to run the benchmark without losing its effectiveness? on_initialize { ...
Yatusabes's user avatar
  • 766
2 votes
1 answer
70 views

Benchmark weights output

Can someone please explain the following output: Why did the weights generate a zero input? Weight::from_ref_time(0 as u64) What is the fastest way to eyeball this and conclude whether these weights ...
Yatusabes's user avatar
  • 766
0 votes
1 answer
19 views

What does #[skip_meta] do?

I notice some benchmarks in Frame have #[skip_meta]. What does this macro do? Please explain when one should use this macro when benchmarking.
Yatusabes's user avatar
  • 766
2 votes
1 answer
82 views

How to benchmark functions with multiple logical paths? [duplicate]

The purpose of a benchmarking functions is to find the resources consumed by a functions in the worst case scenario. Is there any tools/methodlogy available so that , we can find the most resource ...
Syed Kamran's user avatar
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