Crates.io | revmc |
lib.rs | revmc |
version | 0.1.0 |
source | src |
created_at | 2024-06-19 18:11:21.65601 |
updated_at | 2024-06-27 16:15:07.74638 |
description | EVM bytecode compiler |
homepage | https://github.com/danipopes/revmc/tree/main/crates/revmc |
repository | https://github.com/danipopes/cranelift-jit-evm |
max_upload_size | |
id | 1277260 |
size | 136,582 |
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.
This repository hosts two backend implementations:
revmc-llvm
): main backend with full test coverage;revmc-cranelift
); currently not functional due to missing i256
support in Cranelift. This will likely require a custom fork of Cranelift.pacman -S llvm
brew install llvm@17
prefix=$(llvm-config --prefix)
# or
#prefix=$(llvm-config-17 --prefix)
# on macOS:
#prefix=$(brew --prefix llvm@17)
export LLVM_SYS_170_PREFIX=$prefix
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.
The initial compiler implementation was inspired by paradigmxyz/jitevm
.