Skip to content

chore: sync upstream changes - #28

Draft
chetna-mittal wants to merge 402 commits into
forks/amsterdamfrom
latest-sync
Draft

chore: sync upstream changes#28
chetna-mittal wants to merge 402 commits into
forks/amsterdamfrom
latest-sync

Conversation

@chetna-mittal

Copy link
Copy Markdown
Collaborator

🗒️ Description

✅ Checklist

chfast and others added 30 commits June 16, 2026 13:16
Remove `ignore=True` from `TangerineWhistle` and `SpuriousDragon` so they
are included in `get_deployed_forks()` and filled. Both have distinct EVM
rulesets (`TANGERINE`/`SPURIOUS`) and full EELS `t8n` support but were
never filled, leaving `valid_from("TangerineWhistle")` tests starting at
Byzantium.

Update the `valid_until` marker test for the two added deployed forks.
Split `Frontier`->`Shanghai` + `Cancun` into `Frontier`->`Paris` +
`Shanghai`->`Cancun` so the two newly filled forks do not overload the
`pre-cancun` job. Keeps the same runner count in both the `fill` matrix
(`test.yaml`) and the release split (`fork-ranges.yaml`).
…thereum#2993)

Co-authored-by: marioevz <11726710+marioevz@users.noreply.github.com>
…thereum#2995)

Co-authored-by: raxhvl <10168946+raxhvl@users.noreply.github.com>
…ereum#2998)

Add `test_max_code_size_jumpdest_in_immediate`, which places a `0x5B`
as the last byte of a `MAX_CODE_SIZE` contract, right after an
immediate-carrying opcode, and jumps to it:

- `PUSH1`: The `0x5B` is push data, always skipped, so the jump is
  rejected.
- `DUPN`/`SWAPN`/`EXCHANGE`: Per EIP-8024 the `0x5B` is an invalid
  immediate, kept at an instruction boundary, so it stays a valid
  `JUMPDEST` and the jump is accepted.

Exercises the immediate-skipping branches of jumpdest analysis well
past the old 24 KiB code and 48 KiB initcode limits.
…thereum#2999)

Co-authored-by: kclowes <kclowes@users.noreply.github.com>
…g create targets (ethereum#3002)

Co-authored-by: kclowes <kclowes@users.noreply.github.com>
…orage (ethereum#3011)

Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
…thereum#3029)

* feat(tests): add EIP-211 return data buffer tests for SELFDESTRUCT behavior

* Apply suggestions from code review

Co-authored-by: Mario Vega <marioevz@gmail.com>

---------

Co-authored-by: Mario Vega <marioevz@gmail.com>
…ereum#3005)

* feat: 8037 - Apply changes from EIP-8037 spec change #11706 that don't conflict with #11807

* chore(tests): correct misleading EIP-8037 CALL insufficient-balance test

* test: fix EIP-8037 existing CALL target coverage

* fix: future-poof gas costs, use actual nonexistent account

* refactor: use Storage object

---------

Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
Co-authored-by: Bhargava Shastry <bhargava.shastry@ethereum.org>
…reum#3031)

* feat(tests): EIP-8037 code-deposit state gas exact-fit boundary

Pin the code-deposit state gas charge at its exact-fit gas boundary. A
CREATE transaction deploys code via RETURN(0, code_size); after the init
code returns, code deposit charges keccak regular gas from gas_left then
code_size * COST_PER_STATE_BYTE state gas, reservoir first and spilling
into gas_left.

test_code_deposit_state_gas_exact_fit_boundary sets the transaction gas
so the deposit charge lands exactly at the available gas (the contract
deploys) or one gas short (the deposit halts, NEW_ACCOUNT is refilled,
and no code is deployed). The reservoir_funded case uses code_size =
MAX_CODE_SIZE so the deposit exceeds the EIP-7825 cap and is drawn
reservoir first (the shortfall reduces the reservoir; an over-cap halt
bills exactly the cap); the gas_left_spill case uses an in-cap gas limit
so the deposit spills wholly from gas_left. The scaling tests vary the
size but assert success only, leaving this boundary unpinned.
Co-authored-by: Mario Vega Zavala <mario.vegazavala@ethereum.org>
…thereum#2996)

* chore(tests): unskip ported_static cases now passing on Amsterdam

PR ethereum#2969 made the transaction gas limit automatic. On EIP-8037 forks
the implicit limit now carries a state-gas reservoir, so tests that
leave the transaction gas limit unset receive enough headroom and stop
running out of gas under the two-dimensional gas model.

Filling tests/ported_static/ for Amsterdam without the skip list shows
33 of these entries pass across all fixture variants. Remove them from
amsterdam_skip_list.txt and recompute the per-section counts and the
total, from 480 down to 447. Two sections become empty and are dropped,
stCallDelegateCodesHomestead and stRecursiveCreate.

Most of the cleared cases are the _suicide_end family. They set only
the environment gas limit and rely on the implicit transaction gas
limit, so the reservoir restores their pre-Amsterdam behaviour.

* chore(tests): drop obsolete ported_static skip entries on Amsterdam

These 10 entries match no test collected on Amsterdam, so the conftest
never skips anything for them. They are dead weight in the list.

Eight are size-limit tests under stCodeSizeLimit and
stEIP3860_limitmeterinitcode. They carry valid_before("EIP7954"), and
Amsterdam includes EIP-7954, so pytest deselects them and they never
reach the skip step. Both sections empty out and are dropped.

Two are stCreateTest/test_create_address_warm_after_fail cases pinned
to a create-code-too-big-v1 parametrization that no longer exists after
the test was reparametrized.

Recompute the section counts and the total, from 447 down to 437.

* chore(tests): unset incidental tx gas_limit on 69 ported_static files

PR ethereum#2969 computes the transaction gas limit automatically and adds a
state-gas reservoir on EIP-8037 forks. These 69 files set an explicit
transaction gas_limit that was incidental: it sufficed on older forks,
but on Amsterdam the state-gas component pushed the transaction over its
budget and broke the test. Leaving the gas limit unset gives each
transaction the implicit limit plus reservoir, which restores the
recorded full-execution behaviour.

Drop the transaction gas_limit from these files, together with the
helpers it orphaned (tx_gas lists, an intrinsic-gas computation) and
three now-unused fork-conditional bumps that the unset limit supersedes.
Filling them across every valid fork passes all variants with no
residual failures, so remove their 116 entries from
amsterdam_skip_list.txt. Total 437 down to 321.

* chore(tests): unset g1 gas_limit on Amsterdam for no_src_account_create

test_no_src_account_create and its 1559 variant assert an
INSUFFICIENT_ACCOUNT_FUNDS rejection at gas index g1 (210000). On
Amsterdam EIP-8037 raises the creation intrinsic gas above that budget,
so the transaction is rejected for gas before the funds check and the
assertion fails.

Make the g1 budget fork-conditional: leave the gas limit unset on
EIP-8037 forks, where the implicit limit plus reservoir clears the
intrinsic and the intended funds rejection fires again. Earlier forks
keep the original 210000. Filling across every valid fork passes all
variants, so remove the 16 g1 entries from amsterdam_skip_list.txt.
Total 321 down to 305.

* chore(tests): fork-conditional gas unset for 8 more ported_static files

Extend the per-parametrization fix from no_src_account_create to eight
more mixed files. Each sets the skip-listed gas slot to None on EIP-8037,
so that parametrization gets the implicit limit plus reservoir, while the
other slots and earlier forks keep their explicit gas.

These slots recorded a full-execution result that broke on Amsterdam when
the state-gas component pushed the transaction over its budget. The
stZeroKnowledge point_mul tests run out of gas because they SSTORE the
precompile result, which EIP-8037 makes more expensive; the precompile
call itself is unchanged, so unsetting restores the recorded success
state.

Filling across every valid fork passes all variants with no failures, so
remove the 47 entries from amsterdam_skip_list.txt. Total 305 down to 258.

* chore(tests): Port and remove failing stZeroKnowledge tests

---------

Co-authored-by: marioevz <marioevz@gmail.com>
…checks (ethereum#3032)

* feat(tests): CREATE/CREATE2 and CALL clear return data on failed pre-checks

Entering a CREATE or CALL must reset the return-data buffer unconditionally,
including the pre-checks that abort before the callee/initcode runs. The
existing CREATE/CREATE2 return-data tests always execute the initcode (RETURN
or REVERT) and the CALL tests always enter the callee, so the early-return
pre-check paths are uncovered. A client that resets the buffer only after a
pre-check leaves stale return data from a preceding CALL observable via
RETURNDATASIZE/RETURNDATACOPY.

Add EIP-211 state tests under byzantium/eip211_return_data, alongside the
existing test_selfdestruct_clears_return_data:

- test_create: a CALL returning 32 bytes followed by a CREATE/CREATE2 with
  value exceeding the creator's balance (failing the balance pre-check before
  initcode). CREATE is valid from Byzantium, CREATE2 from Constantinople.
- test_call: a CALL returning 32 bytes followed by a CALL with value exceeding
  the caller's balance (failing the balance pre-check before entering the
  callee).

Both assert RETURNDATASIZE is 0 after the failed create/call. The 1024
call-stack depth pre-check is intentionally not tested: since EIP-150's 63/64
gas-forwarding rule, a call chain runs out of gas before reaching depth 1024,
so that branch is effectively unreachable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor: create/call failure cleans return buffer

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: LouisTsai <q1030176@gmail.com>
…OCK_ACCESS_LIST (ethereum#3046)

ethrex correctly rejects an EIP-7928 block whose BAL contains a SlotChanges
with an empty slot_changes list, returning INVALID with the message
"Block access list storage_changes slot <slot> for account <addr> has an empty
change set". The EthrexExceptionMapper already recognizes the sibling
validate_ordering() messages (not-in-strictly-ascending-order,
storage_changes-and-storage_reads) but was missing this one, so consume's
strict exception matching reports test_bal_invalid_empty_slot_changes
[unrelated_slot|demoted_noop] as failing even though ethrex's consensus
behavior is correct. Add the missing alternative to the INVALID_BLOCK_ACCESS_LIST
regex.
…m#3040)

* refactor(test-tools): Remove `CodeGasMeasure` footgun (stop)

* fix(tests): Fix CLZ test
chfast and others added 29 commits August 26, 2026 11:37
…erification (ethereum#3383)

Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
Make StorageAction a proper Enum instead of a plain class holding bare
auto() sentinels (which only worked by object identity), and fix the stale
"Returns: (bytecode, loop_cost, overhead)" docstrings in
create_storage_initializer / create_benchmark_executor, which return a
single IteratingBytecode.
* feat(fill): Make pre-alloc groups packing optional

* fix(bug): Bug due to untyped structs

* nit

* claude findings

* claude updated docs

* fix: backwards compatible index reading

* fix: properly skip amsterdam skip list for engine x

* fix: bug saving pre-alloc group builder as final product

* fix: hasher

* fix: typo

* fix: chain ID typing

* fix: unit test

* fix: remove `env` from the final pre-alloc group

* fix: Review comments

Co-authored-by: danceratopz <danceratopz@gmail.com>

---------

Co-authored-by: danceratopz <danceratopz@gmail.com>
* feat: implement placeholder

* test: add more placeholder cases

* refactor: fix opcode listing issue

* fix: refactor

* fixes: Make `substitute` in-place, guard `bytes` method

* fix: Exception types in bytecode.py

---------

Co-authored-by: marioevz <marioevz@gmail.com>
…& misc tests (Pt. 2c) (ethereum#3321)

* fix(tests): enhance & un-skip Amsterdam ported static SSTORE, refund & misc tests (Pt. 2c)

* refactor(tests): Further refactor tests and expand coverage

* fix(test-forks): Add EIP-160 mixin

* fix(test-forks): Fix CODE_INIT_PER_WORD pre-Shanghai

---------

Co-authored-by: marioevz <marioevz@gmail.com>
* refactor: state gas call scenario

* refactor: state gas calldata floor scenario

* refactor: state gas multi block scenario

* refactor: state gas ordering scenario

* refactor: state gas pricing scenario

* refactor: state gas sstore scenario

* tests: more fixes, added coverage

---------

Co-authored-by: marioevz <marioevz@gmail.com>
…RACT_EMPTY (ethereum#3465)

Geth rejects blocks whose request system call targets a codeless contract with
"failed to process <queue>: empty system contract: no code at <addr>" (since
ethereum/go-ethereum#35514), which GethExceptionMapper could not map.

Claude-Session: https://claude.ai/code/session_015PPcN9JS3yMPYWCYqusrEm
…ereum#3459)

`R == -G` is the input class where the Shamir/interleaved-MSM
precomputation `P + Q` (with `P = G`, `Q = R`) is the point at infinity.
Implementations that special-case it reduce `u1*G + u2*R` to
`(u1 - u2)*G`, which branches on the ordering of `u1` and `u2`.

Only `u1 > u2` was covered. Add the two neighbouring cases:

- `u1_lt_u2_R_eq_neg_G`: `u1 = 1`, `u2 = 2`, so the difference is
  negative and the recovered key is `-G`.
- `u1_eq_u2_R_eq_neg_G`: `u1 == u2`, so the recovered point is the point
  at infinity and the precompile returns empty.

Fixes ethereum#3458
The first stable release of ethereum-hive; it pools Hive API connections in a shared keep-alive session, which fixes sporadic `EADDRNOTAVAIL` failures and silently lost test results at high simulator throughput (ethereum/hive-python-api#18).
* fix(consume): force loadgroup for enginex xdist

EngineX relies on each pre-alloc group being executed by a single xdist worker so that the per-worker client manager sees every test in the group and can stop the shared client as soon as the group completes.

The previous parallelism detection only matched '-n' as a separate argument. Common spellings such as '-n=6', '-n6', and '--numprocesses=6' did not trigger the EngineX loadgroup override, so pytest-xdist could use its default distribution and split one pre-alloc group across workers.

Detect all supported xdist parallelism spellings and ensure consume enginex always runs with '--dist=loadgroup', overriding incompatible distribution modes with a warning. Keep the behavior scoped to EngineX so consume engine and the other simulators are unchanged.

* fix(consume): strip xdist `-d` load shorthand for enginex

pytest-xdist's `-d` flag sets `--dist=load` unconditionally in its
cmdline hook, clobbering any `--dist=loadgroup` injected by the
argument processor. Remove the flag and warn instead of relying on
the `--dist` override alone.

* refactor(consume): always force loadgroup dist for enginex

`--dist=loadgroup` is inert when xdist is not active, so the
parallelism-flag gate on the enginex path is unnecessary; ensure the
distribution mode unconditionally instead of detecting every `-n`
spelling first.

* fix: apply nits from review

Co-authored-by: spencer <spencer.tb@ethereum.org>

---------

Co-authored-by: spencer <spencer.tb@ethereum.org>
ethereum#3475)

* feat(tests): EIP-7928 - storage reads of a recreated destroyed account

Add `test_bal_create2_selfdestruct_then_recreate_and_write`: two
transactions each recreate, write and destroy the same pre-funded
CREATE2 address, so both wiped slots must reach the account's
block-level `storage_reads`.

PR ethereum#3399 was meant to cover erigon#23407 but does not reproduce it. It
demotes its writes with `REVERT` and never destroys the account, so it
misses the self-destruct read path the bug lives in. Verified against
erigon main with the fix reverted: this test fails and ethereum#3399's passes,
and it is the only fixture in the EIP-7928 suite that discriminates.

* chore(tests): correct test based on wording in test_cases.md; add beneficiary check

---------

Co-authored-by: fselmo <fselmo2@gmail.com>
…eum#3480)

* fix(test-forks): price pre-Berlin account and storage access flat in the opcode gas model

Claude-Session: https://claude.ai/code/session_01YN5aAKMhVpZwfFYXAKEuxp

* fix(test-forks): model the pre-Berlin SSTORE, call value and refund schedules

Claude-Session: https://claude.ai/code/session_01YN5aAKMhVpZwfFYXAKEuxp

* fix(tests): use the metadata call cost in the byzantium precompile gas tests

Claude-Session: https://claude.ai/code/session_01YN5aAKMhVpZwfFYXAKEuxp
* feat(tests): add type-0 transaction RLP validity tests

Port the core malformation classes of the legacy TransactionTests
suites (ttWrongRLP, ttNonce, ttValue, ttRSValue, ttVValue, ttAddress),
which were never converted because the ported-static pipeline only
handles state-test fillers and the raw malformed bytes cannot
round-trip through a structured transaction model.

A local RLP encoder builds each corruption deliberately, since a
correct encoder cannot emit non-canonical forms: per-field leading
zeros, 33-byte field overflows, 19 and 21 byte addresses, fields
encoded as lists, structural corruptions of the outer list (truncation,
trailing bytes, wrong element counts, header size mismatches, size
with leading zeros), and well-encoded but invalid signature values.
A valid re-encoded control case anchors the encoder to the framework's
byte-exact output.

The transaction_test fixture format records the declared exception
without consulting the transition tool, so all 30 cases were verified
externally by feeding the generated fixture bytes through EELS
decode_transaction, recover_sender and validate_transaction at
Frontier, London and Cancun: every invalid vector is rejected and the
control is accepted with the matching sender. Notably the gas limit
and gas price are unbounded scalars in the spec, so their oversized
encodings are valid at the transaction level; the overflow cases cover
the 256-bit bounded fields (nonce, value, r, s) only.

* fix(tests): accept client-divergent transaction RLP exceptions

Declare exception lists where clients legitimately report different
errors for the same malformed transaction:

- `header_declares_less`: the mutation leaves both a truncated final
  field and a trailing byte at the top level, so clients report it as
  either an EOF or a size error.
- `v_29`: post EIP-155 clients may derive a chain id from any v other
  than 27 or 28 and reject the mismatch instead of the signature, as
  already documented in `test_bad_v_r_s`.

* chore(tests): correct the transaction field overflow docstring

The nonce is decoded as a 256-bit scalar by the spec; the 64-bit bound
is an EIP-2681 validation rule, not a decoding one. Also note that the
signature v is a bounded 256-bit field whose oversized encoding is
uncovered only because no field-specific decoding exception exists.

* feat(tests): add r and s field-as-list transaction RLP cases

Extend `test_field_as_list` to the signature r and s fields, porting
`TRANSCT_rvalue_GivenAsListCopier` and `TRANSCT_svalue_GivenAsListCopier`
with the same `RLP_INVALID_SIGNATURE_R`/`_S` exceptions the legacy
suite declares. The gas price and v fields remain uncovered for lack
of a field-specific decoding exception.

* feat(tests): add a non-canonical single-byte transaction RLP case

Encode the single-byte nonce payload behind a one-byte string header
(0x8101) instead of as the byte itself. This ports the
`RLPIncorrectByteEncoding{00,01,127}Copier` legacy tests, which corrupt
the nonce this way and declare `RLP_LEADING_ZEROS_NONCE_SIZE`.

* feat(tests): add a data size leading zeros transaction RLP case

Encode the size of the data field's long-form string header with a
leading zero byte, porting `RLPArrayLengthWithFirstZerosCopier` with
the `RLP_LEADING_ZEROS_DATA_SIZE` exception it declares. This covers
the string-header variant of the list-header case already tested by
the `list_size_leading_zeros` mutation.

* feat(tests): add a zero v transaction signature case

A zero v is well-encoded (empty payload) but is neither 27, 28 nor an
EIP-155 value. Declare `INVALID_CHAINID` as an acceptable alternative
for the same reason as the other invalid v cases: post EIP-155 clients
may derive a chain id from any v other than 27 or 28.

* chore(tests): cite more covered legacy transaction test fillers

Add `ported_from` references for legacy fillers whose malformation
class is already exercised by an existing case:

- Leading zeros: the `tt{Nonce,GasPrice,GasLimit,Value}` zero-prefixed
  fillers and the `TRANSCT_*_Prefixed0000` copiers.
- Overflow: the `TRANSCT_{r,s}value_TooLarge` copiers.
- Address size: `AddressMoreThan20` and the `TRANSCT_to_*` copiers.
- Field as list: the remaining `TRANSCT_*_GivenAsList` copiers.
- Structure: `RLPTransactionGivenAsArray`, matching the
  `tx_as_byte_string` mutation.

All referenced fillers were inspected at the pinned commit to confirm
the corruption and declared exception match the covering case.

* fix(tests): fund only senders that send in transaction RLP tests

In execute mode, `pre.fund_eoa()` defers the funding amount until the
EOA sends a transaction; an EOA that never sends one fails the run
with "Sender balance must be set before sending". The senders of the
corrupted transactions never send: only their raw serialization is
submitted, expecting rejection. Fund them with `amount=0` so execute
mode derives an address without scheduling a funding transaction.

The signing keys are derived from the account content, so the
corrupted vectors' bytes change; all vectors were re-verified against
EELS decoding and validation at Frontier, London and Cancun.

* chore(tests): mark transaction RLP tests as inclusion tests

Each case asserts whether one transaction can be included in a block,
which is what the `inclusion_test` marker denotes.

* fix(tests): accept a type error for a transaction given as a byte string

EIP-2718 reads a byte string in the transaction list as a typed
transaction, so from Berlin on the corruption is reported as an
unsupported transaction type rather than an RLP header error. Verified
against EELS decoding at Frontier, Berlin and Cancun.

---------

Co-authored-by: danceratopz <danceratopz@gmail.com>
No spec-specific constants were useful to add here. This may change but
the import from the relevant spec is preferred over adding them here if they
are not BALs specific.
ethereum#3490)

* feat(tests): pin cross-frame state gas refund placement and settlement

* feat(tests): EIP-8037 cross-frame refund split across a child's own spill

Test that one frame's refund both repays a different slot's borrow and
puts the excess in the reservoir, that the split state merges cleanly
on success, and that it is fully unwound on revert and halt.

* chore(tests): use fork transaction gas limit cap, not constant val

* fix: apply comments from PR ethereum#3490

---------

Co-authored-by: fselmo <fselmo2@gmail.com>
* refactor: state gas create scenario

* feat(tests): Add more variants

---------

Co-authored-by: marioevz <marioevz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.