Skip to content

core, miner: EIP-8304 variable-length index entries - #35571

Draft
VanshSahay wants to merge 6 commits into
ethereum:masterfrom
VanshSahay:eip8304-pr2
Draft

core, miner: EIP-8304 variable-length index entries#35571
VanshSahay wants to merge 6 commits into
ethereum:masterfrom
VanshSahay:eip8304-pr2

Conversation

@VanshSahay

Copy link
Copy Markdown

Swaps the interim fixed 64-byte entries for the EIP-8304 variable-length encodings (42/50/38/50 bytes, 2-byte BE type id), with the spec's one-block delay, cumulative log counts, and lexicographic sort. Field sizes are named constants so a spec change is a one-place edit. Tests pin the spec's worked example (22 entries, blocks 40-43) byte for byte.

Depends on #35496; the diff includes its commits until it merges.

Replace the interim fixed 64-byte records with the variable-length
encodings defined by EIP-8304: a 2-byte type id, the searchable
content (32 bytes, 20 for addresses) and fixed-size big-endian
position fields, for totals of 42 (block), 50 (transaction), 38
(log address) and 50 (log topic) bytes. Field sizes are named
constants so a spec change is a single-point edit.

Block entries now use the spec's one-block delay: the level-0 table
for block N holds the entry of block N-1, and none is added for the
genesis block. Transaction entries carry the cumulative log count of
the block before the transaction; log indices remain relative to the
transaction. Sorting is a lexicographic comparison of the full
encodings, which equals field-wise ordering since every field is
fixed-size big-endian.
Unit coverage of the encoder layouts, round-trip decoding, length
validation and ordering, plus a byte-for-byte reproduction of the
spec's 22-entry worked example (blocks 40-43) and the level-0
wrapper's table shape.
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