Configure Gas Fees
Learn how to configure gas fees in your EVM blockchain.
Benchmarks
You can take these numbers below as a benchmark:
Choose Your Own Values
gasLimit
In previous lessons, you learned that gas limits works as a restriction, capping on the amount of computation that can be done in a single block, hence will also cap the maximum transaction size, since the whole transaction needs to be processed in the same block.
Each of the values you choose, will depend in the use case you are addressing and how computational intensive it is. There are some reasons why you may want to increase or decrease the gas limit.
High Throughput: If your application requires a high volume of transactions to be performed, then you would want to allow for more transactions (i.e more computation) be packed in a single block.
Heavy Transactions: One kind of transaction that tend to use high amounts of gas, is contract deployments. If your application requires the deployment of really heave contracts or to perform complex transactions, then you need to make sure that your gasLimit
allows for the full execution of the deployment or heavy transaction.
Beware that higher computational allowance per block, could translate on higher demand on the hardware your blockchain is running. To make sure you have the best performance, keep this number according to your use case and the infra requirements you're setting for your validators, and don't choose a really big number "just in case". For reference, consider a single native token transaction cost around 21,000 gas units, and C-chain has this value set to 15,000,000.
Gas Price Parameters
[minBaseFee
, targetGas
, baseFee
, minBlockGasCost
, maxBlockGasCost
, targetBlockRate
, blockGasCostStep
]
These parameters are chosen in terms of how stable is the gas usage in your network. Remember that gas is here to protect the network from spam, the difficult part, is that the network is not smart enough to know wether a transaction is just regular activity or someone is trying to perform an attack.
The cost of transacting needs to dynamically adjust increasing during irregular activity timeframes. targetGas
and targetBlockRate
must be chosen according to the expected behavior of your use case in normal activity.