I was trying to modify the transaction fee and for that I only want the congestion of the network. In FeeDetails, that is present in the transaction-payment pallet, we have three fields, i.e., base_fee, len_fee, adjusted_weight_fee. The congestion of the network depends on adjusted_weight_fee, so for this purpose I only want that field. But I don't know how to set the other two fields to zero. Any suggestions would be helpful.
1 Answer
len_fee
is controlled by the TransactionByteFee
. This TransactionByteFee
is an associated type of the transaction-payment
Config
trait. If you set this to 0
, the len_fee
is 0
.
The base_fee
depends on the base_extrinsic
weight. This weight is then converted to the base_fee
. You control the base_extrinsic
weight by the BlockWeights
associated type. You need to change this type to have a base_extrinsic
weight for every transaction class and then you always have a base_fee
of 0
. In the "default" Substrate runtime this type is for example constructed here and then assigned here as type BlockWeights
.
-
-
in your links above, it seems the base_fee is fixed for ALL users. But I need to set it only for selected users. How to do it?– RussoSep 27, 2022 at 3:29
-
-
why? my boss told me so... I have a storage in a pallet to check which user can do x number of times feeless transactions. any advice?– RussoSep 28, 2022 at 5:40