1
0
Fork 0
forked from forks/go-ethereum
go-ethereum-modded-tocallarg/ethclient
Lee Bousfield c4f0450710
ethclient: Add EstimateGasAtBlock[Hash] to estimate against a specific block (#27508)
The main use case I see of this is that it allows users to estimate gas
against the same state that they query for their nonce, and the same
state they base the data of their transaction against. This helps ensure
that gas estimation won't fail and the transaction won't revert on-chain
because of a mismatch between the state used for gas estimation and the
state used to generate the inputs to gas estimation or the transaction's
nonce when submitted to the mempool.

This PR also updates the EstimateGas comment based on the new geth
`eth_estimateGas` default of using latest state as of v1.12.0:
https://github.com/ethereum/go-ethereum/pull/24363

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-03-18 15:41:34 +01:00
..
gethclient ethclient/gethclient: testcase for createAccessList, make tabledriven (#30194) 2024-11-08 13:28:16 +01:00
simulated eth/catalyst: set FeeRecipient in dev mode (#31316) 2025-03-17 09:32:44 +01:00
ethclient.go ethclient: Add EstimateGasAtBlock[Hash] to estimate against a specific block (#27508) 2025-03-18 15:41:34 +01:00
ethclient_test.go ethclient: Add EstimateGasAtBlock[Hash] to estimate against a specific block (#27508) 2025-03-18 15:41:34 +01:00
example_test.go ethclient: add RevertErrorData function and example (#30669) 2024-11-07 20:26:02 +01:00
signer.go ethclient: fix tx sender cache miss detection (#23877) 2021-11-17 14:44:41 +01:00
types_test.go ethclient: add RevertErrorData function and example (#30669) 2024-11-07 20:26:02 +01:00