From 81185a545635f9bd23d05878b56049baea20903b Mon Sep 17 00:00:00 2001 From: Joonatan Saarhelo Date: Thu, 23 May 2024 19:34:07 +0100 Subject: [PATCH] fix: infinite test (#34) Test needs to have correct gas value for sstore, otherwise it makes profit from refunds. --- benches/nested_near_call.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/benches/nested_near_call.rs b/benches/nested_near_call.rs index eaf3554d..1ab3e189 100644 --- a/benches/nested_near_call.rs +++ b/benches/nested_near_call.rs @@ -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![], @@ -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],