feat(cli): add --rocksdb.* flags for RocksDB table routing#21191
feat(cli): add --rocksdb.* flags for RocksDB table routing#21191
Conversation
Introduces RocksDbArgs struct with --rocksdb.tx-hash, --rocksdb.storages-history, and --rocksdb.account-history flags for controlling which tables route to RocksDB. These flags are genesis-initialization-only (changing later requires re-sync).
- Add test for bare flag without value (should require a value) - Add test for space-separated value syntax
Merging this PR will not alter performance
Comparing Footnotes
|
- Add rocksdb field to NodeConfig - Update init_genesis to apply RocksDB settings on top of static files settings - All struct initializers and Clone impl updated
fc5746f to
cfa9a4a
Compare
Wire RocksDbArgs through NodeCommand to enable CLI flags to be passed through to NodeConfig. Also fix clippy warnings for doc_markdown (backticks around RocksDB) and missing_const_for_fn.
Consolidate 12 tests down to 3 essential ones covering defaults, parsing, and settings application.
- If any --rocksdb.* flag is set to true, all RocksDB tables are enabled - Explicit --rocksdb.<table>=false overrides can disable specific tables - Logs startup message when grouped behavior triggers - DRY'd doc comments (genesis-only note moved to struct level) - Added comprehensive tests for grouped enable behavior
- Add test for all-explicit-false edge case - Add test verifying non-rocksdb fields preserved - Rename parameter defaults -> settings for clarity - Extract storage_settings_with_logging() helper to DRY up with_genesis/init_genesis - Fix clippy doc warnings (backticks around RocksDB)
| args: T, | ||
| } | ||
|
|
||
| #[test] |
Encapsulates the storage settings derivation logic that combines static_files.to_settings() with rocksdb.apply_to_settings() into a single method, as suggested in PR review.
|
@joshieDo refactored into the function |
b26d54d to
8ebf7fc
Compare
- Add StorageSettings::merge() to combine settings - Change RocksDbArgs::apply_to_settings() to to_settings() - Update NodeConfig::storage_settings() to use the cleaner pattern: self.static_files.to_settings().merge(self.rocksdb.to_settings())
8ebf7fc to
3972cd0
Compare
| } | ||
|
|
||
| /// Returns the effective storage settings derived from static-file and `RocksDB` CLI args. | ||
| pub fn storage_settings(&self) -> StorageSettings { |
There was a problem hiding this comment.
we can do it in this PR or on a follow-up, but we probably want to remove static_files.to_settings() i think ?
and we should make sure that the following behaviour introduced here
https://github.com/paradigmxyz/reth/pull/21208/files also applies to rocksdb
There was a problem hiding this comment.
makes sense, think we might want to do it in a separate pr - will be on this
…ocksDB flags - Remove StaticFilesArgs::to_settings() method as it's superseded by NodeConfig::storage_settings() which handles both static files and RocksDB - Add edge feature behavior to RocksDbArgs flags, matching the pattern from #21208 - Individual flags now default to true when 'edge' feature is enabled - Changed flags from Option<bool> to bool with proper defaults - Add RocksDbArgs to EnvironmentArgs in cli/commands for consistent storage settings - Update all callers to use storage_settings() instead of static_files.to_settings() Closes comment from #21191 (PR discussion r2709676364)
…ocksDB flags This PR addresses the review comment from #21191: - Remove `StaticFilesArgs::to_settings()` - superseded by `NodeConfig::storage_settings()` - Add edge feature behavior to RocksDB flags - flags default to `true` when `edge` feature is enabled - Add `RocksDbArgs` to `EnvironmentArgs` with `storage_settings()` method - Update `storage_settings()` to use `StorageSettings::edge()` or `StorageSettings::legacy()` base - Replace `static_files.to_settings()` calls with `storage_settings()` in launch/common.rs
…ocksDB flags This PR addresses the review comment from #21191: - Remove `StaticFilesArgs::to_settings()` - superseded by `NodeConfig::storage_settings()` - Add edge feature behavior to RocksDB flags - flags default to `true` when `edge` feature is enabled - Add `RocksDbArgs` to `EnvironmentArgs` with `storage_settings()` method - Update `storage_settings()` to use `StorageSettings::edge()` or `StorageSettings::legacy()` base - Replace `static_files.to_settings()` calls with `storage_settings()` in launch/common.rs
…ocksDB flags This PR addresses the review comment from #21191: - Remove `StaticFilesArgs::to_settings()` - superseded by `NodeConfig::storage_settings()` - Add edge feature behavior to RocksDB flags - flags default to `true` when `edge` feature is enabled - Add `RocksDbArgs` to `EnvironmentArgs` with `storage_settings()` method - Update `storage_settings()` to use `StorageSettings::edge()` or `StorageSettings::legacy()` base - Replace `static_files.to_settings()` calls with `storage_settings()` in launch/common.rs
…ocksDB flags This PR addresses the review comment from #21191: - Remove `StaticFilesArgs::to_settings()` - superseded by `NodeConfig::storage_settings()` - Add edge feature behavior to RocksDB flags - flags default to `true` when `edge` feature is enabled - Add `RocksDbArgs` to `EnvironmentArgs` with `storage_settings()` method - Update `storage_settings()` to use `StorageSettings::edge()` or `StorageSettings::legacy()` base - Replace `static_files.to_settings()` calls with `storage_settings()` in launch/common.rs
…ocksDB flags This PR addresses the review comment from #21191: - Remove `StaticFilesArgs::to_settings()` - superseded by `NodeConfig::storage_settings()` - Add edge feature behavior to RocksDB flags - flags default to `true` when `edge` feature is enabled - Add `RocksDbArgs` to `EnvironmentArgs` with `storage_settings()` method - Update `storage_settings()` to use `StorageSettings::edge()` or `StorageSettings::legacy()` base - Replace `static_files.to_settings()` calls with `storage_settings()` in launch/common.rs
Summary
Introduces
RocksDbArgsstruct with dedicated--rocksdb.*prefix for RocksDB table routing.Flags
--rocksdb.tx-hash- Route tx hash -> number table to RocksDB--rocksdb.storages-history- Route storages history to RocksDB--rocksdb.account-history- Route account history to RocksDBAll flags are genesis-initialization-only (changing later requires re-sync).
PR Stack
closes #20393