
Monad MIP-3: Linear EVM Memory Cost + 8MB Peak Cap — Predictable Gas, Explicit Invariants
Overview
Monad's MIP-3 proposes a fundamental change to EVM execution economics: reprice memory expansion from quadratic to linear, and enforce an explicit 8MB peak memory limit per transaction (across the call stack).
The motivation is practical: the current EVM model bounds memory via a quadratic expansion cost and the 63/64 rule, with a theoretical transaction memory limit "at least ~26MB," yet historical analysis shows typical usage is far lower (avg ~2KB, max observed ~2MB) and current pricing can overcharge compared to real resource usage. At the spec level, MIP-3 defines a new memory expansion charge based on word count: memory is rounded to 32-byte words, and cost becomes linear (memory_cost = memory_size_words // 2).
Context
The design pairs pricing with a hard safety invariant: each transaction is capped at 8MB peak memory, and memory is accounted across call contexts using an explicit "remaining memory" budget that subtracts both parent and current frame usage (8MB - j - k). In plain terms: child calls cannot silently push a transaction past a safe memory envelope; the chain enforces a ceiling.
The forum discussion focuses on the failure mode and developer ergonomics. Early language in the MIP said "revert," and the author argued for revert semantics partly for ERC-4337 bundler compatibility (avoid whole-bundle failure patterns).
Sources
- Linear pricing: memory expansion shifts to a linear model (memory_cost = words // 2) instead of quadratic.
- Hard ceiling: transaction peak memory is explicitly capped at 8MB, enforced across call contexts.
- Defined budgeting rule: child calls receive remaining_memory = 8MB - parent_used - current_used, making limits predictable and composable.
- Ops impact: cheaper memory up to the cap can shift RPC resource planning; thread guidance suggests bounding concurrency (e.g., 64 tx -> ~512MB worst-case).
