@@ -13,6 +13,9 @@ use crate::{
1313 Instruction , World ,
1414} ;
1515
16+ // FIXME: use `zkevm_opcode_defs::system_params` once it's released
17+ const NEW_EVM_FRAME_MEMORY_STIPEND : u32 = 56 << 10 ;
18+
1619#[ derive( Debug ) ]
1720pub ( crate ) struct Callframe < T , W > {
1821 pub ( crate ) address : H160 ,
@@ -25,7 +28,6 @@ pub(crate) struct Callframe<T, W> {
2528 pub ( crate ) stack : Box < Stack > ,
2629 pub ( crate ) sp : u16 ,
2730 pub ( crate ) gas : u32 ,
28- pub ( crate ) stipend : u32 ,
2931 pub ( crate ) near_calls : Vec < NearCallFrame > ,
3032 pub ( crate ) pc : * const Instruction < T , W > ,
3133 pub ( crate ) program : Program < T , W > ,
@@ -68,15 +70,17 @@ impl<T, W> Callframe<T, W> {
6870 aux_heap : HeapId ,
6971 calldata_heap : HeapId ,
7072 gas : u32 ,
71- stipend : u32 ,
7273 exception_handler : u16 ,
7374 context_u128 : u128 ,
7475 is_static : bool ,
76+ is_evm_interpreter : bool ,
7577 world_before_this_frame : Snapshot ,
7678 ) -> Self {
7779 let is_kernel = is_kernel ( address) ;
7880 let heap_size = if is_kernel {
7981 NEW_KERNEL_FRAME_MEMORY_STIPEND
82+ } else if is_evm_interpreter {
83+ NEW_EVM_FRAME_MEMORY_STIPEND
8084 } else {
8185 NEW_FRAME_MEMORY_STIPEND
8286 } ;
@@ -99,7 +103,6 @@ impl<T, W> Callframe<T, W> {
99103 heaps_i_am_keeping_alive : vec ! [ ] ,
100104 sp : 0 ,
101105 gas,
102- stipend,
103106 exception_handler,
104107 near_calls : vec ! [ ] ,
105108 world_before_this_frame,
@@ -253,7 +256,6 @@ impl<T, W> Clone for Callframe<T, W> {
253256 stack : self . stack . clone ( ) ,
254257 sp : self . sp ,
255258 gas : self . gas ,
256- stipend : self . stipend ,
257259 near_calls : self . near_calls . clone ( ) ,
258260 pc : self . pc ,
259261 program : self . program . clone ( ) ,
@@ -279,7 +281,6 @@ impl<T, W> PartialEq for Callframe<T, W> {
279281 && self . stack == other. stack
280282 && self . sp == other. sp
281283 && self . gas == other. gas
282- && self . stipend == other. stipend
283284 && self . near_calls == other. near_calls
284285 && self . pc == other. pc
285286 && self . program == other. program
0 commit comments