From 727e33b42c4bd22ccf45904fd489c63979a78b69 Mon Sep 17 00:00:00 2001 From: Karl Date: Sat, 6 Dec 2025 13:14:40 +0800 Subject: [PATCH] resolve --- crates/cli/commands/src/db/settings.rs | 1 + crates/storage/db-api/src/models/metadata.rs | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/crates/cli/commands/src/db/settings.rs b/crates/cli/commands/src/db/settings.rs index b4d718d8030..072312cfb41 100644 --- a/crates/cli/commands/src/db/settings.rs +++ b/crates/cli/commands/src/db/settings.rs @@ -91,6 +91,7 @@ impl Command { let mut settings @ StorageSettings { receipts_in_static_files: _, transaction_senders_in_static_files: _, + storages_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 e562ede03b6..de68998ce6e 100644 --- a/crates/storage/db-api/src/models/metadata.rs +++ b/crates/storage/db-api/src/models/metadata.rs @@ -19,6 +19,9 @@ pub struct StorageSettings { /// Whether this node always writes transaction senders to static files. #[serde(default)] pub transaction_senders_in_static_files: bool, + /// Whether `StoragesHistory` is stored in `RocksDB`. + #[serde(default)] + pub storages_history_in_rocksdb: bool, } impl StorageSettings { @@ -28,7 +31,11 @@ impl StorageSettings { /// `false`, ensuring older nodes continue writing receipts and transaction senders to the /// database when receipt pruning is enabled. pub const fn legacy() -> Self { - Self { receipts_in_static_files: false, transaction_senders_in_static_files: false } + Self { + receipts_in_static_files: false, + transaction_senders_in_static_files: false, + storages_history_in_rocksdb: false, + } } /// Sets the `receipts_in_static_files` flag to the provided value. @@ -42,4 +49,10 @@ impl StorageSettings { self.transaction_senders_in_static_files = value; self } + + /// Sets the `storages_history_in_rocksdb` flag to the provided value. + pub const fn with_storages_history_in_rocksdb(mut self, value: bool) -> Self { + self.storages_history_in_rocksdb = value; + self + } }