-
Notifications
You must be signed in to change notification settings - Fork 177
feat(tests): Support for EIP-7928 - Block-Level Access Lists #2067
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(tests): Support for EIP-7928 - Block-Level Access Lists #2067
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial comments!
0422c6d
to
6999fa3
Compare
fa36237
to
d6368b6
Compare
02a740d
to
0eabfef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks amazing so far! Some comments and I think we can push to make the merge and make a release.
tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists.py
Show resolved
Hide resolved
0eabfef
to
697da8f
Compare
697da8f
to
0687fdf
Compare
…hanges - From comments on PR ethereum#2067, we should allow for an explicit exclusion case for an entire set of account changes. If a test case warrants a sanity check that some account might have been impacted but shouldn't be accounted for, we should be able to specify that explicitly.
0687fdf
to
89a3f1b
Compare
@marioevz this needed a rebase to fix some conflicts, hence the force push. For ease of a re-review, only the last 4 commits should have any changes since you last reviewed and I believe I addressed all your comments. Thanks for the thorough review 🙏🏼 edit: The only two comments not marked as "resolved" here are outstanding things to think about. I think we can create an issue to track the remaining changes as we iterate. Or, if you think we can answer those now, I'm happy to chat about it and implement it here as well. Let me know. |
…hanges - From comments on PR ethereum#2067, we should allow for an explicit exclusion case for an entire set of account changes. If a test case warrants a sanity check that some account might have been impacted but shouldn't be accounted for, we should be able to specify that explicitly.
89a3f1b
to
d0eb106
Compare
- Add BAL to engine execution payload as defined in: https://github.com/ethereum/consensus-specs/pull/4526/files#diff-4b950f0c895b4d521c9e8103d638e73a4c7746c6aea51250994425a1efd6f4c8R55 - Add BAL support for state tests to be able to create blockchain tests
4badcbe
to
e0c2fba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For an initial release it might be worth adding the following to, https://github.com/ethereum/execution-spec-tests/blob/main/.github/configs/feature.yaml, in the PR:
glamsterdam-alpha:
evm-type: develop
fill-params: --fork=Amsterdam ./tests/amsterdam
feature_only: true
Note evm-type can be stable/develop as both point to EELS. glamsterdam-alpha
must be the name of the head of the release tag, I used that as an example.
With the latter you should be able to run the following once the PR is merged to main, and your local git is up to date with the upstream/main:
git tag [email protected]
git push upstream [email protected]
573224f
to
64e0310
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
…m#2067) * 🚧 wip(EIP-7928): Block-level Access Lists * ✨ feat(EIP-7928): Spec params * 🧹 chore(EIP-7928): Rename package * ✨ feat(EIP-7928): Test cases * ✨ feat(EIP-7928): Add BAL header * 🧹 chore(EIP-7928): bal_hash header * 🧹 chore: Populate bal_hash env * ✨ feat(EIP-7928): Add BAL to block body * ✨ feat(EIP-7928): Add pokebal package * ✨ feat: update env * 🚧 wip: Checklist and basic tests * 🧹 chore: scope * Add more sophisticated test cases (ethereum#2029) Co-authored-by: raxhvl <[email protected]> * WIP: Attempt to get EEST + EELS bals PRs talking to each other * refactor(bal): Use full bal in t8n; verify and build fixtures - Use the full bal object in the t8n. We can use this to model_validate() into our pydantic model. - Also, pass the bal_hash via t8n so that once we do build the BAL, validate the explicitly defined values, rlp encode it, then hash it, we can compare the full BAL against the hash and make sure that even though we only validated the part that was important for our test, the full BAL is also always valid. Bonus: - Added a new type for ``StorageKey`` because these were not being rlp encoded properly without the left padding. This was tricky to find and I think this can be a common issue. New type here seemed appropriate. * chore(lint): Fix lint issues, assign method to Frontier to be overridden * fix(tests,lint): Set up code changes test case; fix remaining lint issues * refactor(forks): move BAL tests to Amsterdam - chore(cleanup): Remove reference to told BlockAccessLists fork - refactor(fork): ``Amsterdam`` above old EOF fork. * chore: Fix CI lint issues not present locally - Update some docstrings to remove AI excessive verbosity and add CodeChanges case to example. * refactor(bal): Apply comments from first pass at PR - Use ``Number`` instead of ``int`` where appropriate - Use ``default_factory=list`` without ``Optional`` and ``None`` where appropriate * refactor(bal): Split BAL into two classes - Use a root model class for the t8n BAL model. This lets us stick closer to the EIP definition where the BAL itself is a list. - The class doesn't need to be `RLPSerializable`, just have simple instructions to serialize its elements (`rlp()`). - Create a `BlockAccessListExpectation` class to represent the expected BAL for a given block. This class can describe different expectations for the test cases, such as defining mutations to be used for invalid tests. * refactor(tests): Rename checklist.md -> test_cases.md for BAL test case tracking * feat(tests,tools): [WIP] initial invalid BAL tests * chore(spec-resolver): Update commit hash to point to for spec resolver * fix(lint,resolver): Use latest commit in resolver; fix lint * Address comments from PR ethereum#2067 * chore(docs): Add changelog entries for BAL updates * refactor(types): Refactor BAL checks for explicit exclusion of acct changes - From comments on PR ethereum#2067, we should allow for an explicit exclusion case for an entire set of account changes. If a test case warrants a sanity check that some account might have been impacted but shouldn't be accounted for, we should be able to specify that explicitly. * fix(bal): Fix explicit empty checks for account changes; add unit tests * feat(bal): Extend BAL support within framework - Add BAL to engine execution payload as defined in: https://github.com/ethereum/consensus-specs/pull/4526/files#diff-4b950f0c895b4d521c9e8103d638e73a4c7746c6aea51250994425a1efd6f4c8R55 - Add BAL support for state tests to be able to create blockchain tests * fix(warnings): Silence warning for unused reference in .md file * fix(bal): Move state test expected bal to Block * feat(release): Set up BAL work for a feature release * fix: BAL as object in fixture block so RLP is correct * chore(pytest): Add Amsterdam to ruleset for simulator plugin --------- Co-authored-by: raxhvl <[email protected]> Co-authored-by: Toni Wahrstätter <[email protected]> Co-authored-by: raxhvl <[email protected]>
🗒️ Description
This builds upon #1823 and #1866. I worked on this side by side with ethereum/execution-specs#1381 to get BAL support and tests working with each other.
🔗 Related Issues or PRs
#ethereum/execution-specs#1381
✅ Checklist
tox
checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx --with=tox-uv tox -e lint,typecheck,spellcheck,markdownlint
type(scope):
.mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.