-
Notifications
You must be signed in to change notification settings - Fork 607
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Context execute * all integrated * clippy * derive more no_std * add correct caller/target address * no std * remove std from derive_more * init first bench * init precompiles * rm comments
- Loading branch information
Showing
58 changed files
with
1,791 additions
and
1,076 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
use database::BenchmarkDB; | ||
use std::time::Instant; | ||
|
||
use database::{BenchmarkDB, BENCH_CALLER, BENCH_TARGET}; | ||
use revm::{ | ||
bytecode::Bytecode, | ||
primitives::{TxKind, U256}, | ||
transact_main, Context, | ||
Context, ExecuteEvm, | ||
}; | ||
|
||
pub fn run() { | ||
let mut context = Context::builder() | ||
.with_db(BenchmarkDB::new_bytecode(Bytecode::new())) | ||
.modify_tx_chained(|tx| { | ||
// Execution globals block hash/gas_limit/coinbase/timestamp.. | ||
tx.caller = "0x0000000000000000000000000000000000000001" | ||
.parse() | ||
.unwrap(); | ||
tx.caller = BENCH_CALLER; | ||
tx.kind = TxKind::Call(BENCH_TARGET); | ||
tx.value = U256::from(10); | ||
tx.kind = TxKind::Call( | ||
"0x0000000000000000000000000000000000000000" | ||
.parse() | ||
.unwrap(), | ||
); | ||
}); | ||
let _ = transact_main(&mut context); | ||
let time = Instant::now(); | ||
let _ = context.exec_previous(); | ||
println!("First init: {:?}", time.elapsed()); | ||
|
||
let time = Instant::now(); | ||
let _ = context.exec_previous(); | ||
println!("Run: {:?}", time.elapsed()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.