feat(cli): add reth db checksum rocksdb command#21217
Merged
Conversation
Extends the `reth db checksum` command to support RocksDB tables, following the same pattern as the existing `mdbx` and `static-file` subcommands. Usage: reth db checksum rocksdb transaction-hash-numbers reth db checksum rocksdb accounts-history --limit 100000 reth db checksum rocksdb storages-history Supported tables: - transaction-hash-numbers: Transaction hash to number mapping - accounts-history: Account state change history indices - storages-history: Storage slot change history indices This enables verification that RocksDB data matches between different nodes, similar to how checksums work for MDBX tables and static files.
b178e75 to
f43ec04
Compare
joshieDo
reviewed
Jan 20, 2026
Address review feedback: edge should enable rocksdb in downstream crates instead of having rocksdb as a separate feature.
Move all RocksDB checksum code into a separate rocksdb_checksum submodule that's only compiled when the edge feature is enabled. This reduces the number of cfg attributes from 10 to just 3.
747dc52 to
dfac5ae
Compare
Add RocksDBRawIter that yields raw (key_bytes, value_bytes) pairs directly without decoding/encoding. This avoids unnecessary work when computing checksums since we only need the raw bytes.
joshieDo
reviewed
Jan 20, 2026
joshieDo
reviewed
Jan 20, 2026
This was referenced Jan 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the
reth db checksumcommand to support RocksDB tables, following the same pattern as the existingmdbxandstatic-filesubcommands from #21211.Usage
Supported RocksDB tables
transaction-hash-numbers- Transaction hash to transaction number mappingaccounts-history- Account history indicesstorages-history- Storage history indicesMotivation
When data is stored in RocksDB (e.g., TransactionHashNumbers, AccountsHistory, StoragesHistory based on storage settings), there was no way to verify the RocksDB contents match between different nodes. This enables direct comparison using the same hashing approach as the existing mdbx/static-file checksums.
Implementation
RocksDbTableenum for the three supported tablesRocksdbsubcommand (cfg-gated onunix+rocksdbfeature)foldhashhasher withRETHRETHseed for consistencyRocksDBProvider::iter()rocksdbfeature toreth-cli-commandsthat enablesreth-provider/rocksdb