SkillAgentSearch skills...

Revmc

JIT and AOT compiler for the Ethereum Virtual Machine, built on Revm.

Install / Use

/learn @paradigmxyz/Revmc
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

revmc

Experimental JIT and AOT compiler for the Ethereum Virtual Machine.

The compiler implementation is abstracted over an intermediate representation backend. It performs very well, as demonstrated below from our criterion benchmarks, and exposes an intuitive API via Revm.

image

The compiler backend is abstracted behind a trait (revmc-backend), with an LLVM implementation (revmc-llvm) providing full test coverage.

Requirements

  • Latest stable Rust version

LLVM backend

  • Linux or macOS, Windows is not supported
  • LLVM 22
    • On Debian-based Linux distros: see apt.llvm.org
    • On Arch-based Linux distros: pacman -S llvm
    • On macOS: brew install llvm@22
    • The following environment variables may be required:
      prefix=$(llvm-config --prefix)
      # or
      #prefix=$(llvm-config-22 --prefix)
      # on macOS:
      #prefix=$(brew --prefix llvm@22)
      export LLVM_SYS_221_PREFIX=$prefix
      

Usage

The compiler is implemented as a library and can be used as such through the revmc crate.

A minimal runtime is required to run AOT-compiled bytecodes. A default runtime implementation is provided through symbols exported in the revmc-builtins crate and must be exported in the final binary. This can be achieved with the following build script:

fn main() {
    revmc_build::emit();
}

You can check out the examples directory for example usage.

Testing

The Ethereum state tests are included as a git submodule. The submodule is configured with update = none so it won't be cloned automatically.

To check it out:

git submodule update --init --checkout --depth 1 tests/ethereum-tests

Then run the state tests:

# All three modes (interpreter baseline, JIT, AOT):
cargo nextest run -p revmc -E 'test(statetest::)'

# A specific mode:
cargo nextest run -p revmc -E 'test(statetest::jit)'

# A specific test subdirectory:
SUBDIR=stSelfBalance cargo nextest run -p revmc -E 'test(statetest::jit)'

Credits

The initial compiler implementation was inspired by paradigmxyz/jitevm.

License

<sup> Licensed under either of <a href="LICENSE-APACHE">Apache License, Version 2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option. </sup> <br> <sub> Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in these crates by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. </sub>
View on GitHub
GitHub Stars262
CategoryDevelopment
Updated1h ago
Forks36

Languages

Rust

Security Score

100/100

Audited on Mar 29, 2026

No findings