Skip to content

binary(tests): vector cases for zero code chunks in the code zone - #3305

Open
awskii wants to merge 2 commits into
ethereum:projects/binary-triefrom
awskii:tests/binary-trie-zero-chunk-vectors
Open

binary(tests): vector cases for zero code chunks in the code zone#3305
awskii wants to merge 2 commits into
ethereum:projects/binary-triefrom
awskii:tests/binary-trie-zero-chunk-vectors

Conversation

@awskii

@awskii awskii commented Aug 5, 2026

Copy link
Copy Markdown

code_chunks_of_zero_bytes is 62 bytes of code, so both its chunks live in the
account 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_accounts and code_chunks_of_zero_bytes each hold
on 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 in
    the 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_chunks helper, README case table, regenerated binary_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_deltas fails on this branch
and on its base — unrelated fork.py drift from 42f26f1.

awskii added 2 commits August 5, 2026 15:14
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.
@awskii awskii changed the title tests(binary-trie): vector cases for zero code chunks past the header tests(binary-trie): vector cases for zero code chunks in the code zone Aug 5, 2026
@spencer-tb spencer-tb changed the title tests(binary-trie): vector cases for zero code chunks in the code zone binary(tests): vector cases for zero code chunks in the code zone Aug 5, 2026
@spencer-tb spencer-tb added C-feat Category: an improvement or new feature A-tests Area: Consensus tests. C-binary Category: binary tree labels Aug 5, 2026
@kevaundray

Copy link
Copy Markdown
Contributor

Apologies do you mind rebasing ser?

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 21.91%. Comparing base (9b4db64) to head (3fb8497).
⚠️ Report is 14 commits behind head on projects/binary-trie.

❗ There is a different number of reports uploaded between BASE (9b4db64) and HEAD (3fb8497). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (9b4db64) HEAD (3fb8497)
unittests 6 2
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     
Flag Coverage Δ
unittests 21.91% <ø> (-71.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tests Area: Consensus tests. C-binary Category: binary tree C-feat Category: an improvement or new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants