feat: ethclient gas estimation blocknumber param #25009
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds the blocknumber param to the
ethclient
'sgas estimation function. This lets users choose the block number
to estimate gas against. If
nil
is passed, thenpending
willbe used to preserve existing behavior.
Technically, a block tag can be used here but a blocknumber
is used for simplicity. Gas estimation takes similar params
as
eth_call
, and there are two different functions on theethclient
for doingeth_call
- one by block number andone by block hash.
The simulated backend is not updated to take into account
the block number parameter, it will still use the pending
state. That functionality can be added in the future if
desired.
Closes #25001