For the complete documentation index, see llms.txt. This page is also available as Markdown.

Overview

MegaEVM specification index — dual gas model, resource limits, gas detention, system contracts, and per-spec behavioral history.

This page summarizes the current MegaEVM behavior. The linked concept pages are the authoritative specification for each behavior.

Stable Scope

This page describes the current MegaEVM behavior. For full per-upgrade behavioral deltas, see Network Upgrades.

Specifications

Inheritance Boundary

MegaEVM builds on Optimism Isthmus (Ethereum Prague). Unless explicitly overridden by the MegaETH specification, standard EVM behavior is inherited from that baseline.

Gas and Resource Model

MegaETH replaces the single-dimensional intuition of standard EVM gas with a two-dimensional model. Every transaction is charged for both compute gas and storage gas, and the transaction's total gas usage is the sum of those two components.

Storage-heavy operations such as state writes, code deposit, logs, and calldata therefore carry additional cost beyond inherited EVM compute gas. For the complete formulas, constants, SALT multiplier rules, and charging lifecycle, see Dual Gas Model.

Compute gas is not an independent gas schedule but a derived measurement of the inherited EVM gas. For the measurement window, the per-opcode metering classes, the non-opcode recording sites, and the exceed behavior, see Compute Gas Accounting.

Runtime Resource Limits and Accounting

In addition to the transaction's gas limit, MegaETH enforces separate runtime ceilings on compute gas, data size, KV updates, and state growth. These dimensions are tracked independently and limit execution even when the transaction still has remaining total gas.

The protocol distinguishes between:

  • resource limits, which define ceilings and enforcement outcomes, and

  • resource accounting, which defines how each dimension is counted during execution and across reverted call frames.

For limits, see Resource Limits. For counting rules, revert behavior, and deduplication rules, see Resource Accounting.

Gas Detention

MegaETH restricts post-access computation after a transaction reads volatile data. This includes block-environment data, beneficiary-related access, and oracle-backed data.

The purpose of gas detention is to bound the amount of compute gas that may follow access to shared, conflict-prone inputs. For the detention categories, cap semantics, and halt conditions, see Gas Detention.

Execution Semantics Overrides

MegaEVM inherits the baseline semantics of Optimism Isthmus / Ethereum Prague, but overrides selected execution behaviors. The current stable differences include gas forwarding, contract size limits, precompile pricing overrides, and SELFDESTRUCT semantics.

Gas Forwarding

CALL-like opcodes and CREATE/CREATE2 use the 98/100 forwarding rule in current stable behavior. This differs from the standard EVM's 63/64 forwarding rule. The 98/100 rule was introduced in Rex for stable behavior. For the exact forwarding rule, stipend interaction, and opcode scope, see Gas Forwarding.

SELFDESTRUCT

SELFDESTRUCT follows EIP-6780 semantics. If the contract was created in the same transaction, SELFDESTRUCT removes code and storage and transfers the balance. Otherwise it transfers the balance only and preserves code and storage. This behavior became part of MegaETH in Rex2. For the full stable semantics and earlier MiniRex disablement, see SELFDESTRUCT.

Contract Limits

Limit
Value

Max contract size

524,288 bytes (512 KB)

Max initcode size

548,864 bytes (512 KB + 24 KB)

These enlarged limits were introduced in MiniRex. For the exact limits and rejection rules, see Contract Limits.

Precompiles

Precompile
Address
Stable MegaETH-Specific Behavior

KZG Point Evaluation

0x0A

100,000 gas

ModExp

0x05

EIP-7883 gas schedule

These stable overrides are part of the current behavior. For the full precompile specification, including the inherited baseline and MegaETH-specific differences, see Precompiles.

Built-In Protocol Interfaces

MegaETH predeploys the following stable system contracts:

Contract
Address
Since
Purpose

Oracle

0x6342000000000000000000000000000000000001

MiniRex

Off-chain data key-value storage

High-Precision Timestamp

0x6342000000000000000000000000000000000002

MiniRex

Sub-second timestamp oracle service

KeylessDeploy

0x6342000000000000000000000000000000000003

Rex2

Deterministic cross-chain deployment

MegaAccessControl

0x6342000000000000000000000000000000000004

Rex4

Volatile-data access control

MegaLimitControl

0x6342000000000000000000000000000000000005

Rex4

Query remaining compute-gas budget

SequencerRegistry

0x6342000000000000000000000000000000000006

Rex5

Dual-role registry for system address and sequencer keys

For the full registry and behavioral semantics, see System Contracts Overview.

Last updated