Skip to content

chore: merge paradigmxyz/reth v2.4.1 into develop - #209

Draft
chee-chyuan wants to merge 1906 commits into
developfrom
merge-upstream-v2.4.1
Draft

chore: merge paradigmxyz/reth v2.4.1 into develop#209
chee-chyuan wants to merge 1906 commits into
developfrom
merge-upstream-v2.4.1

Conversation

@chee-chyuan

Copy link
Copy Markdown
Contributor

Draft — merges upstream paradigmxyz/reth v2.4.1 into develop (previously at ~2.2.0).

What

  • Merges v2.4.1 using v2.2.0 as the true base (develop had squash-imported 2.2.0, so a naive merge invents ~452 phantom conflicts; real set was 64 files).
  • Removes the rust-eth-triedb stack and converges the state/execution/storage/network layer to upstream v2.4.1 (upstream's sparse-trie state-root task replaces BSC's triedb).
  • reth-core fork crates → crates.io 0.5.0; workspace on revm 41.
  • Re-adds minimal BSC extension hooks reth-bsc depends on: ParliaSnapshotBlob (+ ParliaSnapshots/ParliaSnapshotsByHash tables), reth_tasks::shared_engine_runtime.
  • jit made opt-in (removed from bin/reth default) so builds don't require LLVM 21.

Status

  • cargo check --workspace is green (rustc 1.97).
  • Not yet runtime-validated — the state-root path especially needs node-deploy-bsc verification before trusting on-chain.

Needs reviewer judgment

During convergence these BSC customizations were reverted to upstream to reach a build; confirm each is acceptable or should be preserved: current_td TD-tracking, Custom/QueryTd engine messages, proxied_node_ids, tx-broadcast-size, TipZero, RPC td in convert_header.

🤖 Generated with Claude Code

mattsse and others added 30 commits June 10, 2026 21:01
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Vui-Chee <vuicheesiew@gmail.com>
Co-authored-by: Vui-Chee <46051576+Vui-Chee@users.noreply.github.com>
Co-authored-by: Alexey Shekhirin <github@shekhirin.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
…pdates (#25173)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Karl Yu <yh975593284@gmail.com>
…nfig.proxied_node_ids + proxied_peers builder, NewBlockPayload::td default)
…tree insertion

Exposes an UnboundedSender<EngineApiRequest> wired into the consensus-engine
select loop so the parlia block-import path can inject already-executed blocks
(InsertExecutedBlock) without a newPayload round-trip.
…d engine Runtime

Adds a public state_root_strategy::spawn_payload_builder_state_root that returns a
StateRootHandle, for chains whose miner builds outside the engine FCU->build path
(BSC parlia). Publishes the engine's task Runtime via set_shared_engine_runtime in
BasicEngineValidator::new so those spawns reuse the same rayon proof pools instead
of building competing per-block Runtimes.
Restores the DB-persisted total difficulty that #19151 removed (Ethereum dropped it
post-merge; BSC parlia fork choice still ranks chains by cumulative difficulty).
save_blocks writes each block's TD (parent TD + difficulty, genesis-aware) into the
HeaderTerminalDifficulties MDBX table; DatabaseProvider serves it (with a genesis
fallback), ConsistentProvider extends the on-disk tip over the in-memory tail via a
short-circuiting walk, and BlockchainProvider delegates. Fast on cold restart (reads
the persisted tip, walks only the in-memory tail) — matches the pre-upgrade fork.

Verified on node-deploy-bsc: reth validators match geth block-by-block, sparse-trie
active, and a node0 restart rejoined consensus in <1s with no genesis walk.
@chee-chyuan chee-chyuan changed the title merge: paradigmxyz/reth v2.4.1 into develop chore: merge paradigmxyz/reth v2.4.1 into develop Jul 24, 2026
chee-chyuan and others added 19 commits July 24, 2026 12:07
… deps

Left orphaned by the v2.4.1 merge / triedb removal; unused_crate_dependencies (-D
warnings) failed clippy. Removing them also satisfies udeps.
Under rocksdb's multi-threaded-cf (enabled transitively by clippy --all-features),
cf_handle returns Arc<BoundColumnFamily> not &ColumnFamily, so clippy failed with 9
mismatched-types. Enable multi-threaded-cf explicitly (consistent single model) and
port cf handles to Arc<BoundColumnFamily> + helper fns to &impl AsColumnFamilyRef.
Verified: clippy -D warnings clean. reth-bsc uses MDBX so runtime is unaffected.
…rpc-eth-api); mark feature-only alloy-trie/reth-trie-common used (stages)
…cli-commands) — merged code trips the future-incompat lint
…s); drop removed NewBlockMessage.td in bsc-p2p example
…item before #![cfg_attr], breaking the build)
…te_root

Reference the real StateRootHandle methods (take_execution_hook, state_root).
Run make update-book-cli to sync auto-generated CLI pages with the merged
v2.4.1 command surface (new migrate-v2/repair-trie/settings subcommands,
log-fmt log format, removed migrate).
…to db tip

Ports the net-new correctness fixes from #202 / #204 (chee-chyuan) onto the
v2.4.1 state-root/changeset-cache redesign, since the triedb-removal half of
#202 is already covered by the v2.4.1 upgrade.

- engine tree: clamp the Threshold persist target to the finalized block so
  losing forks stay in memory (avoids expensive on-disk trie reverts that stall
  the engine under load).
- trie-db changesets: bound the tail revert read to db_tip_block instead of the
  unbounded `next_block..`; add get_or_compute_range_tracked reporting whether an
  aggregate DB fallback ran.
- provider overlay: when the changeset cache fell back to a DB recompute, re-read
  the db tip and discard the overlay (InsufficientChangesets) if it moved, since a
  concurrent persist rewrites static-file changesets outside the MDBX snapshot.

Adapted to v2.4.1's range-aggregate changeset cache (vs #204's per-block
iteration). Metrics counters from #204 omitted to avoid a new metrics feature on
reth-trie-db. Original: 0dea17d (cherry picked, reworked).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.