Skip to content

is gasLimit param should be defined or not.....? #4136

Closed Answered by ricmoo
moneyDev1111 asked this question in Q&A
Discussion options

You must be logged in to vote

The gasLimit has never changed in meaning. In the gas analogy, it is simply how big a gas tank to give your transaction. You pay upfront to fill it up (based on the transaction fee data, which has changed over time from gasPrice in legacy and type 1 transactions to maxFeePerGas and maxPriorityFeePerGas in type 2 (EIP-1559) transactions) and are refunded for any unused gas at the end of the transaction.

The gasLimit though should have no bearing on whether a tx gets included, since if the gas tank is too small it will just run out early, but the miner will have received payment for it despite your tx failing (running out of gas).

In ethers, leaving the gasLimit unspecified will result in e…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@ricmoo
Comment options

@moneyDev1111
Comment options

@ricmoo
Comment options

@moneyDev1111
Comment options

@ricmoo
Comment options

Answer selected by moneyDev1111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants