Skip to content

fix: update CLI commands and test utilities for RocksDB support#21069

Closed
yongkangc wants to merge 8 commits intoyk/rocksdb-init-txlookupfrom
yk/rocksdb-cli-testutils
Closed

fix: update CLI commands and test utilities for RocksDB support#21069
yongkangc wants to merge 8 commits intoyk/rocksdb-init-txlookupfrom
yk/rocksdb-cli-testutils

Conversation

@yongkangc
Copy link
Member

@yongkangc yongkangc commented Jan 14, 2026

Summary
CLI commands and test utilities for RocksDB.

Changes

  • Add RocksDB-specific CLI commands
  • Add test utilities for RocksDB integration tests
  • Add RocksDBProvider::clear method for table cleanup

Testing
CLI commands and test utilities verified.


PR Stack

main
  ↑
#21063 (rocksdb-either-reader)
  ↑
#21065 (rocksdb-stage-utils)
  ↑
#21066 (rocksdb-index-history-stages)
  ↑
#21068 (rocksdb-init-txlookup)
  ↑
#21069 (rocksdb-cli-testutils) ◀ you are here
  ↑
#21070 (rocksdb-cli)
  ↑
#21071 (rocksdb-docs)

Add utility functions for RocksDB integration in stages:
- make_rocksdb_provider() - creates RocksDB provider from UnifiedStorageWriter
- make_rocksdb_batch_arg() - creates RocksDB batch for EitherWriter
- register_rocksdb_batch() - registers batch with pending batches
- collect_shards_for_unwind() - shared logic for history shard unwinding
- Add RocksDBIntegrity enum variant for metadata
Add RocksDB unwind support for IndexAccountHistory and IndexStorageHistory stages:
- Create RocksDB batch during unwind when storage settings enabled
- Use EitherWriter for history shard operations
- Register batches with pending_batches for atomic commit
Add RocksDB support for:
- Genesis history initialization via EitherWriter
- TransactionLookup stage unwind operations
- RocksDB provider append_*_history_shard methods
- Metrics for RocksDB write operations
Add a single CLI flag to enable RocksDB for all history tables:
- --storage.rocksdb enables AccountsHistory, StoragesHistory, and
  TransactionHashNumbers to be stored in RocksDB instead of MDBX

Also adds:
- `reth db settings set` subcommands for individual table control
- Updated CLI documentation
@yongkangc yongkangc force-pushed the yk/rocksdb-cli-testutils branch from d29b718 to 477d1da Compare January 15, 2026 10:12
@yongkangc yongkangc changed the base branch from joshie/par-save-blocks-rocksdb to yk/rocksdb-init-txlookup January 15, 2026 11:18
Copy link
Member

@gakonst gakonst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: PR #21069

CI Status

  • ❌ 18 failures (many likely cascading from upstream)

Changes Summary

Updates CLI commands and test utilities for RocksDB support.

Review Notes

This is a plumbing PR that threads RocksDB support through CLI and tests. Main review focus should be on upstream PRs first.


Review by @tempo_ai

@yongkangc yongkangc force-pushed the yk/rocksdb-init-txlookup branch from ff75aa9 to b365f5f Compare January 16, 2026 08:36
Update various CLI commands and test utilities for RocksDB:
- Stage drop command handles RocksDB table clearing
- Stage dump commands pass storage settings
- Test utilities provide RocksDB stubs
- Add PendingRocksDBBatches export
@yongkangc yongkangc force-pushed the yk/rocksdb-cli-testutils branch from 477d1da to 7c1744a Compare January 16, 2026 08:37
Add clear() method to RocksDBProvider and its stub implementation to
support clearing all entries from a RocksDB table. This is needed by
the stage drop CLI command to clear RocksDB history tables.

- Adds clear<T: Table>() method that iterates and deletes all entries
- Stub implementation returns Ok(()) since stub behaves as empty DB
@yongkangc yongkangc force-pushed the yk/rocksdb-init-txlookup branch from b365f5f to a7edbcd Compare January 16, 2026 13:10
@yongkangc yongkangc closed this Jan 19, 2026
@github-project-automation github-project-automation bot moved this from Backlog to Done in Reth Tracker Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rocksdb Related to rocksdb integration

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants