4

I noticed that signed extensions do not have weights associated to them.

Pallets like transaction-payment pallet use signed extension to withdraw fees but we do not apply weights to them. Why?

2 Answers 2

8

There is an ExtrinsicBaseWeight which is added to the weight of all extrinsics.
This is done to account for any weight that is not measured by the pallet benchmarks, like inherents or signature verification.

It is measured by executing many System::Remark extrinsics in a block and dividing by the number of extrinsics. Remark extrinsics do nothing and are therefore a good pick.
All inherents are applied in this measurement, otherwise the runtime would reject them.
More in-depth explanation is in the README of the sub-folder.

Analogous to this there is also a BlockExecutionweight, which does the same thing for blocks.

PS: Polkadot has its own constants, these Substrate constants are just as explanation.

1

From my understanding the signed extensions are applied in the transaction pool, i.e. on evaluation of the message before it is executed. Should the signed extensions pass, the transaction can be included in a block.

So at the point of evaluation, since it is not included (only validated to be included), there is no fee associated with it. Fees are only applied when it is included.

1
  • I was thinking something similar but then I thought about hooks like on_initialize and on_finalize do not have fees associated with them but we assign weights to them.
    – Yatusabes
    Commented May 31, 2022 at 16:40

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.