feat(spec-specs, tests): update EIP-8037 to use source based refunds#18
Open
spencer-tb wants to merge 76 commits into
Open
feat(spec-specs, tests): update EIP-8037 to use source based refunds#18spencer-tb wants to merge 76 commits into
spencer-tb wants to merge 76 commits into
Conversation
Signed-off-by: jsign <jsign.uy@gmail.com>
…reum#2877) * feat: devnet script optimization to avoid merge conflicts * feat: mario feedback * refactor: 8037+7981 harmonization, add zero-valued access list token scaffolding * fix: add comment * feat(tests): adds EIP-7981 test and required framework changes (ethereum#2144) * feat: adds 7981 src changes + tests * fix: sam feedback * fix: ethereum-spec-lint: 'the item .. has changed relative positions', do we really need this check * feat: EIPs 11340 update implemented * fix: sam feedback * refactor(tests-eip-7981): Constrain tests to EIP inclusion * fix: harmonize with 8037, correct access list token placement and remove docstring conflicts * fix(specs,tests): EIP-7981 - Update implementation and specs (ethereum#2682) * fix(specs,tests): EIP-7981 - Update implementation and specs * fix: tooling+unused * fix: ACCESS_LIST_ADDRESS_FLOOR_TOKENS and ACCESS_LIST_STORAGE_KEY_FLOOR_TOKENS are now populated --------- Co-authored-by: Felix H <felix314159@users.noreply.github.com> * chores: update refspec * fix(tests): drop GAS_ prefix from gas_costs attribute references Align the EIP-7981 mixin and tests with the GasCosts dataclass rename on forks/amsterdam. * chore: update refspec (both 706296e06bf9b700bf046cfaa80bd5c3ebbc89c3 and 71d3353c3f6776485539fe2ec526b7cc80780bfc would not change the fixtures we currently output, cosmetic only) * chore: update refspec (cosmetic change, no action required) * feat(tests): EIP-7981 zero-byte calldata floor cost rejection (ethereum#2869) --------- Co-authored-by: marioevz <marioevz@gmail.com> Co-authored-by: Toni Wahrstätter <51536394+nerolation@users.noreply.github.com> Co-authored-by: spencer-tb <spencer.tb@ethereum.org> Co-authored-by: Paweł Bylica <pawel@hepcolgum.band>
call with insufficient balance shoudn't access delegation
…, EXCHANGE (ethereum#2881) * feat: devnet script optimization to avoid merge conflicts * feat: mario feedback * feat(src): EIP-8024 tests added (ethereum#2021) * feat(test): update EIP-8024 refspec and align on latest changes to EIP (ethereum#2095) * feat(test): EIP-8024 update (ethereum#2301) * feat: 8024 updates * fix: handle data opcodes appropriately * chore: fixes after rebase; gas constants were renamed * chore: update refspec to latest * feat(test): Add test vectors from EIP changes * fix(src,test): correct EXCHANGE JUMPDEST range; add missing EIP-8024 test vectors * nit: assert tests match EIP cases directly, for readability * nit: `m, n` -> `n, m` for consistency with EIP * refactor: simplify `encode_pair` assumption wrt `m` - Changes related to latest updates: https://github.com/ethereum/EIPs/pull/11351/changes --------- Co-authored-by: fselmo <fselmo2@gmail.com> * refactor(tests): Condition EIP-8024 tests to EIP inclusion * fix(tests-eip-8024): Fix cross-eip failures (EIP-8037) (ethereum#2656) * fix: mypy * fix(specs): align EIP-8024 DUPN/SWAPN/EXCHANGE gas references Add OPCODE_DUPN, OPCODE_SWAPN, OPCODE_EXCHANGE constants (= VERY_LOW) to the GasCosts class and use them in place of the retired module-level GAS_VERY_LOW reference, matching the per-opcode naming convention used by the rest of the stack instructions. * fix(tests): rename GAS_VERY_LOW to VERY_LOW in EIP-8024 mixin Align DUPN/SWAPN/EXCHANGE gas lookups with the GasCosts dataclass attribute rename on forks/amsterdam. * fix(tests): EIP-8037 workaround * test(tests-eip-8024): end-of-code stack underflow regression (ethereum#2741) Add regression coverage for the EIP-8024 consensus bug where DUPN/SWAPN/ EXCHANGE at end of code, with one fewer stack item than the zero-decoded immediate requires, must halt with stack underflow rather than succeeding via a graceful STOP. Parametrized state test over DUPN (144 items), SWAPN (145), EXCHANGE (16) asserting the pre-opcode marker is not persisted, which catches clients that treat the missing immediate as an implicit STOP. Bounty: https://github.com/ethereum-bounty/nethermind/issues/12 Fix: NethermindEth/nethermind#11178 --------- Co-authored-by: felipe <fselmo2@gmail.com> Co-authored-by: marioevz <marioevz@gmail.com> Co-authored-by: spencer-tb <spencer.tb@ethereum.org> Co-authored-by: Bhargava Shastry <bhargava.shastry@ethereum.org>
…-balance sender (ethereum#2880) EIP-7981 charges every access-list byte (20 per address, 32 per storage key) at the floor token cost. A transaction whose `gas_limit` lies in `[Amsterdam_floor_without_AL_term, Amsterdam_floor)` must reject at pre-validate with `INTRINSIC_GAS_BELOW_FLOOR_GAS_COST`; an implementation that omits the access-list-byte term from its floor computes a smaller floor and accepts. This test pins `gas_limit` at the midpoint of that uplift gap for Type-1 and Type-2 transactions carrying 1000 / 2000 nonzero data bytes plus a 1-address / 10-storage-key access list. The sender is funded with exactly `gas_limit * gas_price`, so a buggy implementation cannot fall back to a silent "accept and execute" — any acceptance produces a divergent post-state. Complements `test_insufficient_gas_for_access_list` and `test_floor_cost_validation_with_access_list`, which exercise this boundary at `gas_limit = floor - 1` with default sender funding.
…or gap (ethereum#2878) * feat(tests): EIP-7976 reject in Prague/Amsterdam floor gap with exact-balance sender EIP-7976 raises the per-byte calldata floor cost. A transaction whose `gas_limit` lies in `[Prague_floor, Amsterdam_floor)` must reject at pre-validate with `INTRINSIC_GAS_BELOW_FLOOR_GAS_COST`. This test pins gas_limit at the midpoint of that gap for 100 and 1000 zero-byte calldata transactions. Sender balance equals `gas_limit * gas_price`, so an implementation that defaults to the Prague floor cannot fall through to a silent "accept and execute" — any pre-validate divergence produces a different post-state. * refactor(tests): use `valid_at` marker and improve docstring consistency --------- Co-authored-by: Felix H <felix314159@users.noreply.github.com>
* test(tests): extend BALs coverage for edge cases * test(tests): closes ethereum#1910 - parametrize memory for call_opcode tests * test(tests): expand BAL coverage for insufficient-funds boundaries Add a combined outer-REVERT + inner-insufficient-funds test (CALL and CREATE), and layer EIP-7928-gated BAL expectations onto three existing cross-fork insufficient-funds tests (EIP-7708, EIP-2929 frontier CALL). * feat(tests): add some more parallelization test scenarios for BALs * chore(tests): add SSTORE to CREATE2 + SD + re-create as sanity check * cleanups from comments on PR ethereum#2854 * feat(tests): add parallelization BAL tests for collision / OOG create chain * chore: audit * update ``test_cases.md`` after suggestions and PR ethereum#2882 * fix(tests): update expected exception(s) for transition tests
ethereum#2883) * feat(tests): EIP-7928 BAL withdrawal predeploy balance read across txs Add a cross-tx test in eip7928_block_level_access_lists/test_block_access_lists_cross_index.py that verifies a transaction observing the BAL balance change of the WITHDRAWAL_REQUEST_PREDEPLOY recorded by a prior transaction within the same block. tx 0 pays the withdrawal fee (balance 0 -> fee, recorded as a BAL balance_change at index 1). tx 1 calls a contract that performs SSTORE(0, BALANCE(WITHDRAWAL_REQUEST_PREDEPLOY)); the assertion that slot 0 equals fee exercises that tx 1's pre-state for the predeploy includes tx 0's BAL prefix entry. * chore: add entry to ``test_cases.md`` * chore: unrelated cleanup to use Spec instead of hard-coding --------- Co-authored-by: fselmo <fselmo2@gmail.com>
…thereum#2893) * feat(tests): EIP-7928 self destruct to system address with 0 value * chore: some cleanup and add test case to ``tests_cases.md`` * chore: move test to more appropriate location --------- Co-authored-by: fselmo <fselmo2@gmail.com>
…thereum#2896) * tests/benchmark/compute/precompile/test_modexp.py: Add tests for modexp with random bit patterns and relevant lengths. Add tests for modexp where the modulus is a power of 2. * remove newline * Fix typo * refactor: comment and helper function --------- Co-authored-by: LouisTsai <q1030176@gmail.com>
…onTraceComparator (ethereum#2879)
* 🧪 test: Extend create endowment * 🧪 test: Extend tx boundary test * feat(tests): 2D parametrize with (tx, withdrawal) for BAL gas limit test --------- Co-authored-by: raxhvl <raxhvl@users.noreply.github.com> Co-authored-by: fselmo <fselmo2@gmail.com>
* feat: fill-stateful pytest pluging implementation * fix: test phase extraction; remove AI guesswork * WIP: debug_setHead resets * WIP: separate global setup step * use withdrawal to fund; default gen seed key * chore: cleanups related to stateful filling * add --clean support; remove xdist logging * chore: fix unit test for stateful fixture * more refactoring * refactor(test-cli): share live-network pytest plugin logic * feat(test-cli): Use setup groups to optimize the setup + execution behavior * refactor: some refactor and work on setup groups * fix: address comments from PR ethereum#2637 * refactor: remove the setup groups; unnecessarily complex for small gain * feat(tests-specs): added improvements and cleanup for stateful filling * chore: fail loudly for parametrized stub tests missing stub file * refactor: Use `PhaseManager` for fill-stateful * fix: format selection * fix: forks unit tests * feat: fill-stateful hive support * fix: hive flags * fix: fill-stateful exclude from fill format * refactor(fill): Get rid of PhaseManager, FormatSelector * nit: comment update * Louis' comments Co-authored-by: 蔡佳誠 Louis Tsai <72684086+LouisTsai-Csie@users.noreply.github.com> * refactor: rename global_setup to block hash --------- Co-authored-by: Mario Vega <marioevz@gmail.com> Co-authored-by: LouisTsai <q1030176@gmail.com> Co-authored-by: 蔡佳誠 Louis Tsai <72684086+LouisTsai-Csie@users.noreply.github.com>
…#2294) Type aliases such as Balance, Nonce, StorageKey, StorageValue, and CodeData were pure documentation (TypeAlias offered no mypy protection), inconsistent across forks, and forced readers to navigate away from use sites to learn the underlying width. Inline U256/U64/Bytes directly and keep only BlockAccessIndex, which names a genuinely fork-specific concept, moved to fork_types. Resolves ethereum#2260. Co-authored-by: Guruprasad Kamath <guru241987@gmail.com>
…ms (ethereum#2907) In test_valid_inputs and test_invalid_inputs: - Convert tuple params to `pytest.param(..., id=...)` so each case's identifier lives next to its values; drop the parallel `ids=[...]` list in test_invalid_inputs. - Move the per-case descriptions out of the function docstrings and into inline comments above the relevant pytest.param(s); shrink each docstring to a one-line summary. - Replace the magic `0xC0 << 376` with the existing `INF_POINT` constant in Spec.kzg_to_versioned_hash() calls. - Use idiomatic byte literals (`b""`, `b"\x00"`, `b"\x00" * 1023`) instead of `bytes()` / `bytes([0])` / `bytes([0] * 1023)`. No fixture changes (t8n cache 100% hit on all 14 cases).
…um#2895) * feat(test-consume): Validate RPC header fields * fix(tests-rlp): Raise nice AssertionError
…2943) * feat: nethermind state test added * fix: i was lINTING again
…st race condition (ethereum#2930)
…2977) Co-authored-by: CPerezz <37264926+CPerezz@users.noreply.github.com> Co-authored-by: danceratopz <danceratopz@gmail.com>
Co-authored-by: Leo Lara <leolara@users.noreply.github.com> Co-authored-by: danceratopz <danceratopz@gmail.com> Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
…event bogus sender recovery (ethereum#2983)
…m#2982) * fix(tooling): include namespace packages in coverage reports * fix(ci): lower json-loader minimum coverage --------- Co-authored-by: Sam Wilson <sam@binarycake.ca>
…eum#2987) Co-authored-by: danceratopz <danceratopz@gmail.com>
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>
c8e50c6 to
bf0ed01
Compare
bf0ed01 to
0983e28
Compare
0983e28 to
63eae5f
Compare
8bd822f to
2d4541e
Compare
4d84100 to
852715c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗒️ Description
Update the EIP-8037 reservoir model so state gas refunds are source based LIFO.
🔗 Related Issues or PRs
Aligns with ethereum/EIPs#X.
✅ Checklist
just statictype(scope):.Cute Animal Picture