feat(tests,forks): tests BAL early validation; refactor system contracts - #3484
Open
fselmo wants to merge 3 commits into
Open
feat(tests,forks): tests BAL early validation; refactor system contracts#3484fselmo wants to merge 3 commits into
fselmo wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #3484 +/- ##
================================================
Coverage 94.01% 94.01%
================================================
Files 624 624
Lines 36905 36905
Branches 3326 3326
================================================
Hits 34695 34695
Misses 1533 1533
Partials 677 677
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fselmo
force-pushed
the
feat/eip7928-early-validation-test
branch
from
September 1, 2026 17:01
a2baa62 to
c88fe77
Compare
fselmo
commented
Sep 1, 2026
fselmo
commented
Sep 1, 2026
fselmo
commented
Sep 1, 2026
fselmo
force-pushed
the
feat/eip7928-early-validation-test
branch
9 times, most recently
from
September 3, 2026 20:23
a2c8602 to
00b4c39
Compare
extra: Added some updates to the test-writing skill that come up often enough
fselmo
marked this pull request as ready for review
September 3, 2026 21:13
fselmo
force-pushed
the
feat/eip7928-early-validation-test
branch
from
September 3, 2026 21:13
00b4c39 to
53acdb1
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
Reviewed and added tests around the early invalidation of blocks using the BAL against BAL reads w/
ITEM_COST.def
This suggested check can lead to clients invalidating valid blocks if implemented as suggested. This PR aims to add tests around this to show that system contract reads are present in
R_remaining, as defined by the EIP, but they don't actually pay any gas... so theG_remaininggoes to0while there are still reads inR_remaining, leading to an improper check on reads that actually use up theG_remaining. This can lead to early invalidation of near-full to full blocks... The invalidation happens near the end but it happens nonetheless and we should cover this in our tests.As far as I can tell no client is implementing this except for Nethermind and they seem to remove the system contract addresses from the
R_remaining, which circumvents the problem. Something the EIP does not suggest and they seemingly did of their own accord. This means no client would currently fail these tests but this gap should nonetheless be covered.In order to cover this gap appropriately and future-proof this test, it's important to make sure that any system contracts that get added on to post-execution and contain reads get accounted for. This led to a cleaner redesign for the organization of system contracts in the testing framework that builds them in the style of our EIP mixins that were more recently introduced, and adds these properties to the fork more directly – rather than being hard-coded in the
Specclass inspecs.pywhich can be a bit too rigid.Note: I'm quite happy to move this refactor to another PR but I did separate it into its own commit so the tests could be reviewed separately. I ran
hasher compareon all tests affected by this contract refactor and they are identical hashes. I even audited thehashertool to make sure this isn't a blind check since I've never audited the tool itself I don't think 😅 (all looks good there too).extra: Added some updates to the test-writing skill that come up often enough
Related Issues or PRs
ethereum/EIPs#12277 created to change the EIP
Checklist
just static<type>(<area>): <title>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.Cute Animal Picture