Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
49c7713
feat: devnet script optimization to avoid merge conflicts
felix314159 Apr 13, 2026
5e5de5a
feat: mario feedback
felix314159 Apr 14, 2026
fa1fda4
refactor: 8037+7981 harmonization, add zero-valued access list token …
felix314159 Apr 14, 2026
48f5c72
fix: add comment
felix314159 Apr 14, 2026
4659524
feat(specs, tests): implement EIP-8037 state creation gas cost increa…
spencer-tb Feb 28, 2026
84a4c19
chore(specs, tests): restore spilled state gas to reservoir on revert…
spencer-tb Mar 6, 2026
4a6b2bc
feat(tests): add EIP-8037 multi-block and exact coinbase fee tests
spencer-tb Mar 6, 2026
da43238
feat(tests): add EIP-8037 gas validation edge cases from #2426
spencer-tb Mar 6, 2026
991baa1
chore(tests): fix tests and make bulletproof
spencer-tb Mar 6, 2026
4c5f1fc
refactor(tests,forks): add state gas calculators and use fork methods
spencer-tb Mar 6, 2026
a168d2a
feat(tests): add new_account variant to insufficient balance CALL test
spencer-tb Mar 6, 2026
a9c350c
chore(tests): add valid_until marker to initcode over-limit exception…
spencer-tb Mar 6, 2026
abf5f17
feat(tests): add max initcode 2D gas metering test
spencer-tb Mar 12, 2026
148f632
fix(tests): resolve gas constant renames and gas limits after rebase
spencer-tb Mar 17, 2026
5438996
fix(tests): prevent `tx_gas_limit` double-accumulation across fixture…
felix314159 Mar 20, 2026
c0db93d
feat(specs,tests): EIP-8037 state gas ordering and clarifications (#2…
spencer-tb Mar 28, 2026
9594513
fix(specs, tests): remove per-tx state gas pre-check and add 2D block…
spencer-tb Mar 28, 2026
c8cf071
fix(ported-tests): bump gas limits for Amsterdam (EIP-8037 state gas)
spencer-tb Mar 31, 2026
5abe1f9
fix(spec,tests): code deposit ordering and regression tests
spencer-tb Mar 10, 2026
7e73884
fix(spec): track collision-burned gas in regular_gas_used
spencer-tb Mar 10, 2026
b2b963b
feat(tests): update state gas creation tests with max_code_size case …
spencer-tb Mar 11, 2026
40aba5a
chore(tests): remove obsolete static test skip list
spencer-tb Mar 31, 2026
335f250
fix(execute): use configurable gas limit for funding txs (EIP-8037) (…
qu0b Apr 1, 2026
2e409ae
chore(lint): fix import sorting and stale type annotation for static …
spencer-tb Apr 1, 2026
a2b785c
feat(tests): EIP-8037 - code deposit halt must discard initcode state…
qu0b Apr 1, 2026
54fba91
feat(tests): EIP-8037 blockchain header gas_used tests (#2611)
spencer-tb Apr 1, 2026
1f263ae
feat(tests): block-level 2D gas accounting tests for EIP-8037 (#2610)
qu0b Apr 1, 2026
a934586
feat(spec-specs): EIP-8037 - move CREATE state gas charge after initc…
spencer-tb Apr 2, 2026
c9ad701
refactor(tests-eip8037): Condition tests to EIP inclusion
marioevz Apr 9, 2026
9c49cc9
fix(tests): Use `pytest.mark.valid_before` for EIP-8037
marioevz Apr 9, 2026
f9541f0
fix(specs-amsterdam): Lint fails
marioevz Apr 10, 2026
650ec08
fix(fill): use fork_at(), use is_eip_enabled(eip_number=7976) to pick…
felix314159 Apr 14, 2026
44b47cc
fix: mypy
felix314159 Apr 16, 2026
cef0fde
feat(spec-specs, tests): EIP-8037 - zero execution state gas on top-l…
kclowes Apr 19, 2026
e723e7d
feat(spec-specs, tests): EIP-8037 - CREATE failure refunds state gas …
spencer-tb Apr 19, 2026
5450513
feat(spec-specs, tests): EIP-8037 - 0 to x to 0 SSTORE refunds to sta…
spencer-tb Apr 19, 2026
ddfdb0d
feat(tests): EIP-8037 - CALL with value to selfdestructed account (#2…
kclowes Apr 19, 2026
b8defe9
feat(spec-specs, tests): EIP-8037 - SELFDESTRUCT same-tx refunds stat…
spencer-tb Apr 19, 2026
c1f9aa7
feat(spec-specs, tests): EIP-8037 - immutable intrinsic state gas for…
spencer-tb Apr 19, 2026
f253db1
feat(spec-specs, tests): EIP-8037 - per-dimension block gas limit che…
kclowes Apr 19, 2026
bcc33b2
feat(tests): 8037-Add tests for 7702 interactions
kclowes Apr 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def deploy_deterministic_factory_contract(
fund_tx = Transaction(
to=deploy_tx_sender,
value=fund_amount,
gas_limit=200_000,
gas_price=gas_price,
sender=seed_key,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_recover_funds(
del index

remaining_balance = eth_rpc.get_balance(eoa)
refund_gas_limit = 21_000
refund_gas_limit = 200_000
tx_cost = refund_gas_limit * gas_price
if remaining_balance < tx_cost:
pytest.skip(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def __init__(
address_stubs: AddressStubs | None = None,
block_number: int = 0,
timestamp: int = 0,
funding_gas_limit: int = 200_000,
**kwargs: Any,
) -> None:
"""Initialize the pre-alloc with the given parameters."""
Expand All @@ -269,6 +270,7 @@ def __init__(
self._address_stubs = address_stubs or AddressStubs(root={})
self._block_number = block_number
self._timestamp = timestamp
self._funding_gas_limit = funding_gas_limit

def code_pre_processor(self, code: Bytecode) -> Bytecode:
"""Pre-processes the code before setting it."""
Expand Down Expand Up @@ -647,6 +649,7 @@ def _fund_eoa(
target=label,
to=eoa,
value=amount,
gas_limit=self._funding_gas_limit,
)

if fund_tx is not None:
Expand Down Expand Up @@ -864,6 +867,7 @@ def _resolve_fund_addresses(self) -> None:
target=d.address.label,
to=d.address,
value=d.amount - current_balance,
gas_limit=self._funding_gas_limit,
)
new_balance = d.amount
else:
Expand All @@ -878,6 +882,7 @@ def _resolve_fund_addresses(self) -> None:
target=d.address.label,
to=d.address,
value=d.amount,
gas_limit=self._funding_gas_limit,
)
new_balance = current_balance + d.amount

Expand Down Expand Up @@ -987,6 +992,7 @@ def pre(
max_fee_per_gas: int,
max_priority_fee_per_gas: int,
dry_run: bool,
sender_fund_refund_gas_limit: int,
request: pytest.FixtureRequest,
) -> Generator[Alloc, None, None]:
"""Return default pre allocation for all tests (Empty alloc)."""
Expand All @@ -1011,6 +1017,7 @@ def pre(
chain_id=chain_config.chain_id,
node_id=request.node.nodeid,
address_stubs=address_stubs,
funding_gas_limit=sender_fund_refund_gas_limit,
)

# Yield the pre-alloc for usage during the test
Expand All @@ -1036,7 +1043,7 @@ def pre(
# Build refund transactions
refund_txs: List[Transaction] = []
skipped_refunds = 0
refund_gas_limit = 21_000
refund_gas_limit = sender_fund_refund_gas_limit
tx_cost = refund_gas_limit * max_fee_per_gas
for idx, eoa in enumerate(funded_eoas):
account = eth_rpc.get_account(eoa, skip_code=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def pytest_addoption(parser: pytest.Parser) -> None:
action="store",
dest="sender_fund_refund_gas_limit",
type=Wei,
default=21_000,
default=200_000,
help=(
"Gas limit set for the funding transactions of each worker's sender key." # noqa: E501
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,44 @@ def pytest_html_results_table_row(report: Any, cells: Any) -> None:
del cells[-1] # Remove the "Links" column


@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_setup(item: Any) -> Generator[None, None, None]:
"""
Snapshot parametrize values before fixture setup to detect unintended
mutations of shared pytest parameter objects across fixture format runs.
"""
if hasattr(item, "callspec"):
item._param_repr_snapshot = {
key: repr(value) for key, value in item.callspec.params.items()
}
yield


def pytest_runtest_teardown(item: Any) -> None:
"""
Compare parametrize values after test teardown to the pre-setup snapshot.

Warn if any fixture mutated shared parameter objects β€” these mutations
persist across fixture format runs and can cause subtle bugs (e.g.
block hash mismatches between blockchain_test and blockchain_engine_test).
"""
snapshot = getattr(item, "_param_repr_snapshot", None)
if snapshot is None:
return
for key, original_repr in snapshot.items():
current_repr = repr(item.callspec.params[key])
if current_repr != original_repr:
warnings.warn(
f"Shared pytest parameter '{key}' was mutated during "
f"test '{item.nodeid}'. Mutations on parametrize values "
f"persist across fixture format runs and can cause "
f"divergent test results. Avoid mutating these objects "
f"in fixtures; compute derived values locally instead.",
stacklevel=1,
)
del item._param_repr_snapshot


@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(
item: Any, call: Any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def type_4_default_transaction(sender: EOA, pre: Alloc) -> Transaction:
sender=sender,
max_fee_per_gas=10**10,
max_priority_fee_per_gas=10**9,
gas_limit=150_000,
gas_limit=500_000,
data=b"\x00" * 200,
access_list=[
AccessList(address=0x4567, storage_keys=[1000, 2000, 3000]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class TransactionTraces(CamelModel):
traces: List[TraceLine]
output: str | None = None
gas_used: HexNumber | None = None
error: str | None = None

@classmethod
def from_file(cls, trace_file_path: Path) -> Self:
Expand Down
36 changes: 36 additions & 0 deletions packages/testing/src/execution_testing/forks/base_fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,14 @@ def base_fee_change_calculator(cls) -> BaseFeeChangeCalculator:
"""
pass

@classmethod
@abstractmethod
def cost_per_state_byte(cls, gas_limit: int = 0) -> int:
"""
Calculate the state gas cost per byte based on the block gas limit.
"""
pass

# Fee helpers
@classmethod
@abstractmethod
Expand Down Expand Up @@ -643,6 +651,16 @@ def transaction_intrinsic_cost_calculator(
"""
pass

@classmethod
def transaction_intrinsic_state_gas(
cls,
*,
contract_creation: bool = False, # noqa: ARG003
authorization_count: int = 0, # noqa: ARG003
) -> int:
"""Return intrinsic state gas (zero pre-Amsterdam)."""
return 0

@classmethod
@abstractmethod
def blob_gas_price_calculator(cls) -> BlobGasPriceCalculator:
Expand Down Expand Up @@ -778,6 +796,24 @@ def transaction_gas_limit_cap(cls) -> int | None:
"""
pass

@classmethod
@abstractmethod
def sstore_state_gas(cls) -> int:
"""Return state gas for a zero-to-nonzero SSTORE."""
pass

@classmethod
@abstractmethod
def code_deposit_state_gas(cls, *, code_size: int) -> int:
"""Return state gas for code deposit of the given size."""
pass

@classmethod
@abstractmethod
def create_state_gas(cls, *, code_size: int = 0) -> int:
"""Return total state gas for CREATE."""
pass

@classmethod
@abstractmethod
def block_rlp_size_limit(cls) -> int | None:
Expand Down
Loading
Loading