Skip to content

internal/ethapi: add MaxUsedGas field to eth_simulateV1 response#32789

Merged
s1na merged 3 commits intoethereum:masterfrom
Rhovian:eth-simulate-max-gas
Mar 4, 2026
Merged

internal/ethapi: add MaxUsedGas field to eth_simulateV1 response#32789
s1na merged 3 commits intoethereum:masterfrom
Rhovian:eth-simulate-max-gas

Conversation

@Rhovian
Copy link
Copy Markdown
Contributor

@Rhovian Rhovian commented Sep 29, 2025

closes #32741

@Rhovian
Copy link
Copy Markdown
Contributor Author

Rhovian commented Sep 30, 2025

@s1na I see @rjl493456442 assigned you to this, lmk if you'd like any changes or if I should just close, thanks

@s1na
Copy link
Copy Markdown
Contributor

s1na commented Oct 1, 2025

There are 2 points about this PR:

  • We first need to agree with other clients whether to add this field.
  • The implementation: the applyMessage result already contains the maxUsedGas field. You can use that.

@Rhovian
Copy link
Copy Markdown
Contributor Author

Rhovian commented Oct 1, 2025

There are 2 points about this PR:

  • We first need to agree with other clients whether to add this field.
  • The implementation: the applyMessage result already contains the maxUsedGas field. You can use that.

ah, I didn't realize this required coordination with other clients, I can also implement in reth.

will fix the implemntation issue, thanks

@s1na
Copy link
Copy Markdown
Contributor

s1na commented Dec 18, 2025

@Rhovian so how it works is we need to update the spec here to add the field: https://github.com/ethereum/execution-apis/pulls

And then ask clients e.g. in Eth r&d discord json rpc channel whether they are onboard with adding it.

@Rhovian
Copy link
Copy Markdown
Contributor Author

Rhovian commented Dec 18, 2025

hey @s1na happy to make the PR and adjust this one as needed but i would hope to leave client consensus up to you as im not connected

@s1na
Copy link
Copy Markdown
Contributor

s1na commented Dec 19, 2025

@Rhovian I can help with that

@Rhovian
Copy link
Copy Markdown
Contributor Author

Rhovian commented Jan 31, 2026

hey @s1na made the change you mentioned (using the result from applyMessage) and moved this along here:

ethereum/execution-apis#746

cc @levin-p

gakonst added a commit to alloy-rs/alloy that referenced this pull request Feb 17, 2026
Add optional `maxUsedGas` field to `SimCallResult`, mirroring
ethereum/execution-apis#746 and ethereum/go-ethereum#32789.

This field represents the maximum gas consumed during execution
before refunds are applied, enabling more accurate gas limit
estimation for complex transaction sequences.

Amp-Thread-ID: https://ampcode.com/threads/T-019c6b14-bfd0-71df-bce9-533057940778
Co-authored-by: Amp <[email protected]>
@Rhovian
Copy link
Copy Markdown
Contributor Author

Rhovian commented Mar 2, 2026

@s1na looks like this is moving along with prs in alloy & reth, lmk if I can be of assitance

@s1na s1na changed the title Add MaxUsedGas field to eth_simulateV1 response internal/ethapi: add MaxUsedGas field to eth_simulateV1 response Mar 3, 2026
@s1na s1na added this to the 1.17.2 milestone Mar 3, 2026
Copy link
Copy Markdown
Contributor

@s1na s1na left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks for pushing it through the process

@s1na s1na merged commit fc8c104 into ethereum:master Mar 4, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add MaxUsedGas field to eth_simulateV1 response

3 participants