Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into clap
Browse files Browse the repository at this point in the history
  • Loading branch information
rakita committed Sep 11, 2024
2 parents c60f5bb + 077c2c3 commit c766e1a
Show file tree
Hide file tree
Showing 97 changed files with 4,046 additions and 2,607 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ jobs:
strategy:
fail-fast: false
matrix:
features: ["", "optimism,kzg-rs"]
features: ["", "kzg-rs"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: riscv32imac-unknown-none-elf
- run: cargo check --target riscv32imac-unknown-none-elf --no-default-features --features=${{ matrix.features }}
- run: |
cargo check --target riscv32imac-unknown-none-elf --no-default-features --features=${{ matrix.features }}
cargo check --target riscv32imac-unknown-none-elf -p revm-optimism --no-default-features --features=${{ matrix.features }}
check:
name: check ${{ matrix.features }}
Expand Down
120 changes: 79 additions & 41 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"crates/primitives",
"crates/interpreter",
"crates/precompile",
"crates/optimism",
]
resolver = "2"
default-members = ["crates/revm"]
Expand Down
2 changes: 1 addition & 1 deletion bins/revm-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ hex = "0.4"
revm = { path = "../../crates/revm", version = "14.0.1", default-features=false }
microbench = "0.5"
alloy-sol-macro = "0.8.0"
alloy-sol-types = "0.8.0"
alloy-sol-types = "0.8.2"
regex = "1.10.6"
eyre = "0.6.12"

Expand Down
6 changes: 3 additions & 3 deletions bins/revm-test/src/bin/analysis.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use revm::{
db::BenchmarkDB,
db::{BenchmarkDB, EthereumBenchmarkWiring},
interpreter::analysis::to_analysed,
primitives::{address, bytes, Bytecode, Bytes, TxKind},
Evm,
Expand All @@ -13,7 +13,7 @@ fn main() {
let bytecode_analysed = to_analysed(Bytecode::new_raw(contract_data));

// BenchmarkDB is dummy state that implements Database trait.
let mut evm = Evm::builder()
let mut evm = Evm::<EthereumBenchmarkWiring>::builder()
.modify_tx_env(|tx| {
// execution globals block hash/gas_limit/coinbase/timestamp..
tx.caller = address!("1000000000000000000000000000000000000000");
Expand All @@ -37,7 +37,7 @@ fn main() {

let mut evm = evm
.modify()
.reset_handler_with_db(BenchmarkDB::new_bytecode(bytecode_analysed))
.with_db(BenchmarkDB::new_bytecode(bytecode_analysed))
.build();

let timer = Instant::now();
Expand Down
8 changes: 5 additions & 3 deletions bins/revm-test/src/bin/burntpix/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use regex::bytes::Regex;
use revm::{
db::{CacheDB, EmptyDB},
primitives::{
address, hex, keccak256, AccountInfo, Address, Bytecode, Bytes, ExecutionResult, Output,
TxKind, B256, U256,
address, hex, keccak256, AccountInfo, Address, Bytecode, Bytes, EthereumWiring,
ExecutionResult, Output, TxKind, B256, U256,
},
Evm,
};
Expand All @@ -28,14 +28,16 @@ sol! {
}
}

type EthereumCacheDbWiring = EthereumWiring<CacheDB<EmptyDB>, ()>;

fn main() {
let (seed, iterations) = try_init_env_vars().expect("Failed to parse env vars");

let run_call_data = IBURNTPIX::runCall { seed, iterations }.abi_encode();

let db = init_db();

let mut evm = Evm::builder()
let mut evm = Evm::<EthereumCacheDbWiring>::builder()
.modify_tx_env(|tx| {
tx.caller = address!("1000000000000000000000000000000000000000");
tx.transact_to = TxKind::Call(BURNTPIX_MAIN_ADDRESS);
Expand Down
4 changes: 2 additions & 2 deletions bins/revm-test/src/bin/snailtracer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use revm::{
db::BenchmarkDB,
db::{BenchmarkDB, EthereumBenchmarkWiring},
interpreter::analysis::to_analysed,
primitives::{address, bytes, Bytecode, Bytes, TxKind},
Evm,
Expand All @@ -9,7 +9,7 @@ pub fn simple_example() {
let bytecode = to_analysed(Bytecode::new_raw(CONTRACT_DATA.clone()));

// BenchmarkDB is dummy state that implements Database trait.
let mut evm = Evm::builder()
let mut evm = Evm::<EthereumBenchmarkWiring>::builder()
.with_db(BenchmarkDB::new_bytecode(bytecode.clone()))
.modify_tx_env(|tx| {
// execution globals block hash/gas_limit/coinbase/timestamp..
Expand Down
Loading

0 comments on commit c766e1a

Please sign in to comment.