2

Fees for transactions in our test net are too high and we would like to adjust them to be some factor lower across the board. Is there a simple way to do that using a call from the Polkadot.js apps interface? Or would that need to be set within the JSON or constants.rs file prior to chain start?

2 Answers 2

1

In general a runtime upgrade is the way to go, as @Purple_Turtle pointed out.
(You could also try to hack around it with System::set_storage to overwrite the fee multiplier with PolkadotJS, but that can go quite wrong.)

The exact change depends on what you want to adjust;

  1. The cost of the Weight that an extrinsic consumes:
    Weight is converted into a deducible amount of balance that the user pays for (aka fees).
    This is defined in the pallet_transaction_payment::Config::WeightToFee and LengthToFee configs. Polkadot uses Polynomials in the form of WeightToFeePolynomial for both, which then automatically implements the WeightToFee trait.
  2. The way the fee multiplier is adjusted in accord to block fullness:
    Substrate supports the adjusting of block fees depending on the utilization of your chain. This is also part of pallet_transaction_payment, namely FeeMultiplierUpdate. In Polkadot this is defined here, according to all the constants a few lines above. The fee multiplier for the next block is updated in the current block and adjusts to the target block fullness over time. The mechanisms is rather involved and implemented here. Fuller blocks will increase the multiplier over time and lower blocks will decrease it. Both withing limits.
1
  • Thank you, Oliver! Commented Dec 25, 2022 at 15:02
0

Fees defined as part of the runtime. A substrate chain allows you to upgrade your runtime, so you would be required to perform a runtime upgrade with the changes.

2
  • Got it! Do you know where in the runtime code one would adjust the fees? Commented Dec 24, 2022 at 15:09
  • 1
    Runtimes are unique for each chain, but see my answer below for a general answer. Please include some source links into future questions for easier answering. Commented Dec 25, 2022 at 10:47

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.