Skip to content

fix: estimateGas and sendTransaction failing on Anvil 1.8.5 and later - #5378

Merged
jxom merged 1 commit into
wevm:mainfrom
mmv08:claude/heuristic-swartz-83f367
Nov 2, 2026
Merged

jxom merged 1 commit into
wevm:mainfrom
mmv08:claude/heuristic-swartz-83f367

Conversation

@mmv08

@mmv08 mmv08 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

The execution-apis spec has eth_fillTransaction return gasPrice on EIP-1559 transactions, set equal to maxFeePerGas and marked deprecated (ethereum/execution-apis#803). It reports what the transaction would pay. It is not a fee to send back. Anvil follows the spec. fillTransaction kept the field, so fillTransaction and prepareTransactionRequest returned both fee fields together. Geth, reth and Anvil 1.8.5 and later reject a request that has both, with "both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified". This broke:

  • sendTransaction with a JSON-RPC account, given a request from prepareTransactionRequest.
  • estimateGas with a local account, when called with gas, or with a prepare list and a block or state override.

fillTransaction now drops gasPrice when the filled transaction has maxFeePerGas. Geth and reth leave the field out today. This change also covers them once they follow the spec. Anvil ignores type: 0x0 and 0x1 in fill requests and returns a type-2 transaction. So on Anvil, legacy and EIP-2930 requests now take their gasPrice from Viem's own estimate, as they already did on Geth and reth.

@vercel

vercel Bot commented Nov 2, 2026

Copy link
Copy Markdown

@mmv08 is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 29f7cc7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…ater

The execution-apis spec has `eth_fillTransaction` return `gasPrice` on
EIP-1559 transactions, set equal to `maxFeePerGas` and marked
deprecated (ethereum/execution-apis#803). It
reports what the transaction would pay. It is not a fee to send back.
Anvil follows the spec. `fillTransaction` kept the field, so
`fillTransaction` and `prepareTransactionRequest` returned both fee
fields together. Geth, reth and Anvil 1.8.5 and later reject a request
that has both, with "both gasPrice and (maxFeePerGas or
maxPriorityFeePerGas) specified". This broke:

- `sendTransaction` with a JSON-RPC account, given a request from
  `prepareTransactionRequest`.
- `estimateGas` with a local account, when called with `gas`, or with a
  `prepare` list and a block or state override.

`fillTransaction` now drops `gasPrice` when the filled transaction has
`maxFeePerGas`. Geth and reth leave the field out today. This change
also covers them once they follow the spec. Anvil ignores `type: 0x0`
and `0x1` in fill requests and returns a type-2 transaction. So on
Anvil, legacy and EIP-2930 requests now take their `gasPrice` from
Viem's own estimate, as they already did on Geth and reth.
@mmv08
mmv08 force-pushed the claude/heuristic-swartz-83f367 branch from 4f17c7f to 29f7cc7 Compare November 2, 2026 13:47
@jxom
jxom merged commit cbdd610 into wevm:main Nov 2, 2026
30 of 36 checks passed
This was referenced Nov 2, 2026
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.

2 participants