binary(tests): vector cases for zero code chunks in the code zone - #3305
Open
awskii wants to merge 2 commits into
Open
binary(tests): vector cases for zero code chunks in the code zone#3305awskii wants to merge 2 commits into
awskii wants to merge 2 commits into
Conversation
The zero-chunk vector covers 62 bytes of code, so both its chunks are in the account header. Overflow chunks are keyed by code hash on a separate write path, and nothing pins that the same rule holds there.
Header code chunks are proposed for removal (ethereum#3286), so name and describe the case by the zone that outlives that: the zero chunk in the content-addressed code zone. The state and its root are unchanged.
Contributor
|
Apologies do you mind rebasing ser? |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## projects/binary-trie #3305 +/- ##
=========================================================
- Coverage 93.00% 21.91% -71.09%
=========================================================
Files 628 628
Lines 37395 37395
Branches 3445 3445
=========================================================
- Hits 34779 8195 -26584
- Misses 1859 29115 +27256
+ Partials 757 85 -672
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
code_chunks_of_zero_bytesis 62 bytes of code, so both its chunks live in theaccount header. Chunks past the header are keyed by code hash rather than by
address and are written on a separate path, and no vector pins that a zero chunk
is absent there too. A client can apply the rule in one zone and not the other
and still produce a root.
The second case adds the interaction with content addressing, which is also
unpinned:
shared_bytecode_two_accountsandcode_chunks_of_zero_byteseach holdon their own, but nothing says what happens when the chunk two accounts would
share is the one that has to be absent.
Both cases are aimed at the code zone, so they survive the removal of code chunks
from the account header discussed in #3286 — the second becomes the central case
rather than an edge one, since every chunk would then be content-addressed.
Changes
zero_code_chunk_in_the_code_zone— 160 chunks with an all-zero chunk at 130 inthe code zone, and another at 5 in the header so a one-zone implementation is
caught.
shared_bytecode_with_a_zero_overflow_chunk— two accounts running that code:the zero code-zone chunk absent from the single leaf they would otherwise share.
_zeroed_chunkshelper, README case table, regeneratedbinary_trie_vectors.json.Both roots are reproduced independently by erigon's EIP-8297 engine and by a
separate canonical-rebuild oracle in the same repo.
test_binary_tree_fork_matches_amsterdam_modulo_known_deltasfails on this branchand on its base — unrelated
fork.pydrift from 42f26f1.