Skip to content

docs: deploy gas on Ethereum L1 after the Amsterdam upgrade - #527

Open
gretzke wants to merge 1 commit into
mainfrom
docs/amsterdam-l1-deploy-gas
Open

gretzke wants to merge 1 commit into
mainfrom
docs/amsterdam-l1-deploy-gas

Conversation

@gretzke

@gretzke gretzke commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Linear: ROUTE-2217 (item 1).

The README has a new section for deployments on a chain that runs the Amsterdam (Glamsterdam) upgrade. EIP-8037 adds state gas for deployed code (1,530 gas per byte), so a large contract needs more than 2^24 gas. The forge script simulation uses the configured evm_version (cancun in this repo) and sets a gas limit that is too low. The section says to add --skip-simulation, so forge takes each gas limit from eth_estimateGas on the RPC node. It also says that --gas-limit sets the block gas limit of the local simulation, not the transaction gas limit, and that the deployer needs more ETH (37,435,950 gas with Amsterdam rules against 5,253,854 with Osaka rules for the example).

The numbers come from a v4 PoolManager deployment through forge script and the CREATE2 factory:

Path Gas limit Gas used Result
--broadcast (local simulation, forge 1.5.0 and 1.8.6) 7,256,884 6,968,987 reverted
--broadcast --skip-simulation 49,427,194 (anvil estimate times 1.3) 37,435,950 success

I ran both on a mainnet fork with an anvil that applies the Amsterdam gas rules. Then I checked the same transaction with eth_simulateV1 on Sepolia (Geth v1.17.8, reth v2.7.0, v2.8.0 and v2.8.1). The real clients estimate 37,734,228 gas. The transaction succeeds at 1.3 times this value (49,054,496) and reverts at 7,256,884. I did not run the Universal Router deploy scripts themselves. --skip-simulation exists with the same behavior in Foundry 1.3.6 to 1.5.0 (crates/script/src/broadcast.rs).

AI-Generated Description

Linear: ROUTE-2217 (item 1).

Summary

Adds a README section documenting how to deploy contracts on Ethereum L1 after the Amsterdam (Glamsterdam) upgrade.

Changes

  • README.md: New "Deploying on Ethereum L1 after the Amsterdam upgrade" section explaining that EIP-8037 adds state gas for deployed code (1,530 gas per byte), which pushes large contract deployments past the 2^24 gas threshold. Documents that forge script's local simulation uses the configured evm_version (older than Amsterdam), sets a gas limit that is too low, and causes the deployment to revert on chain. Recommends --skip-simulation so forge uses eth_estimateGas from the RPC node. Clarifies that --gas-limit sets the block gas limit of the local simulation, not the transaction gas limit.

Notes

  • Documentation only — no contract or script changes
  • Numbers come from a v4 PoolManager deployment through forge script and the CREATE2 factory: 37,435,950 gas with Amsterdam rules vs 5,253,854 gas with Osaka rules
  • Verified against mainnet fork (anvil with Amsterdam gas rules) and eth_simulateV1 on Sepolia (Geth v1.17.8, reth v2.7.0–v2.8.1)

Amsterdam (EIP-8037) adds state gas for deployed code. The README describes how to get a gas limit that is high enough (ROUTE-2217).
@gretzke
gretzke requested a review from a team as a code owner October 23, 2026 18:14
@linear-code

linear-code Bot commented Oct 23, 2026

Copy link
Copy Markdown

ROUTE-2217

This branch has not been deployed

No deployments
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.

1 participant