refactor(test-benchmark): address spec diverge in devnet#3062
Closed
LouisTsai-Csie wants to merge 26 commits into
Closed
refactor(test-benchmark): address spec diverge in devnet#3062LouisTsai-Csie wants to merge 26 commits into
LouisTsai-Csie wants to merge 26 commits into
Conversation
…thereum#2972) Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com> Co-authored-by: Mario Vega <11726710+marioevz@users.noreply.github.com>
…reum#3019) Co-authored-by: marioevz <marioevz@gmail.com>
* feat(spec, specs): EIP-7997 - Spec and basic tests * feat(spec-specs): EIP 7997 - More tests * bugfix(specs): Add logic to add 0x12 as a special contract outside the precompile range * feat(tests): 7997 - add a check at the transition, adds tests for prewarming, CALLCODE, and giving it a balance via SELFDESTRUCT * fix: address PR feedback * feat(spec): Use Arachnid create2 contract * feat(specs, spec-test): Remove unneeded code * feat(spec-tests): Remove unneeded tests * feat(test-specs): Add sstore metadata for gas pricing * fix(test-specs): Remove sstore metadata * feat(test-specs): Add Arachnid contract to system contracts * feat(test-specs): Add a BAL test, large initcode test, and an ef prefix test * fix(test-specs): remove unneeded pre_alloc_mutable decorators * Add Amsterdam config to test_execute_eth_config * fix: Uses storage.store_next and mark valid_from EIP7997 instead of Amsterdam * fix: don't hardcode gas values, call_opcode parametrization * fix: Remove Factory predeploy from system contracts * fix: Remove explicit set of gas_limit * lint * Whitespace
…reum#2842) * feat: implement eip 8246 * tests: enhance eip 8246 coverage * refactor: resolve failing selfdestruct scenario * chore: fix linting issue * fix(specs): Remove all references to burn logs * fix(tests): Fix remaining tests * chore: rename function --------- Co-authored-by: marioevz <marioevz@gmail.com>
…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.
…thereum#3044) EIP-8246 removes the `SELFDESTRUCT` balance burn, which changes the same-transaction self-destruct-to-self outcome. Gate the affected expectations in `test_selfdestruct_gas.py` on `fork.is_eip_enabled(8246)` so the test holds on forks with and without EIP-8246: - Pre-EIP-8246: The originator balance is burnt (a `Burn` log) and the same-transaction-created account is deleted. - EIP-8246 onwards: The burn is removed, so the self-send is a no-op; the balance stays in the (emptied) originator and no log is emitted. `burn_log` is imported lazily in the pre-EIP-8246 branch because EIP-8246 deletes the helper from the EIP-7708 spec. The charged gas is unchanged, so `cumulative_gas_used` is asserted identically on both sides.
`test_mixed_validity_multi_auth_receipt_gas` modelled the old refund rule where only the valid authorization is refunded. The EIP-8037 update for ethereum/EIPs#11715 (implemented on this branch in `vm/eoa_delegation.py`) refunds every authorization: Each returns `NEW_ACCOUNT` on the state channel and `ACCOUNT_WRITE` on the regular channel, and the invalid tuple is fully refunded, so it additionally returns `AUTH_BASE` on the state channel. Update the expected-gas computation accordingly, deriving `AUTH_BASE` from the per-authorization state intrinsic. The asserted `cumulative_gas_used` drops from `0x47704` to `0x1011e`, matching the implementation. This fixup is devnet6-only: It can only land where the EIP-8037 update exists, which is not yet the case on `eips/amsterdam/eip-2780-8038`.
…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.
…zero balance precompile (ethereum#3048) * fix(amsterdam): charge NEW_ACCOUNT for value transfer to empty precompile EIP-2780 charges the NEW_ACCOUNT state cost when a transaction transfers value to a recipient that is empty per EIP-161. The top-frame charge previously carved out precompile recipients, but neither EIP-2780 nor EIP-161 authorizes that exemption: - EIP-2780 does not mention precompiles; its rule keys solely on "empty per EIP-161 and tx.value > 0". - EIP-161 defines empty structurally (no code, zero nonce, zero balance) with no precompile exception, so an unfunded precompile is empty and is created by the value transfer like any other account. Remove the `recipient_is_precompile` carve-out from the top-frame charge so an empty precompile receiving value pays NEW_ACCOUNT, drop the matching special-case from the testing framework's `transaction_top_frame_state_gas`, and rewrite `test_value_move_to_precompiles` to assert the charge fires for the not-funded precompile while a pre-funded (alive) precompile remains exempt by virtue of being non-empty. Co-authored-by: danceratopz <danceratopz@gmail.com>
(cherry picked from commit 3d7a09c)
(cherry picked from commit 1255db8)
(cherry picked from commit 20c2510)
(cherry picked from commit bcfeb3c)
(cherry picked from commit d2bc90d)
(cherry picked from commit 52f72de)
(cherry picked from commit 4698103)
(cherry picked from commit 1582cc3)
4bc0fc6 to
d0338f5
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
🔗 Related Issues or PRs
N/A.
✅ Checklist
just statictype(scope):.mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_frommarker.Cute Animal Picture