File tree Expand file tree Collapse file tree
tests/benchmark/compute/precompile Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -722,9 +722,9 @@ def test_alt_bn128_uncachable(
722722 intrinsic_gas_calculator = fork .transaction_intrinsic_cost_calculator ()
723723 gsc = fork .gas_costs ()
724724 precompile_cost = (
725- gsc .GAS_PRECOMPILE_ECMUL
725+ gsc .PRECOMPILE_ECMUL
726726 if precompile_address == 0x07
727- else gsc .GAS_PRECOMPILE_ECADD
727+ else gsc .PRECOMPILE_ECADD
728728 )
729729 attack_block = Op .POP (
730730 Op .STATICCALL (
Original file line number Diff line number Diff line change @@ -121,8 +121,8 @@ def test_blake2f_uncachable(
121121 # BLAKE2F costs num_rounds gas.
122122 gsc = fork .gas_costs ()
123123 precompile_cost = (
124- num_rounds * gsc .GAS_PRECOMPILE_BLAKE2F_PER_ROUND
125- ) + gsc .GAS_PRECOMPILE_BLAKE2F_BASE
124+ num_rounds * gsc .PRECOMPILE_BLAKE2F_PER_ROUND
125+ ) + gsc .PRECOMPILE_BLAKE2F_BASE
126126
127127 attack_block = Op .POP (
128128 Op .STATICCALL (
Original file line number Diff line number Diff line change @@ -531,8 +531,8 @@ def test_bls12_pairing_uncachable(
531531 attack_contract_address = pre .deploy_contract (code = code )
532532
533533 precompile_cost = (
534- gsc .GAS_PRECOMPILE_BLS_PAIRING_BASE
535- + gsc .GAS_PRECOMPILE_BLS_PAIRING_PER_PAIR * num_pairs
534+ gsc .PRECOMPILE_BLS_PAIRING_BASE
535+ + gsc .PRECOMPILE_BLS_PAIRING_PER_PAIR * num_pairs
536536 )
537537
538538 iteration_cost = loop .gas_cost (fork ) + precompile_cost
@@ -545,8 +545,8 @@ def test_bls12_pairing_uncachable(
545545 tokens_per_variant = pair_size * 4 # worst case: all non-zero
546546 per_variant_gas = (
547547 iteration_cost
548- + tokens_per_variant * gsc .GAS_TX_DATA_TOKEN_FLOOR
549- + words_per_variant * (gsc .GAS_COPY + gsc .GAS_MEMORY )
548+ + tokens_per_variant * gsc .TX_DATA_TOKEN_FLOOR
549+ + words_per_variant * (gsc .OPCODE_COPY_PER_WORD + gsc .MEMORY_PER_WORD )
550550 )
551551 empty_intrinsic = intrinsic_gas_calculator (
552552 calldata = [],
@@ -579,7 +579,7 @@ def test_bls12_pairing_uncachable(
579579 per_tx_gas
580580 - execution_intrinsic
581581 - setup_cost
582- - math .ceil (len (calldata ) / 32 ) * gsc .GAS_COPY
582+ - math .ceil (len (calldata ) / 32 ) * gsc .OPCODE_COPY_PER_WORD
583583 - mem_exp (new_bytes = len (calldata ) + 32 )
584584 )
585585
Original file line number Diff line number Diff line change @@ -86,9 +86,9 @@ def test_identity_uncachable(
8686
8787 precompile_cost = (
8888 # static cost
89- gsc .GAS_PRECOMPILE_IDENTITY_BASE
89+ gsc .PRECOMPILE_IDENTITY_BASE
9090 # dynamic cost
91- + math .ceil (size / 32 ) * gsc .GAS_PRECOMPILE_IDENTITY_PER_WORD
91+ + math .ceil (size / 32 ) * gsc .PRECOMPILE_IDENTITY_PER_WORD
9292 )
9393
9494 attack_block = Op .MSTORE (
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ def test_p256verify_uncachable(
130130 gsc = fork .gas_costs ()
131131 intrinsic_gas_calculator = fork .transaction_intrinsic_cost_calculator ()
132132
133- precompile_cost = gsc .GAS_PRECOMPILE_P256VERIFY
133+ precompile_cost = gsc .PRECOMPILE_P256VERIFY
134134
135135 # h: data[0:32] 32 bytes
136136 # r: data[32:64] 32 bytes
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ def test_point_evaluation_uncachable(
113113 gsc = fork .gas_costs ()
114114 intrinsic_gas_calculator = fork .transaction_intrinsic_cost_calculator ()
115115 mem_exp = fork .memory_expansion_gas_calculator ()
116- precompile_cost = gsc .GAS_PRECOMPILE_POINT_EVALUATION
116+ precompile_cost = gsc .PRECOMPILE_POINT_EVALUATION
117117
118118 # Each iteration: STATICCALL point_evaluation at advancing calldata
119119 # offset, then advance offset at MEM[CALLDATASIZE].
@@ -148,8 +148,8 @@ def test_point_evaluation_uncachable(
148148 words_per_variant = math .ceil (INPUT_SIZE / 32 )
149149 per_variant_gas = (
150150 iteration_cost
151- + INPUT_SIZE * gsc .GAS_TX_DATA_TOKEN_FLOOR
152- + words_per_variant * (gsc .GAS_COPY + gsc .GAS_MEMORY )
151+ + INPUT_SIZE * gsc .TX_DATA_TOKEN_FLOOR
152+ + words_per_variant * (gsc .OPCODE_COPY_PER_WORD + gsc .MEMORY_PER_WORD )
153153 )
154154 empty_intrinsic = intrinsic_gas_calculator (
155155 calldata = [], return_cost_deducted_prior_execution = True
@@ -193,7 +193,7 @@ def test_point_evaluation_uncachable(
193193 per_tx_gas
194194 - execution_intrinsic
195195 - setup_cost
196- - math .ceil (len (calldata ) / 32 ) * gsc .GAS_COPY
196+ - math .ceil (len (calldata ) / 32 ) * gsc .OPCODE_COPY_PER_WORD
197197 - mem_exp (new_bytes = len (calldata ) + 32 )
198198 )
199199
Original file line number Diff line number Diff line change @@ -86,9 +86,9 @@ def test_ripemd160_uncachable(
8686
8787 precompile_cost = (
8888 # static cost
89- gsc .GAS_PRECOMPILE_RIPEMD160_BASE
89+ gsc .PRECOMPILE_RIPEMD160_BASE
9090 # dynamic cost
91- + math .ceil (size / 32 ) * gsc .GAS_PRECOMPILE_RIPEMD160_PER_WORD
91+ + math .ceil (size / 32 ) * gsc .PRECOMPILE_RIPEMD160_PER_WORD
9292 )
9393
9494 attack_block = Op .POP (
Original file line number Diff line number Diff line change @@ -86,9 +86,9 @@ def test_sha256_uncachable(
8686
8787 precompile_cost = (
8888 # static cost
89- gsc .GAS_PRECOMPILE_SHA256_BASE
89+ gsc .PRECOMPILE_SHA256_BASE
9090 # dynamic cost
91- + math .ceil (size / 32 ) * gsc .GAS_PRECOMPILE_SHA256_PER_WORD
91+ + math .ceil (size / 32 ) * gsc .PRECOMPILE_SHA256_PER_WORD
9292 )
9393 attack_block = Op .POP (
9494 Op .STATICCALL (
You can’t perform that action at this time.
0 commit comments