fix(tests): fixes EXTCODECOPY bench test #1865
Open
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
In #1864 I realized a problem with the EXTCODECOPY test. It copies to memory to offset 85. This is correct if the CREATE2 hash alignment starts at 0. It however starts at byte 11 (the address starts at 12). This means that the memory region
[11,96)
is occupied by the bytes to hash to get the correct address. If we thus EXTCODECOPY to byte 85, we overwrite the bytes there (initcode hash is stored there). This means that all EXTCODECOPYs after the first one target incorrect addressess, i.e. they have empty code.I checked this file if there are more of these tests but this seem to be the only one. (This could be a problem with other tests also using CREATE2 and using operations which writes to memory. It should not overwrite the to-be-hashed data to retrieve the CREATE2 address created from the factory)
CC @jsign
🔗 Related Issues or PRs
N/A.
✅ 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.@ported_from
marker.