Architecture
Gas Model
MegaETH separates compute and storage gas to better model state pressure and maintain realtime performance.
Dimensions
| Type | Definition | Intrinsic tx cost |
|---|---|---|
| Compute Gas | Execution costs similar to standard EVM opcodes | 21,000 |
| Storage Gas | Costs for persistent storage creation/change | 39,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
| Operation | Storage Gas | Notes |
|---|---|---|
| SSTORE (zero → nonzero) | 39,000 × m | m is bucket multiplier |
| SSTORE (nonzero → nonzero) | 0 | Reusing nonzero slots avoids storage gas |
| CREATE / CREATE2 | varies | Scales with deployed bytecode and state effects |
| Most other opcodes | 0 | Compute 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