File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -126,9 +126,14 @@ impl GasometerState {
126
126
gas_limit. as_u64 ( )
127
127
} ;
128
128
129
- let mut s = Self :: new ( gas_limit, false ) ;
130
129
let cost = TransactionCost :: call ( data, access_list) . cost ( config) ;
131
130
131
+ // EIP-7623: Check if gas limit meets the floor requirement
132
+ if config. eip7623_calldata_floor && gas_limit < cost. floor {
133
+ return Err ( ExitException :: OutOfGas . into ( ) ) ;
134
+ }
135
+
136
+ let mut s = Self :: new ( gas_limit, false ) ;
132
137
s. records_transaction_cost ( cost) ?;
133
138
Ok ( s)
134
139
}
@@ -146,9 +151,14 @@ impl GasometerState {
146
151
gas_limit. as_u64 ( )
147
152
} ;
148
153
149
- let mut s = Self :: new ( gas_limit, false ) ;
150
154
let cost = TransactionCost :: create ( code, access_list) . cost ( config) ;
151
155
156
+ // EIP-7623: Check if gas limit meets the floor requirement
157
+ if config. eip7623_calldata_floor && gas_limit < cost. floor {
158
+ return Err ( ExitException :: OutOfGas . into ( ) ) ;
159
+ }
160
+
161
+ let mut s = Self :: new ( gas_limit, false ) ;
152
162
s. records_transaction_cost ( cost) ?;
153
163
Ok ( s)
154
164
}
You can’t perform that action at this time.
0 commit comments