Skip to content

Commit d6ec9aa

Browse files
refactor(benchmark): update transaction handling
1 parent 9149a02 commit d6ec9aa

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

tests/benchmark/test_worst_compute.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,16 +2162,18 @@ def test_worst_blobhash(
21622162

21632163
if blobs_present > 0:
21642164
tx_type = TransactionType.BLOB_TRANSACTION
2165-
max_fee_per_blob_gas = fork.min_base_fee_per_blob_gas()
2165+
max_fee_per_blob_gas = HexNumber(fork.min_base_fee_per_blob_gas())
21662166
blob_versioned_hashes = add_kzg_version(
21672167
[i.to_bytes() * 32 for i in range(blobs_present)],
21682168
BlobsSpec.BLOB_COMMITMENT_VERSION_KZG,
21692169
)
2170+
# Set required EIP-1559 fields for blob transactions
2171+
tx.max_priority_fee_per_gas = HexNumber(0)
2172+
tx.max_fee_per_gas = HexNumber(7)
2173+
tx.access_list = []
21702174

21712175
tx.ty = HexNumber(tx_type)
2172-
tx.max_fee_per_blob_gas = (
2173-
HexNumber(max_fee_per_blob_gas) if max_fee_per_blob_gas is not None else None
2174-
)
2176+
tx.max_fee_per_blob_gas = max_fee_per_blob_gas
21752177
tx.blob_versioned_hashes = blob_versioned_hashes
21762178

21772179
benchmark_test(

tests/benchmark/test_worst_stateful_opcodes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from ethereum_test_benchmark.benchmark_code_generator import ExtCallGenerator, JumpLoopGenerator
1313
from ethereum_test_forks import Fork
14-
from ethereum_test_specs import BlockchainTestFiller
14+
from ethereum_test_specs import BlockchainTestFiller, StateTestFiller
1515
from ethereum_test_specs.benchmark import BenchmarkTestFiller
1616
from ethereum_test_tools import (
1717
Account,
@@ -648,7 +648,7 @@ def test_worst_selfdestruct_existing(
648648

649649
@pytest.mark.parametrize("value_bearing", [True, False])
650650
def test_worst_selfdestruct_created(
651-
benchmark_test: BenchmarkTestFiller,
651+
state_test: StateTestFiller,
652652
pre: Alloc,
653653
value_bearing: bool,
654654
fork: Fork,
@@ -736,7 +736,7 @@ def test_worst_selfdestruct_created(
736736
)
737737

738738
post = {code_addr: Account(storage={0: 42})} # Check for successful execution.
739-
benchmark_test(
739+
state_test(
740740
env=env,
741741
pre=pre,
742742
post=post,
@@ -747,7 +747,7 @@ def test_worst_selfdestruct_created(
747747

748748
@pytest.mark.parametrize("value_bearing", [True, False])
749749
def test_worst_selfdestruct_initcode(
750-
benchmark_test: BenchmarkTestFiller,
750+
state_test: StateTestFiller,
751751
pre: Alloc,
752752
value_bearing: bool,
753753
fork: Fork,
@@ -818,7 +818,7 @@ def test_worst_selfdestruct_initcode(
818818
)
819819

820820
post = {code_addr: Account(storage={0: 42})} # Check for successful execution.
821-
benchmark_test(
821+
state_test(
822822
env=env,
823823
pre=pre,
824824
post=post,

0 commit comments

Comments
 (0)