5

Hi I am building a solo chain by using the substrate node template but i am stuck here that i wanna change the gas fee to 0 of every transaction that is happening on the chain this chain will be a private chain so there is no issue of security. Can some one tell me that how can i change the gas fee of the chain to zero gas less transactions. I have tried adding the custom fee into weight files but it did not work so can someone help me out to tell me how can i achieve this on a node template of substrate

1 Answer 1

4

Weight and Fees are two independant concepts in Substrate. It is entirely possible to use one without the other.

Transaction payments in Substrate are done through a Signed Extension; ChargeTransactionPayment.
Here is an example of how it is configured in the Polkadot runtime here:

pub type SignedExtra = (
    ...
    pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
);

If you want to omit transaction fees, the only thing necessary is to remove the signed extension from the runtime. This entails also un-deploying pallet-transaction-payment, since its logic is no longer used.

Note that omitting fee payments will also remove the possibility of prioritizing transactions through a tip.

2
  • hey @Oliver Tale-Yazdi Is there any other way, without removing the pallet_transaction_payment in SingedExtra I was looking for a place where I could set the gas fees to zero I have also gone through this Shawn's answer
    – Mojo
    Oct 9, 2023 at 16:48
  • Yea I guess setting the convert function to zero also works. Then there is a pallet in the runtime without any use, so i would remove it. Oct 25, 2023 at 18:24

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.