MEGAETHDOCS
GitHubGet started →
Architecture

Gas Model

MegaETH separates compute and storage gas to better model state pressure and maintain realtime performance.

Dimensions

TypeDefinitionIntrinsic tx cost
Compute GasExecution costs similar to standard EVM opcodes21,000
Storage GasCosts for persistent storage creation/change39,000

Minimum tx floor is 60,000 gas (21,000 compute + 39,000 storage). Tooling assumptions based on 21,000 intrinsic cost will fail.

Storage-Sensitive Operations

OperationStorage GasNotes
SSTORE (zero → nonzero)39,000 × mm is bucket multiplier
SSTORE (nonzero → nonzero)0Reusing nonzero slots avoids storage gas
CREATE / CREATE2variesScales with deployed bytecode and state effects
Most other opcodes0Compute gas only

Best Practices

1

Estimate on MegaETH RPC

Always call eth_estimateGas against MegaETH endpoints.

2

Skip non-MegaEVM simulation when needed

For scripts, use --skip-simulation and explicit gas limits where local simulation diverges.

3

Use transient storage for ephemeral data

Prefer TSTORE/TLOAD patterns when values do not need persistence after transaction completion.

Was this page helpful?

Edit on GitHub