-
Notifications
You must be signed in to change notification settings - Fork 21.1k
miner, core, core/txpool: implement EIP 7825 - Transaction Gas Limit Cap #31824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
IMO the one thing missing here is test coverage. I'm thinking that some the test coverage will end up in hive tests, and STEEL can probably be responsible for implementing these. But as this PR is written now, there are edge-cases which probably need to be tested as unit tests: see my comment in |
ea7bbe4
to
af879b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
b6256ef
params/protocol_params.go
Outdated
CallValueTransferGas uint64 = 9000 // Paid for CALL when the value transfer is non-zero. | ||
CallNewAccountGas uint64 = 25000 // Paid for CALL when the destination address didn't exist prior. | ||
TxGas uint64 = 21000 // Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions. | ||
MaxTxGas uint64 = 30_000_000 // eip-7825 maximum transaction gas limit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This constant should not be in the middle of the list here, but have its own paragraph.
This PR makes 2 changes to how [EIP-7825](#31824) behaves. When `eth_estimateGas` or `eth_createAccessList` is called without any gas limit in the payload, geth will choose the block's gas limit or the `RPCGasCap`, which can be larger than the `maxTxGas`. When this happens for `estimateGas`, the gas estimation just errors out and ends, when it should continue doing binary search to find the lowest possible gas limit. This PR will: - Add a check to see if `hi` is larger than `maxTxGas` and cap it to `maxTxGas` if it's larger. And add a special case handling for gas estimation execute when it errs with `ErrGasLimitTooHigh` --------- Co-authored-by: Gary Rong <[email protected]>
Implements EIP-7825