Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump revm-interpreter version to 1.1.1 #212

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@

evm-bench makes it easy to compare EVM performance in a scalable, standardized, and portable way.

| | evmone | revm | pyrevm | geth | py-evm.pypy | py-evm.cpython | ethereumjs |
| ----------------------- | ------ | ------ | ------ | ------ | ----------- | -------------- | ---------- |
| **sum** | 66ms | 84.8ms | 194ms | 235ms | 7.201s | 19.0886s | 146.3218s |
| **relative** | 1.000x | 1.285x | 2.939x | 3.561x | 109.106x | 289.221x | 2216.997x |
| | | | | | | | |
| erc20.approval-transfer | 7ms | 9.6ms | 16.2ms | 17ms | 425.2ms | 1.13s | 2.0006s |
| erc20.mint | 5ms | 6.4ms | 14.8ms | 17.2ms | 334ms | 1.1554s | 3.1352s |
| erc20.transfer | 8.6ms | 11.6ms | 22.8ms | 24.6ms | 449.2ms | 1.6172s | 3.6564s |
| snailtracer | 43ms | 53ms | 128ms | 163ms | 5.664s | 13.675s | 135.059s |
| ten-thousand-hashes | 2.4ms | 4.2ms | 12.2ms | 13.2ms | 328.6ms | 1.511s | 2.4706s |
| | evmone | revm | pyrevm | geth | py-evm.cpython | ethereumjs |
| ----------------------- | ------ | ------- | ------ | ------- | -------------- | ---------- |
| **sum** | 69.2ms | 100.4ms | 218ms | 231.4ms | 21.7272s | 31.3376s |
| **relative** | 1.000x | 1.451x | 3.150x | 3.344x | 313.977x | 452.855x |
| | | | | | | |
| erc20.approval-transfer | 7.4ms | 10.2ms | 21.8ms | 17.4ms | 1.374s | 1.8832s |
| erc20.mint | 5.2ms | 6.2ms | 16.8ms | 18.4ms | 1.2822s | 2.8656s |
| erc20.transfer | 8.6ms | 12ms | 24.4ms | 26ms | 1.8158s | 3.3676s |
| snailtracer | 45ms | 67ms | 143ms | 157ms | 15.455s | 21.592s |
| ten-thousand-hashes | 3ms | 5ms | 12ms | 12.6ms | 1.8002s | 1.6292s |

To reproduce these results, check out [usage with the evm-bench suite below](#with-the-evm-bench-suite).

Expand Down
56 changes: 15 additions & 41 deletions runners/revm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions runners/revm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ edition = "2021"
bytes = "1.4"
clap = { version = "4.2.2", features = ["derive"] }
hex = "0.4"
primitive-types = { version = "0.11", features = ["rlp"] }
# from branch primitives
revm-interpreter = { git = "https://github.com/bluealloy/revm", rev="3fda52e", package="revm-interpreter"}
primitive-types = { version = "0.12.1", features = ["rlp"] }
revm-interpreter = "1.1.1"

9 changes: 4 additions & 5 deletions runners/revm/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use revm_interpreter::{
primitives::{Bytecode, Env, LatestSpec, TransactTo, B160},
Contract, DummyHost, InstructionResult, Interpreter,
};
//use revm-interpreter::{}

extern crate alloc;

Expand Down Expand Up @@ -49,10 +48,10 @@ fn main() {
env.tx.transact_to = TransactTo::create();
env.tx.data = calldata.clone();

let bytecode = to_analysed::<LatestSpec>(Bytecode::new_raw(contract_code));
let bytecode = to_analysed(Bytecode::new_raw(contract_code));

// revm interpreter. (rakita note: should be simplified in one of next version.)
let contract = Contract::new_env::<LatestSpec>(&env, bytecode);
let contract = Contract::new_env(&env, bytecode);
let mut host = DummyHost::new(env.clone());
let mut interpreter = Interpreter::new(contract, u64::MAX, false);
let reason = interpreter.run::<_, LatestSpec>(&mut host);
Expand All @@ -66,8 +65,8 @@ fn main() {
env.tx.caller = caller_address;
env.tx.data = calldata;

let created_bytecode = to_analysed::<LatestSpec>(Bytecode::new_raw(created_contract));
let contract = Contract::new_env::<LatestSpec>(&env, created_bytecode);
let created_bytecode = to_analysed(Bytecode::new_raw(created_contract));
let contract = Contract::new_env(&env, created_bytecode);

for _ in 0..args.num_runs {
let mut interpreter = revm_interpreter::Interpreter::new(contract.clone(), u64::MAX, false);
Expand Down