Skip to content

Commit

Permalink
fix: infinite test (#34)
Browse files Browse the repository at this point in the history
Test needs to have correct gas value for sstore, otherwise it makes
profit from refunds.
  • Loading branch information
joonazan authored May 23, 2024
1 parent e683ae8 commit 81185a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions benches/nested_near_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ fn nested_near_call(bencher: Bencher) {
fn nested_near_call_with_storage_write(bencher: Bencher) {
let program = Program::new(
vec![
Instruction::from_ergs_left(Register1(Register::new(1)), Arguments::new(Always, 0)),
Instruction::from_ergs_left(Register1(Register::new(1)), Arguments::new(Always, 5)),
Instruction::from_sstore(
// always use same storage slot to get a warm write discount
Register1(Register::new(0)),
Register2(Register::new(1)),
Arguments::new(Always, 0),
Arguments::new(Always, 5511), // need to use actual cost to not create free gas from refunds
),
Instruction::from_near_call(
// zero means pass all gas
Register1(Register::new(0)),
Immediate1(0),
Immediate2(0),
Arguments::new(Always, 10),
Arguments::new(Always, 25),
),
],
vec![],
Expand All @@ -76,7 +76,7 @@ fn nested_near_call_with_storage_write(bencher: Bencher) {
program,
Address::zero(),
vec![],
10_000_000,
80_000_000,
vm2::Settings {
default_aa_code_hash: [0; 32],
evm_interpreter_code_hash: [0; 32],
Expand Down

0 comments on commit 81185a5

Please sign in to comment.