Corpus Core Docs

Stylus

Not implemented. eth_call uses the Ethereum host for every contract.

Stylus contracts share account, code hash, storage and logs with EVM contracts. Their code starts with a Stylus discriminant (0xEFF000… in the versions described by Nitro, with fragment and root prefixes when a program is split). The EVM host does not execute that code. Nitro runs it in a WASM engine after activation through ArbWasm, with ink metering. EVM and Stylus call each other through the normal ABI, so the engine cannot be chosen from the top-level to alone.

A Stylus build would add a second EVMC VM, selected by the code prefix, and would have to reproduce Nitro's instrumentation, the host imports, and the activation record in ArbOS state. Code and storage proofs stay ordinary account and storage proofs. The prover would have to record storage that Stylus host functions read, which does not pass through SLOAD.

The limits Nitro starts from are 128 kB of decompressed WASM, 128 memory pages, and 10000 ink per gas. Activation expires. Those parameters live in ArbOS state and move with governance, so a runtime has to take them from the proven state of the block.

Embedded targets stay on the Ethereum host: a program can ask for 8 MB of linear memory. Browser and server are the targets that can carry a WASM interpreter.

Open questions

  • Code prefixes per ArbOS version, the WASM features Nitro accepts, and the host-function list.
  • Where activation records and the ink parameters sit in ArbOS state.
  • Whether eth_createAccessList reports storage read by Stylus host functions and by ArbOS precompiles.