1

I have just ran benchmarks and updated all the weights of the pallets in my parachain... or have I?

How can I verify that all my changes "bite"? Is there a way to check the weights of a running chain and detect if some extrinsics still evaluates to the default e.g. 10_000?

Included the parachain tag, I'm not sure if that is important.

2 Answers 2

2

You can use the queryInfo RPC enpoint to get weight of a particular extrinsic.

3
  • This returns summary: Retrieves the fee information for an encoded extrinsic witch is close but it is not practical to use for this.
    – Simson
    Commented Nov 9, 2022 at 2:48
  • @Simson, check the full context for this answer, github.com/paritytech/substrate/pull/11819 I do feel that it could be helpful for your scenario Commented Nov 9, 2022 at 11:07
  • @Simson I believe it contains weight as one of the fields of the returned struct. See the code Commented Nov 9, 2022 at 13:57
1

A Call itself does not have a weight but only a weight annontation in the form of #[pallet::weight(…)].
A Dispatchable, which is a combination of a Call and its encoded arguments, has a concrete weight since the weight can depend on the arguments.
The difference is that this a Call has a formula with variables as weight, not a constant.
So you cannot say how much concrete weight a call has. Further to this the benchmarking functions do not always 1:1 map to calls, which makes it more difficult to compare.

SWC https://github.com/ggwpez/substrate-weight-compare (eg deployed to https://weights.tasty.limo/compare-mr) can compare this if you set the Evaluation Method to Base which will set all possible components to zero and calculate the concrete value per Call.
However it does this on a source-code level, not a WASM runtime blob or running RPC node.
It could therefore still happen that you just forget to use the weights in the runtime file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.