Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

reedsa
Copy link
Contributor

@reedsa reedsa commented Feb 21, 2025

πŸ—’οΈ Description

Convert remaining Blake2 precompile test cases for call and delegatecall
Convert identity precompile tests

πŸ”— Related Issues

βœ… Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: All converted JSON/YML tests from ethereum/tests have been added to converted-ethereum-tests.txt.
  • Tests: A PR with removal of converted JSON/YML tests from ethereum/tests have been opened.
  • Tests: Included the type and version of evm t8n tool used to locally execute test cases: e.g., ref with commit hash or geth 1.13.1-stable-3f40e65.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

@reedsa reedsa force-pushed the eip152-blake2-delegatecall branch 2 times, most recently from 19ae03c to b10bd8f Compare February 21, 2025 21:53
Copy link
Contributor Author

@reedsa reedsa left a 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.

),
# pytest.param(
# Blake2bInput(
# rounds=8000000,
Copy link
Contributor Author

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."""
Copy link
Contributor Author

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")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

["args_size", "output_size", "returndatasize"],
[
pytest.param(16, 32, 16, id="output_16"),
pytest.param(32, 16, 32, id="output_32"),
Copy link
Contributor Author

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"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reedsa reedsa force-pushed the eip152-blake2-delegatecall branch from 5c29b09 to 7882fc1 Compare February 28, 2025 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant