feat(benchmarks): add keccak benchmark with updated memory #1849
+7
β1
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
This PR adds a mode to the keccak benchmark to ensure that the memory is updated each time keccak is called. This ensures that clients with a caching mechanism cannot use it (we generate a hash chain).
π Related Issues or PRs
N/A.
β Checklist
Before we merge this, I am confused by the test. The
offsetseems to place the calldata at an offset in the memory, and then if we hash it, we also start from this offset. So, we actually hash the same, regardless of what theoffsetparameter is. Is this the intent of this flag? Why is it there? The only thing it changes is that it writes to different memory (and will only do this once at startup). @LouisTsai-Csie maybe knows?Do not merge until we have reviewed the keccak benchmark π π
All: Ran fast
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx tox -e staticAll: PR title adheres to the repo standard - it will be used as the squash commit message and should start
type(scope):.All: Considered adding an entry to CHANGELOG.md.
All: Considered updating the online docs in the ./docs/ directory.
All: Set appropriate labels for the changes (only maintainers can apply labels).
Tests: Ran
mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned
@ported_frommarker.Cute Animal Picture