From 5b1010322cdca755ccf3e9274b51c59cb2ba6e62 Mon Sep 17 00:00:00 2001 From: Georgios Konstantopoulos Date: Tue, 17 Feb 2026 17:13:31 -0800 Subject: [PATCH] docs: clarify StateWriteConfig is about database (MDBX) writes vs static files (#22299) Co-authored-by: Amp --- .../storage/storage-api/src/state_writer.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/crates/storage/storage-api/src/state_writer.rs b/crates/storage/storage-api/src/state_writer.rs index 36fbf5f94c..3427dbf7ca 100644 --- a/crates/storage/storage-api/src/state_writer.rs +++ b/crates/storage/storage-api/src/state_writer.rs @@ -127,16 +127,25 @@ pub trait StateWriter { ) -> ProviderResult>; } -/// Configuration for what to write when calling [`StateWriter::write_state`]. +/// Configuration for what to write to the database (MDBX) when calling +/// [`StateWriter::write_state`]. /// -/// Used to skip writing certain data types, when they are being written separately. +/// Some types (receipts, changesets) may be written directly to +/// static files instead of the database depending on the storage settings. This config allows +/// skipping those types in the database write to avoid duplication. #[derive(Debug, Clone, Copy)] pub struct StateWriteConfig { - /// Whether to write receipts. + /// Whether to write receipts to the database. + /// + /// Set to `false` when receipts are being written to static files instead. pub write_receipts: bool, - /// Whether to write account changesets. + /// Whether to write account changesets to the database. + /// + /// Set to `false` when account changesets are being written to static files instead. pub write_account_changesets: bool, - /// Whether to write storage changesets. + /// Whether to write storage changesets to the database. + /// + /// Set to `false` when storage changesets are being written to static files instead. pub write_storage_changesets: bool, }