Repository navigation
fix: skip simulation for non-localhost foundry deploys - #446
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thanks Zak, here's AI review, add those updates please Approach is right, two things before merging:
# 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>
|
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. |
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_versionfromfoundry.toml(defaultosaka) and never looks at the target chain's active fork, so its gas estimates are wrong whenever the two differ:osakaunder-estimates on Sepolia, and settingamsterdamglobally would over-estimate on mainnet and L2s that haven't activated it.This adds
--skip-simulationto the non-localhost deploy command so gas limits come from the node'seth_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 thedeploytarget 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 infoundry.toml).Trade-off: skipping simulation makes the broadcast sequential and drops the pre-broadcast cost summary. Noted in the changeset.