5

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 1

6

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.

4
  • could you give an example on how to set base_fee ?
    – Russo
    Sep 26, 2022 at 13:23
  • 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?
    – Russo
    Sep 27, 2022 at 3:29
  • You only want to have the base fee for some users? Why?
    – bkchr
    Sep 27, 2022 at 13:56
  • 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?
    – Russo
    Sep 28, 2022 at 5: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.