From bfcd46d01dd428b184a7003a3255b9741d7c8d0c Mon Sep 17 00:00:00 2001 From: YK Date: Fri, 12 Dec 2025 03:37:36 +0800 Subject: [PATCH] feat: add `account_history_in_rocksdb` field to `StorageSettings` (#20282) --- crates/cli/commands/src/db/settings.rs | 1 + crates/storage/db-api/src/models/metadata.rs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/crates/cli/commands/src/db/settings.rs b/crates/cli/commands/src/db/settings.rs index c89d144c2b..e8a4152075 100644 --- a/crates/cli/commands/src/db/settings.rs +++ b/crates/cli/commands/src/db/settings.rs @@ -93,6 +93,7 @@ impl Command { transaction_senders_in_static_files: _, storages_history_in_rocksdb: _, transaction_hash_numbers_in_rocksdb: _, + account_history_in_rocksdb: _, } = settings.unwrap_or_else(StorageSettings::legacy); // Update the setting based on the key diff --git a/crates/storage/db-api/src/models/metadata.rs b/crates/storage/db-api/src/models/metadata.rs index 67ef25a5ea..60862e0df6 100644 --- a/crates/storage/db-api/src/models/metadata.rs +++ b/crates/storage/db-api/src/models/metadata.rs @@ -25,6 +25,9 @@ pub struct StorageSettings { /// Whether `TransactionHashNumbers` is stored in `RocksDB`. #[serde(default)] pub transaction_hash_numbers_in_rocksdb: bool, + /// Whether `AccountsHistory` is stored in `RocksDB`. + #[serde(default)] + pub account_history_in_rocksdb: bool, } impl StorageSettings { @@ -39,6 +42,7 @@ impl StorageSettings { transaction_senders_in_static_files: false, storages_history_in_rocksdb: false, transaction_hash_numbers_in_rocksdb: false, + account_history_in_rocksdb: false, } } @@ -65,4 +69,10 @@ impl StorageSettings { self.transaction_hash_numbers_in_rocksdb = value; self } + + /// Sets the `account_history_in_rocksdb` flag to the provided value. + pub const fn with_account_history_in_rocksdb(mut self, value: bool) -> Self { + self.account_history_in_rocksdb = value; + self + } }