Skip to content

fix(anvil): handle eth_simulateV1 calls without to as contract creation - #15784

Merged
figtracer merged 1 commit into
masterfrom
mablr/oss-562-support-create-style-eth_simulatev1-calls
Jul 16, 2026
Merged

figtracer merged 1 commit into
masterfrom
mablr/oss-562-support-create-style-eth_simulatev1-calls

Conversation

@mablr

@mablr mablr commented Jul 16, 2026

Copy link
Copy Markdown
Member

Motivation

Close OSS-562.

This treats eth_simulateV1 calls without to as contract creation, allowing empty and from-only calls to produce returned transactions. Successful creation output is preserved, while reverts expose their bytes through the simulation error response.

Omitted-nonce progression remains tracked by OSS-561. Canonical returned transaction metadata, including chain ID, and exact revert-message conformance remain tracked by OSS-565.

Default calls without a recipient to contract creation and preserve revert output in the standardized simulation error response.

@mattsse mattsse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@figtracer
figtracer enabled auto-merge (squash) July 16, 2026 11:33
@figtracer
figtracer merged commit d280989 into master Jul 16, 2026
20 checks passed
@figtracer
figtracer deleted the mablr/oss-562-support-create-style-eth_simulatev1-calls branch July 16, 2026 11:50
@github-project-automation github-project-automation Bot moved this to Done in Foundry Jul 16, 2026
mmv08 added a commit to mmv08/viem that referenced this pull request Nov 2, 2026
CI pinned foundry to v1.7.1 (May 2026). Pin the latest release, v1.8.7,
and update the tests that depend on Anvil's output.

Snapshot updates (Anvil output changed):
- Receipts omit `blobGasPrice` on non-blob transactions.
- `eth_simulateV1` results include `maxUsedGas`, and the intrinsic-gas
  error gains an `err:` prefix.
- Unknown methods return -32601 "Method not found", and unknown
  subscription names return a new message.
- The unsigned `raw` from `eth_fillTransaction` carries a placeholder
  signature, so its hash changed.
- After `anvil_reset`, fills use the reset block's base fee, which changes
  the writeContracts hashes and one `effectiveGasPrice`.
- Anvil rejects a fill with only `maxPriorityFeePerGas`, so
  prepareTransactionRequest falls back to its own fee estimate.

Test changes:
- Transport tests call `eth_chainId` instead of `web3_clientVersion`.
  They test the RPC client, not the node, and the old snapshot held the
  Anvil version, so it broke on every bump.
- txpool tests look up checksummed addresses, as Anvil now returns them.
- `estimateGas` with only `maxPriorityFeePerGas` now asserts the node's
  rejection.
- The local-account insufficient-funds tests pass `gas`, since Anvil's
  estimate now caps gas by balance and fails first with another error.
- Anvil no longer forks zkSync Era, so `anvilZksync` runs a local chain
  with chain id 324 and `VITE_ANVIL_FORK_URL_ZKSYNC` is gone.
- The six `traceAssetChanges` tests in `simulateCalls` run again:
  v1.8.7 includes foundry-rs/foundry#15784, the `eth_simulateV1` fix
  they were skipped for.

Three local-account `estimateGas` tests still fail until Viem stops
sending both `gasPrice` and `maxFeePerGas` from a filled request.
jxom added a commit to wevm/viem that referenced this pull request Nov 2, 2026
chore(ci): pin foundry to v1.8.7

CI pinned foundry to v1.7.1 (May 2026). Pin the latest release, v1.8.7,
and update the tests that depend on Anvil's output.

Snapshot updates (Anvil output changed):
- Receipts omit `blobGasPrice` on non-blob transactions.
- `eth_simulateV1` results include `maxUsedGas`, and the intrinsic-gas
  error gains an `err:` prefix.
- Unknown methods return -32601 "Method not found", and unknown
  subscription names return a new message.
- The unsigned `raw` from `eth_fillTransaction` carries a placeholder
  signature, so its hash changed.
- After `anvil_reset`, fills use the reset block's base fee, which changes
  the writeContracts hashes and one `effectiveGasPrice`.
- Anvil rejects a fill with only `maxPriorityFeePerGas`, so
  prepareTransactionRequest falls back to its own fee estimate.

Test changes:
- Transport tests call `eth_chainId` instead of `web3_clientVersion`.
  They test the RPC client, not the node, and the old snapshot held the
  Anvil version, so it broke on every bump.
- txpool tests look up checksummed addresses, as Anvil now returns them.
- `estimateGas` with only `maxPriorityFeePerGas` now asserts the node's
  rejection.
- The local-account insufficient-funds tests pass `gas`, since Anvil's
  estimate now caps gas by balance and fails first with another error.
- Anvil no longer forks zkSync Era, so `anvilZksync` runs a local chain
  with chain id 324 and `VITE_ANVIL_FORK_URL_ZKSYNC` is gone.
- The six `traceAssetChanges` tests in `simulateCalls` run again:
  v1.8.7 includes foundry-rs/foundry#15784, the `eth_simulateV1` fix
  they were skipped for.

Three local-account `estimateGas` tests still fail until Viem stops
sending both `gasPrice` and `maxFeePerGas` from a filled request.

Co-authored-by: jxom <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants