@@ -59,7 +59,7 @@ def code_deposit_state_gas(cls, *, code_size: int) -> int:
5959 def create_state_gas (cls , * , code_size : int = 0 ) -> int :
6060 """Return total state gas for CREATE (EIP-8037)."""
6161 gas_costs = cls .gas_costs ()
62- return gas_costs .GAS_NEW_ACCOUNT + cls .code_deposit_state_gas (
62+ return gas_costs .NEW_ACCOUNT + cls .code_deposit_state_gas (
6363 code_size = code_size
6464 )
6565
@@ -82,17 +82,17 @@ def gas_costs(cls) -> GasCosts:
8282 return replace (
8383 parent ,
8484 # EIP-7928: block access list item cost
85- GAS_BLOCK_ACCESS_LIST_ITEM = 2000 ,
85+ BLOCK_ACCESS_LIST_ITEM = 2000 ,
8686 # EIP-8037: state gas folded into totals
87- GAS_STORAGE_SET = (
88- parent .GAS_COLD_STORAGE_WRITE
89- - parent .GAS_COLD_STORAGE_ACCESS
87+ STORAGE_SET = (
88+ parent .COLD_STORAGE_WRITE
89+ - parent .COLD_STORAGE_ACCESS
9090 + STATE_BYTES_PER_STORAGE_SET * cpsb
9191 ),
92- GAS_NEW_ACCOUNT = new_acct ,
93- GAS_CREATE = REGULAR_GAS_CREATE + new_acct ,
94- GAS_TX_CREATE = (REGULAR_GAS_CREATE + new_acct ),
95- GAS_AUTH_PER_EMPTY_ACCOUNT = (
92+ NEW_ACCOUNT = new_acct ,
93+ OPCODE_CREATE_BASE = REGULAR_GAS_CREATE + new_acct ,
94+ TX_CREATE = (REGULAR_GAS_CREATE + new_acct ),
95+ AUTH_PER_EMPTY_ACCOUNT = (
9696 PER_AUTH_BASE_COST
9797 + (STATE_BYTES_PER_NEW_ACCOUNT + STATE_BYTES_PER_AUTH_BASE )
9898 * cpsb
@@ -290,17 +290,14 @@ def _calculate_sstore_gas(
290290 current_value = original_value
291291 new_value = metadata ["new_value" ]
292292
293- gas_cost = (
294- 0 if metadata ["key_warm" ] else gas_costs .GAS_COLD_STORAGE_ACCESS
295- )
293+ gas_cost = 0 if metadata ["key_warm" ] else gas_costs .COLD_STORAGE_ACCESS
296294
297295 if original_value == current_value and current_value != new_value :
298296 gas_cost += (
299- gas_costs .GAS_COLD_STORAGE_WRITE
300- - gas_costs .GAS_COLD_STORAGE_ACCESS
297+ gas_costs .COLD_STORAGE_WRITE - gas_costs .COLD_STORAGE_ACCESS
301298 )
302299 else :
303- gas_cost += gas_costs .GAS_WARM_SLOAD
300+ gas_cost += gas_costs .WARM_SLOAD
304301
305302 return gas_cost
306303
@@ -356,9 +353,9 @@ def _calculate_sstore_refund(
356353
357354 if original_value == new_value :
358355 refund += (
359- gas_costs .GAS_COLD_STORAGE_WRITE
360- - gas_costs .GAS_COLD_STORAGE_ACCESS
361- - gas_costs .GAS_WARM_SLOAD
356+ gas_costs .COLD_STORAGE_WRITE
357+ - gas_costs .COLD_STORAGE_ACCESS
358+ - gas_costs .WARM_SLOAD
362359 )
363360
364361 return refund
@@ -404,7 +401,7 @@ def _calculate_return_gas(
404401 code_deposit_size = metadata ["code_deposit_size" ]
405402 if code_deposit_size > 0 :
406403 code_words = (code_deposit_size + 31 ) // 32
407- hash_gas = gas_costs .GAS_KECCAK256_PER_WORD * code_words
404+ hash_gas = gas_costs .OPCODE_KECCACK256_PER_WORD * code_words
408405 return hash_gas
409406 return 0
410407
0 commit comments