Skip to content

Commit bc5470e

Browse files
chee-chyuanconstwzjoey0612cbh876constbh
authored
chore: remove triedb (rust-eth-triedb/pathdb) state backend (#371)
* chore: reth dep (#366) Co-authored-by: joey <10592664+joey0612@users.noreply.github.com> Co-authored-by: cbh876 <3930922419@qq.com> Co-authored-by: cbh876 <30834644+constbh@users.noreply.github.com> * chore: remove triedb (rust-eth-triedb/pathdb) state backend Drops all triedb code paths and the four rust-eth-triedb* git deps so the downstream reth-bsc crate compiles against the upstream Reth tree where PR bnb-chain/reth#202 has removed the same backend. After this change the only state backend is MDBX. Pinned `bnb-chain/reth` to rev 6dcb09c0090e046eea6440fbeb58cce5db0476b2 (PR 202 head) and aligned the bsc-ef-tests crate to the same rev. - evm/builder.rs: collapsed `is_triedb_active()` + finish_with_difflayer override into `fn finish`, keeping the sparse-trie precomputed-root fast path and the MDBX `state_root_with_updates` fallback. Removed the `request_difflayer` helper. - evm/{mod,config}.rs: removed `MinerTrieDbPrefetcher` type alias, `parent_difflayers` / `triedb_prefetcher` fields on `BscNextBlockEnvAttributes` + `BscBlockExecutionCtx`, and the `create_block_builder` workaround that scrubbed them. - engine.rs: dropped the `!is_triedb_active()` gate on the sparse-trie spawner; `BscBuiltPayload::executed_block` no longer carries a difflayer (upstream `ExecutedBlock.difflayer` field deleted). - miner/payload.rs: removed `parent_difflayers` from `BscBuildArguments`, the `fetch_triedb_difflayers` helper, the prefetcher state-hook closures, the pathdb safety guard, and the `executed_block.difflayer` assignments. - miner/bid_simulator.rs: removed the triedb branch from `bid_simulate` and its `parent_difflayers` parameter. - miner/bsc_miner.rs: deleted `fetch_parent_difflayers_for_bid` and its caller. - Removed the now-unused `task_executor` field from `BscPayloadBuilder`, `BidSimulator`, and `MainWorkWorker` (it existed only to spawn the triedb prefetcher). - README.md / CLAUDE.md / main.rs / miner/config.rs: purged `--statedb.triedb` references. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: const <122766871+constwz@users.noreply.github.com> Co-authored-by: joey <10592664+joey0612@users.noreply.github.com> Co-authored-by: cbh876 <3930922419@qq.com> Co-authored-by: cbh876 <30834644+constbh@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 755d094 commit bc5470e

15 files changed

Lines changed: 312 additions & 946 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
88

99
- Workspace members: the root crate (binary `reth-bsc`, library `reth_bsc`) and `testing/bsc-ef-tests` (execution-spec tests harness).
1010
- All `reth-*` deps are pinned to one commit in `Cargo.toml` (currently `bnb-chain/reth` rev `ef46a48…`). If you change the Reth rev, update **every** `reth-*` line — a mismatched rev produces duplicate-crate build failures. The `testing/bsc-ef-tests/Cargo.toml` uses `branch = "develop"` of the same fork; that's intentional but keep it aligned when bumping.
11-
- Triedb backend (`--statedb.triedb`) pulls `rust-eth-triedb*` from `bnb-chain/reth-bsc-triedb` on the `develop` branch.
1211
- `build.rs` scans `src/system_contracts/<hardfork>/{mainnet,chapel,rialto}/*` at build time and emits `src/system_contracts/embedded_contracts.rs` (a `phf_map` keyed as `"<hardfork>_<network>_<contract>"`). It also records the git SHA into `RETH_BSC_GIT_SHA` / `RETH_BSC_GIT_SHA_LONG` used at startup and in the P2P client string. If you add a new hardfork directory with system contracts, add it to the `hardforks` list in `build.rs` so cargo rebuilds when those files change.
1312

1413
## Common commands
@@ -46,11 +45,10 @@ make ef-tests-nextest # same, via cargo-nextest
4645
make clean-eest
4746
```
4847

49-
Run (binary is `reth-bsc`, chain ids `bsc`, `bsc-testnet`; optional `--statedb.triedb`):
48+
Run (binary is `reth-bsc`, chain ids `bsc`, `bsc-testnet`):
5049
```bash
5150
./target/release/reth-bsc node --chain bsc --datadir ./data_dir
5251
./target/release/reth-bsc node --full --chain bsc --datadir ./data_dir # full node
53-
./target/release/reth-bsc node --chain bsc --datadir ./data_dir --statedb.triedb # triedb backend
5452
```
5553

5654
## Where the wiring lives

0 commit comments

Comments
 (0)