Skip to content

fix: skip simulation for non-localhost foundry deploys - #446

Merged
rin-st merged 2 commits into
mainfrom
fix/foundry-deploy-skip-simulation
Oct 13, 2026
Merged

rin-st merged 2 commits into
mainfrom
fix/foundry-deploy-skip-simulation

Conversation

@ZakGriffith

@ZakGriffith ZakGriffith commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Foundry deploys to Sepolia fail with out-of-gas since the Glamsterdam fork repriced state creation (EIP-8037). Forge simulates Ethereum chains with the evm_version from foundry.toml (default osaka) and never looks at the target chain's active fork, so its gas estimates are wrong whenever the two differ: osaka under-estimates on Sepolia, and setting amsterdam globally would over-estimate on mainnet and L2s that haven't activated it.

This adds --skip-simulation to the non-localhost deploy command so gas limits come from the node's eth_estimateGas, which is correct on every network regardless of which forks it has activated. A revert still fails at estimation before anything is broadcast. A comment above the deploy target explains the flag and when it can be removed (once forge resolves the Ethereum hardfork from the RPC, or once Amsterdam is active on every network in foundry.toml).

Trade-off: skipping simulation makes the broadcast sequential and drops the pre-broadcast cost summary. Noted in the changeset.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@rin-st

rin-st commented Oct 13, 2026

Copy link
Copy Markdown
Member

Thanks Zak, here's AI review, add those updates please

Approach is right, two things before merging:

  1. Description is off: evm_version = "amsterdam" exists since foundry 1.8.0. The real issue is that forge simulates Ethereum chains with the evm_version from foundry.toml (default osaka) and never looks at the target chain's fork. osaka under-estimates on Sepolia, amsterdam would over-estimate on mainnet/L2s. Worth fixing the text.

  2. Add a comment above deploy: so generated projects know why the flag is there and when to drop it:

# Non-localhost deploys use --skip-simulation: forge simulates with evm_version from
# foundry.toml, not the target chain's fork, so it under-estimates gas on Amsterdam
# chains (EIP-8037). Remove once forge resolves the Ethereum hardfork from the RPC
# or once Amsterdam is active on every network in foundry.toml.
deploy:

FYI: the flag makes broadcast sequential and drops the pre-broadcast cost summary. Fine, maybe mention in the changeset.

Forge simulates Ethereum chains with the evm_version from foundry.toml
rather than the target chain's fork, so it under-estimates gas on
Amsterdam chains (EIP-8037). Add a comment above the deploy target so
generated projects know why the flag is there and when to drop it, and
correct the changeset wording (evm_version = "amsterdam" exists since
foundry 1.8.0; the issue is fork resolution, not a missing value).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@rin-st

rin-st commented Oct 13, 2026

Copy link
Copy Markdown
Member

Thanks! Merging. The change will take effect once we manually release a new version. Also, for SRE we'll need to bump the create-eth version after that.

@rin-st
rin-st merged commit 500607f into main Oct 13, 2026
7 checks passed
@rin-st
rin-st deleted the fix/foundry-deploy-skip-simulation branch October 13, 2026 14:26
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