@@ -41,6 +41,8 @@ pub trait Patch {
4141 /// If true, only consume at maximum l64(after_gas) when
4242 /// CALL/CALLCODE/DELEGATECALL.
4343 fn call_create_l64_after_gas ( ) -> bool ;
44+ /// Maximum size of the memory, in bytes.
45+ fn memory_limit ( ) -> usize ;
4446 /// Precompiled contracts at given address, with required code,
4547 /// and its definition.
4648 fn precompileds ( ) -> & ' static [ ( Address , Option < & ' static [ u8 ] > , Box < Precompiled > ) ] ;
@@ -79,6 +81,7 @@ impl Patch for FrontierPatch {
7981 fn has_delegate_call ( ) -> bool { false }
8082 fn err_on_call_with_more_gas ( ) -> bool { true }
8183 fn call_create_l64_after_gas ( ) -> bool { false }
84+ fn memory_limit ( ) -> usize { usize:: max_value ( ) }
8285 fn precompileds ( ) -> & ' static [ ( Address , Option < & ' static [ u8 ] > , Box < Precompiled > ) ] {
8386 ETC_PRECOMPILEDS . deref ( ) }
8487}
@@ -99,6 +102,7 @@ impl Patch for HomesteadPatch {
99102 fn has_delegate_call ( ) -> bool { true }
100103 fn err_on_call_with_more_gas ( ) -> bool { true }
101104 fn call_create_l64_after_gas ( ) -> bool { false }
105+ fn memory_limit ( ) -> usize { usize:: max_value ( ) }
102106 fn precompileds ( ) -> & ' static [ ( Address , Option < & ' static [ u8 ] > , Box < Precompiled > ) ] {
103107 ETC_PRECOMPILEDS . deref ( ) }
104108}
@@ -119,6 +123,7 @@ impl Patch for VMTestPatch {
119123 fn has_delegate_call ( ) -> bool { false }
120124 fn err_on_call_with_more_gas ( ) -> bool { true }
121125 fn call_create_l64_after_gas ( ) -> bool { false }
126+ fn memory_limit ( ) -> usize { usize:: max_value ( ) }
122127 fn precompileds ( ) -> & ' static [ ( Address , Option < & ' static [ u8 ] > , Box < Precompiled > ) ] {
123128 ETC_PRECOMPILEDS . deref ( ) }
124129}
@@ -139,6 +144,7 @@ impl Patch for EIP150Patch {
139144 fn has_delegate_call ( ) -> bool { true }
140145 fn err_on_call_with_more_gas ( ) -> bool { false }
141146 fn call_create_l64_after_gas ( ) -> bool { true }
147+ fn memory_limit ( ) -> usize { usize:: max_value ( ) }
142148 fn precompileds ( ) -> & ' static [ ( Address , Option < & ' static [ u8 ] > , Box < Precompiled > ) ] {
143149 ETC_PRECOMPILEDS . deref ( ) }
144150}
@@ -159,6 +165,7 @@ impl Patch for EIP160Patch {
159165 fn has_delegate_call ( ) -> bool { true }
160166 fn err_on_call_with_more_gas ( ) -> bool { false }
161167 fn call_create_l64_after_gas ( ) -> bool { true }
168+ fn memory_limit ( ) -> usize { usize:: max_value ( ) }
162169 fn precompileds ( ) -> & ' static [ ( Address , Option < & ' static [ u8 ] > , Box < Precompiled > ) ] {
163170 ETC_PRECOMPILEDS . deref ( ) }
164171}
0 commit comments