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?
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.
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.