Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/cli/commands/src/db/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion crates/storage/db-api/src/models/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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.
Expand All @@ -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
}
}
Loading