@@ -261,7 +261,8 @@ func makeCallVariantGasCallEIP7702(oldCalculator gasFunc) gasFunc {
261
261
}
262
262
263
263
// Check if code is a delegation and if so, charge for resolution.
264
- if dd , ok := evm .intraBlockState .GetDelegatedDesignation (addr ); ok {
264
+ dd , ok := evm .intraBlockState .GetDelegatedDesignation (addr )
265
+ if ok {
265
266
var ddCost uint64
266
267
if evm .intraBlockState .AddAddressToAccessList (dd ) {
267
268
ddCost = params .ColdAccountAccessCostEIP2929
@@ -296,56 +297,3 @@ func makeCallVariantGasCallEIP7702(oldCalculator gasFunc) gasFunc {
296
297
return gas , nil
297
298
}
298
299
}
299
-
300
- func gasEip7702CodeCheck (evm * EVM , contract * Contract , stack * stack.Stack , mem * Memory , memorySize uint64 ) (uint64 , error ) {
301
- addr := libcommon .Address (stack .Peek ().Bytes20 ())
302
- // The warm storage read cost is already charged as constantGas
303
- // Check slot presence in the access list
304
- var cost uint64
305
- if evm .intraBlockState .AddAddressToAccessList (addr ) {
306
- // Check if code is a delegation and if so, charge for resolution
307
- cost = params .ColdAccountAccessCostEIP2929 - params .WarmStorageReadCostEIP2929
308
- }
309
-
310
- if dd , ok := evm .intraBlockState .GetDelegatedDesignation (addr ); ok {
311
- if evm .intraBlockState .AddAddressToAccessList (dd ) {
312
- cost += params .ColdAccountAccessCostEIP2929
313
- } else {
314
- cost += params .WarmStorageReadCostEIP2929
315
- }
316
- }
317
-
318
- return cost , nil
319
- }
320
-
321
- func gasExtCodeCopyEIP7702 (evm * EVM , contract * Contract , stack * stack.Stack , mem * Memory , memorySize uint64 ) (uint64 , error ) {
322
- // memory expansion first (dynamic part of pre-2929 implementation)
323
- gas , err := gasExtCodeCopy (evm , contract , stack , mem , memorySize )
324
- if err != nil {
325
- return 0 , err
326
- }
327
- addr := libcommon .Address (stack .Peek ().Bytes20 ())
328
- // Check slot presence in the access list
329
- if evm .intraBlockState .AddAddressToAccessList (addr ) {
330
- var overflow bool
331
- // We charge (cold-warm), since 'warm' is already charged as constantGas
332
- if gas , overflow = math .SafeAdd (gas , params .ColdAccountAccessCostEIP2929 - params .WarmStorageReadCostEIP2929 ); overflow {
333
- return 0 , ErrGasUintOverflow
334
- }
335
- }
336
-
337
- // Check if addr has a delegation and if so, charge for resolution
338
- if dd , ok := evm .intraBlockState .GetDelegatedDesignation (addr ); ok {
339
- var overflow bool
340
- if evm .intraBlockState .AddAddressToAccessList (dd ) {
341
- if gas , overflow = math .SafeAdd (gas , params .ColdAccountAccessCostEIP2929 ); overflow {
342
- return 0 , ErrGasUintOverflow
343
- }
344
- } else {
345
- if gas , overflow = math .SafeAdd (gas , params .WarmStorageReadCostEIP2929 ); overflow {
346
- return 0 , ErrGasUintOverflow
347
- }
348
- }
349
- }
350
- return gas , nil
351
- }
0 commit comments