-
Notifications
You must be signed in to change notification settings - Fork 107
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) Additional precompile tests for blake2b, identity #1244
base: main
Are you sure you want to change the base?
Conversation
19ae03c
to
b10bd8f
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.
@marioevz @winsvega I'm working on several more precompile tests and double checking that all cases are covered.
- Blake2b should be covered with these additions, but one case is causing timeouts (see separate comment below).
- This PR includes a couple Identity test cases. There are numerous others for CALL and CALLCODE that I will add here.
I want to clarify the other test cases since you mentioned skipping a few from the stPreCompiledContracts2 directory.
- Am I remembering that you said to ignore the ecrecover, ripemd and sha256 tests? I dont know if there might be others, but wanted to check back before I proceed further.
- I noticed a single test case in /~https://github.com/ethereum/tests/blob/develop/src/GeneralStateTestsFiller/stPreCompiledContracts/sec80Filler.json that appears to be related to the ecrecover precompile (I found it runs
CALLCODE
to address 0x1). Should this one be ignored? - The precompile EIP2929 tests should probably be converted. I wanted to check before implementing those, they appear to check gas consumption of certain opcodes. /~https://github.com/ethereum/tests/blob/develop/src/GeneralStateTestsFiller/stPreCompiledContracts/precompsEIP2929CancunFiller.yml
), | ||
# pytest.param( | ||
# Blake2bInput( | ||
# rounds=8000000, |
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 huge number of rounds unsurprisingly causes time outs. Is there another way to run this to keep this case covered?
@@ -0,0 +1,57 @@ | |||
"""abstract: Test delegatecall to Blake2B Precompile before and after it was added.""" |
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.
state_test(env=env, pre=pre, post=post, tx=tx) | ||
|
||
|
||
@pytest.mark.valid_from("Istanbul") |
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.
Additional tests that follow cover cases found in /~https://github.com/ethereum/tests/blob/develop/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLBlake2fFiller.json
["args_size", "output_size", "returndatasize"], | ||
[ | ||
pytest.param(16, 32, 16, id="output_16"), | ||
pytest.param(32, 16, 32, id="output_32"), |
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.
@pytest.mark.parametrize( | ||
["args_size", "output_size", "returndatasize"], | ||
[ | ||
pytest.param(16, 32, 16, id="output_16"), |
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.
c55d8a3
to
5c29b09
Compare
5c29b09
to
7882fc1
Compare
ποΈ Description
Convert remaining Blake2 precompile test cases for call and delegatecall
Convert identity precompile tests
π Related Issues
β Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.