-
Notifications
You must be signed in to change notification settings - Fork 129
feat(tests): add eip-2929 precompile address warming tests #1495
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
Conversation
This seemed to be previously unused.
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.
This is a great start, some comments, because this mainly misses also checking that addresses which could have been precompiles in the past are now "normal" addresses (so should be cold)
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 comments but overall looks great!
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 from myside! I moved the test to Berlin btw, where 2929 was introduced, like we do with the other tests.
Created an issue in evmone's repo for the CI failure: ethereum/evmone#1210 We should be able to merge despite of this failure. |
predecessor_precompiles = set(get_transition_fork_predecessor(fork).precompiles()) | ||
successor_precompiles = set(get_transition_fork_successor(fork).precompiles()) | ||
all_precompiles = successor_precompiles | predecessor_precompiles | ||
highest_precompile = int.from_bytes(max(all_precompiles)) |
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.
from_bytes
requires two arguments, I had to change this line to:
highest_precompile: int = int.from_bytes(max(all_precompiles), sys.byteorder)
and import sys to make it work.
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.
when you say make it work you mean fill?
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.
Just having the file opened in an editor shows the problem. But now I know it depends on which Python version you use:
python 3.11 -> optional parameter
python 3.10 -> mandatory parameter
So I think it would be good if we find an exact Python version we enforce in EEST (everyone uses the exact same) to avoid stuff like this in the future.
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.
created an issue for discussion on enforcing the python version.
🗒️ Description
Idea from @jochem-brouwer - thanks! Please check whether this test is doing what you intended.
Call BALANCE of a precompile address before and after a fork.
According to EIP-2929, when a transaction begins, accessed_addresses is initialized to include:
This test verifies that:
These would perhaps be better as state tests. Feel free to close and implement a better suggestion, but happy for any feedback if you have time!
Also, this test should live in tests/paris, not tests/frontier, as they're only valid for EIP-2929, but it seemed silly to separate them from the other precompile generator tests.
The test uses a generator; it generates these tests:
🔗 Related Issues
None
✅ Checklist