Skip to content

fix(ethrex): track ethrex 55433c2 — JUMPDEST bitmap, state_history CF - #1

Closed
edg-l wants to merge 1 commit into
ethrex-schema-v23from
ethrex-jumpdest-bitmap
Closed

fix(ethrex): track ethrex 55433c2 — JUMPDEST bitmap, state_history CF#1
edg-l wants to merge 1 commit into
ethrex-schema-v23from
ethrex-jumpdest-bitmap

Conversation

@edg-l

@edg-l edg-l commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Stacked on ethereum#127 — review that first; this is the one commit on top.

What

Tracks ethrex to commit 55433c2 (ethpandaops glamsterdam-devnet-7). No release has these yet; v23.0.0 predates both.

  • account_codes values carry a JUMPDEST bitmap, not an RLP list of u32 offsets (ethrex#7095). One bit per bytecode byte, LSB-first, zero-length when the code has no JUMPDEST. ethrex reads both forms, so existing datadirs still boot.
  • state_history CF added (21 → 22), before bad_blocks in TABLES. Unrelated to #7095. Without it ethrex creates it itself on first boot — same defect fix(ethrex): realign DB config with ethrex v23.0.0 ethereum/state-actor#127 fixed for bad_blocks.
  • Table options for both code CFs: 4 KiB blocks + 10-bit bloom. account_code_metadata moves off our default arm onto the account_codes arm, minus blob files.

schema_version stays 3 — still ethrex's value at this commit. #7095 bumps it to 4 behind a no-op migrate_3_to_4; writing 4 early is a hard MigrationFailed boot error.

Image pin is digest-locked so it survives the tag moving. Repin to a release tag once one carries both changes.

Size effect

Crossover is ~4.2% JUMPDEST density; our max-size contract patterns sit at 99.9%, so account_codes values drop from 97,903 to 27,654 bytes — the old encoding overstated that CF by 3.54x on contract-heavy fixtures.

Verification

go build, go vet, gofmt, untagged suite clean. New unit tests cover bit position, PUSH-immediate suppression, byte-boundary crossing, the high-bit case, the zero-length case, and a cross-check against an independent scan.

Why draft:

  • testdata/genesis_dump.json not regenerated — needs the Rust harness at 55433c2. Until then TestGenesisDumpGolden asserts account_codes keys byte-exact and values against the fixture's own bytecode re-encoded (diffCFKeysOnly), which cannot catch encoder and fixture drifting together. This is the blocker; steps in testdata/gen/README.md.
  • dbs_cgo.go not typechecked locally (no librocksdb — Docker-only path). Needs a Dockerfile.ethrex builder run.
  • TestE2ESuite not run against the new pin.

account_codes values now carry a JUMPDEST bitmap (one bit per bytecode
byte, ceil(len/8) bytes, zero-length when the code has none) instead of
an RLP list of u32 offsets. ethrex reads both, branching on the RLP item
header, so an existing datadir still boots.

Also adds the state_history column family (22 CFs) and mirrors ethrex's
table options for account_codes and account_code_metadata: 4 KiB blocks
and a 10-bit bloom on both, with account_code_metadata moving off the
default arm onto 128 MiB buffers / 256 MiB files.

Boot image and Tables repin to ethrex commit 55433c2 (the ethpandaops
glamsterdam-devnet-7 build) since no release carries either change yet.
schema_version stays 3: ethrex#7095 bumps it to 4 behind a no-op
migrate_3_to_4, and that bump is not in this build.

testdata/genesis_dump.json is NOT regenerated yet, so the account_codes
comparison asserts keys byte-exact and values against the fixture's own
bytecode re-encoded, rather than against the stale fixture values.
@edg-l
edg-l force-pushed the ethrex-jumpdest-bitmap branch from c4ad7f2 to f80bd69 Compare August 4, 2026 16:05
@edg-l

edg-l commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

Reopening upstream against ethereum/state-actor.

@edg-l edg-l closed this Aug 4, 2026
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