From 0da56dfd47877d8522e8956e2f545dc068af7053 Mon Sep 17 00:00:00 2001 From: Joonatan Saarhelo Date: Mon, 10 Jun 2024 22:09:44 +0200 Subject: [PATCH] generate small enough gas to fit EVM stipend --- src/single_instruction_test/callframe.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/single_instruction_test/callframe.rs b/src/single_instruction_test/callframe.rs index 143d5f42..39982ecc 100644 --- a/src/single_instruction_test/callframe.rs +++ b/src/single_instruction_test/callframe.rs @@ -4,6 +4,7 @@ use crate::{ }; use arbitrary::Arbitrary; use u256::H160; +use zkevm_opcode_defs::EVM_SIMULATOR_STIPEND; impl<'a> Arbitrary<'a> for Flags { fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result { @@ -28,7 +29,8 @@ impl<'a> Arbitrary<'a> for Callframe { is_kernel: is_kernel(address), stack: u.arbitrary()?, sp: u.arbitrary()?, - gas: u.arbitrary()?, + // It is assumed that it is always possible to add the stipend + gas: u.int_in_range(0..=u32::MAX - EVM_SIMULATOR_STIPEND)?, stipend: u.arbitrary()?, near_calls: vec![], program: u.arbitrary()?,