feat: add account_history_in_rocksdb field to StorageSettings (#20282)

This commit is contained in:
YK
2025-12-12 03:37:36 +08:00
committed by GitHub
parent 194d545fae
commit bfcd46d01d
2 changed files with 11 additions and 0 deletions

View File

@@ -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

View File

@@ -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
}
}