feat(tests): EIP-7928 tests for EIP 2935#2113
feat(tests): EIP-7928 tests for EIP 2935#2113raxhvl wants to merge 5 commits intoethereum:forks/amsterdamfrom
Conversation
|
Note: The blockhash value set during pre-execution is internal to EVM and hence is not verified by BAL which in this test should be okay since clients will eventually compare values from fixtures. The expression below is used to check the presence of the correct storage slot: storage_changes=[
BalStorageSlot(
slot=get_history_storage_slot(0),
slot_changes=[],
),
]It seems to work but I expect this to mean Storage slot has NO changes and NOT storage slot has SOME changes |
… for any changes
Nice catch... I don't think we've run into this yet as we have been able to be pretty deterministic with the expectations. I think this is a no-brainer, at least in consistency side. We need to keep consistency that Definitely happy to iterate on this (and we should discuss), but I think this is pretty explicit at least and would work well. Lmk your thoughts. |
There was a problem hiding this comment.
Ty for this! Not sure if this was ready yet given it's failing CI but gave it a first pass. I added an improvement commit as I mentioned above and fixed the lint so we can run CI on this. Let me know your thoughts please.
... also some minor notes from Claude review:
- Missing test: Wrong calldata size queries (EIP-2935 reverts on calldata != 32 bytes)
- test_cases.md: Invalid query entry doesn't mention oracle balance_changes when value > 0
| ) -> None: | ||
| """ | ||
| Ensure BAL captures SELFDESTRUCT to history storage address alongside | ||
| system call storage writes. |
There was a problem hiding this comment.
We don't seem to be checking any writes here (BalStorageChanges) as this states. Could we implement a similar approach as you did here with beacon roots contract so that we have these expectations as well in the BAL?
I think we can make use of the new validate_any_change bool and validate these two things in the helper for each block:
HISTORY_STORAGE_ADDRESSwithstorage_changes=[BalStorageSlot(slot=..., validate_any_change=True)]SYSTEM_ADDRESS: None
wdyt?
tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_eip2935.py
Show resolved
Hide resolved
| # A setup up block that writes genesis block-hash | ||
| # to history storage contract so that it can be | ||
| # queried later. | ||
| block_1 = Block() |
There was a problem hiding this comment.
This block could also have the BAL expectation from the helper method even though it's empty.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #2113 +/- ##
================================================
Coverage 86.07% 86.07%
================================================
Files 599 599
Lines 39472 39472
Branches 3780 3780
================================================
Hits 33977 33977
Misses 4862 4862
Partials 633 633
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks for the API to validate any change. Should we a similar API for post too? I tried setting slot to |
🗒️ Description
Tests for the effects of EIP-2935 historical block hashes on EIP-7928.
✅ Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx tox -e statictype(scope):.