Skip to content
Monpediaby Unity Nodes
OpenPull Request

MIP-7 `EXTENSION` decode

by khordadiCreated Oct 8, 2026category-labs/monad

ReferencesMIP-7MIP-18

Implements the MIP-7 EXTENSION (0xAE) decode at MONAD_NEXT. No selector is assigned yet, so every extended opcode still behaves as INVALID. EXE-232

  • 0xAE dispatches on its selector through a second opcode table. An unassigned or excluded selector is INVALID and is not consumed, so 0xAE 0x5B keeps its JUMPDEST. A compile-time check keeps 0x5B and PUSHn unassigned.
  • The compiler's selector table is the only list of assigned selectors. The interpreter builds its table from it, and the compiler decodes each assigned selector to its own OpCode (0x100 | selector), so the emitter switch covers every extension.
  • A trailing 0xAE has no selector and halts exceptionally, as MIP-7 requires. The interpreter's end-of-code check only becomes observable once a selector is assigned; MIP-18 in #2621, stacked on this, tests it.

馃 Generated with Claude Code