diff --git a/.changelog/odd-frogs-break.md b/.changelog/odd-frogs-break.md new file mode 100644 index 00000000000..098d8fbc999 --- /dev/null +++ b/.changelog/odd-frogs-break.md @@ -0,0 +1,7 @@ +--- +reth-cli-commands: minor +reth-node-core: minor +reth: patch +--- + +Made v2 storage the default for all new databases, deprecating the `--storage.v2` flag to a hidden no-op kept for backwards compatibility. Updated CLI reference docs to remove the now-hidden flag from all command help pages. diff --git a/crates/cli/commands/src/common.rs b/crates/cli/commands/src/common.rs index 20f478fc08b..ed44dff8dce 100644 --- a/crates/cli/commands/src/common.rs +++ b/crates/cli/commands/src/common.rs @@ -73,17 +73,12 @@ pub struct EnvironmentArgs { } impl EnvironmentArgs { - /// Returns the effective storage settings derived from `--storage.v2`. + /// Returns the storage settings for new database initialization. /// - /// The base storage mode is determined by `--storage.v2`: - /// - When `--storage.v2` is set: uses [`StorageSettings::v2()`] defaults - /// - Otherwise: uses [`StorageSettings::base()`] defaults + /// Always returns [`StorageSettings::v2()`] — v2 is the default for all new + /// databases. Existing databases use the settings persisted in their metadata. pub fn storage_settings(&self) -> StorageSettings { - if self.storage.v2 { - StorageSettings::v2() - } else { - StorageSettings::base() - } + StorageSettings::v2() } /// Initializes environment according to [`AccessRights`] and returns an instance of diff --git a/crates/node/core/src/args/storage.rs b/crates/node/core/src/args/storage.rs index 813e731b5cd..b054e90e029 100644 --- a/crates/node/core/src/args/storage.rs +++ b/crates/node/core/src/args/storage.rs @@ -4,26 +4,20 @@ use clap::{ArgAction, Args}; /// Parameters for storage configuration. /// -/// This controls whether the node uses v2 storage defaults (with `RocksDB` and static file -/// optimizations) or v1/legacy storage defaults. +/// V2 storage is now the default for all new databases. The `--storage.v2` flag is +/// accepted for backwards compatibility but has no effect — v2 is always used. +/// +/// Existing databases always use the settings persisted in their metadata. /// /// Individual storage settings can be overridden with `--static-files.*` and `--rocksdb.*` flags. #[derive(Debug, Args, PartialEq, Eq, Clone, Copy, Default)] #[command(next_help_heading = "Storage")] pub struct StorageArgs { - /// Enable v2 storage defaults (static files + `RocksDB` routing). - /// - /// When enabled, the node uses optimized storage settings: - /// - Receipts and transaction senders in static files - /// - History indices in `RocksDB` (accounts, storages, transaction hashes) - /// - Account and storage changesets in static files - /// - /// This is a genesis-initialization-only setting: changing it after genesis requires a - /// re-sync. + /// Deprecated no-op: v2 storage is now always enabled for new databases. /// - /// Individual settings can still be overridden with `--static-files.*` and `--rocksdb.*` - /// flags. - #[arg(long = "storage.v2", action = ArgAction::SetTrue)] + /// Kept for backwards compatibility with existing scripts and configurations. + /// Existing databases always use the settings persisted in their metadata. + #[arg(long = "storage.v2", action = ArgAction::SetTrue, hide = true)] pub v2: bool, } @@ -41,14 +35,13 @@ mod tests { #[test] fn test_default_storage_args() { - let default_args = StorageArgs::default(); let args = CommandParser::::parse_from(["reth"]).args; - assert_eq!(args, default_args); - assert!(!args.v2); + assert_eq!(args, StorageArgs::default()); } #[test] - fn test_parse_v2_flag() { + fn test_parse_v2_flag_accepted() { + // Flag is accepted for backwards compatibility but is a no-op let args = CommandParser::::parse_from(["reth", "--storage.v2"]).args; assert!(args.v2); } diff --git a/crates/node/core/src/node_config.rs b/crates/node/core/src/node_config.rs index 5b8910ab7f9..1eb367b55ae 100644 --- a/crates/node/core/src/node_config.rs +++ b/crates/node/core/src/node_config.rs @@ -371,17 +371,16 @@ impl NodeConfig { self.pruning.prune_config(&self.chain) } - /// Returns the effective storage settings derived from `--storage.v2`. + /// Returns the effective storage settings for this node. /// - /// The base storage mode is determined by `--storage.v2`: - /// - When `--storage.v2` is set: uses [`StorageSettings::v2()`] defaults - /// - Otherwise: uses [`StorageSettings::base()`] defaults + /// Always returns [`StorageSettings::v2()`] — v2 storage is the default for + /// new nodes. Existing nodes retain whatever settings are persisted in their + /// database metadata (checked during genesis init). + /// + /// Existing databases retain whatever settings are persisted in their + /// metadata (checked during genesis init). pub const fn storage_settings(&self) -> StorageSettings { - if self.storage.v2 { - StorageSettings::v2() - } else { - StorageSettings::base() - } + StorageSettings::v2() } /// Returns the max block that the node should run to, looking it up from the network if diff --git a/docs/vocs/docs/pages/cli/reth/db.mdx b/docs/vocs/docs/pages/cli/reth/db.mdx index ca07ea93a66..89de29ac57e 100644 --- a/docs/vocs/docs/pages/cli/reth/db.mdx +++ b/docs/vocs/docs/pages/cli/reth/db.mdx @@ -131,16 +131,6 @@ Static Files: --static-files.blocks-per-file.storage-change-sets Number of blocks per file for the storage changesets segment -Storage: - --storage.v2 - Enable v2 storage defaults (static files + `RocksDB` routing). - - When enabled, the node uses optimized storage settings: - Receipts and transaction senders in static files - History indices in `RocksDB` (accounts, storages, transaction hashes) - Account and storage changesets in static files - - This is a genesis-initialization-only setting: changing it after genesis requires a re-sync. - - Individual settings can still be overridden with `--static-files.*` and `--rocksdb.*` flags. - Logging: --log.stdout.format The format to use for logs written to stdout diff --git a/docs/vocs/docs/pages/cli/reth/download.mdx b/docs/vocs/docs/pages/cli/reth/download.mdx index d34108c8559..91f77d5e0c1 100644 --- a/docs/vocs/docs/pages/cli/reth/download.mdx +++ b/docs/vocs/docs/pages/cli/reth/download.mdx @@ -112,15 +112,6 @@ Static Files: Number of blocks per file for the storage changesets segment Storage: - --storage.v2 - Enable v2 storage defaults (static files + `RocksDB` routing). - - When enabled, the node uses optimized storage settings: - Receipts and transaction senders in static files - History indices in `RocksDB` (accounts, storages, transaction hashes) - Account and storage changesets in static files - - This is a genesis-initialization-only setting: changing it after genesis requires a re-sync. - - Individual settings can still be overridden with `--static-files.*` and `--rocksdb.*` flags. - -u, --url Specify a snapshot URL or let the command propose a default one. diff --git a/docs/vocs/docs/pages/cli/reth/export-era.mdx b/docs/vocs/docs/pages/cli/reth/export-era.mdx index d4c84f5e3f2..58cbeff41eb 100644 --- a/docs/vocs/docs/pages/cli/reth/export-era.mdx +++ b/docs/vocs/docs/pages/cli/reth/export-era.mdx @@ -112,15 +112,6 @@ Static Files: Number of blocks per file for the storage changesets segment Storage: - --storage.v2 - Enable v2 storage defaults (static files + `RocksDB` routing). - - When enabled, the node uses optimized storage settings: - Receipts and transaction senders in static files - History indices in `RocksDB` (accounts, storages, transaction hashes) - Account and storage changesets in static files - - This is a genesis-initialization-only setting: changing it after genesis requires a re-sync. - - Individual settings can still be overridden with `--static-files.*` and `--rocksdb.*` flags. - --first-block-number Optional first block number to export from the db. It is by default 0. diff --git a/docs/vocs/docs/pages/cli/reth/import-era.mdx b/docs/vocs/docs/pages/cli/reth/import-era.mdx index dbe911901a5..6dc604e0ee4 100644 --- a/docs/vocs/docs/pages/cli/reth/import-era.mdx +++ b/docs/vocs/docs/pages/cli/reth/import-era.mdx @@ -112,15 +112,6 @@ Static Files: Number of blocks per file for the storage changesets segment Storage: - --storage.v2 - Enable v2 storage defaults (static files + `RocksDB` routing). - - When enabled, the node uses optimized storage settings: - Receipts and transaction senders in static files - History indices in `RocksDB` (accounts, storages, transaction hashes) - Account and storage changesets in static files - - This is a genesis-initialization-only setting: changing it after genesis requires a re-sync. - - Individual settings can still be overridden with `--static-files.*` and `--rocksdb.*` flags. - --path The path to a directory for import. diff --git a/docs/vocs/docs/pages/cli/reth/import.mdx b/docs/vocs/docs/pages/cli/reth/import.mdx index 5796b5078c1..c4636008f03 100644 --- a/docs/vocs/docs/pages/cli/reth/import.mdx +++ b/docs/vocs/docs/pages/cli/reth/import.mdx @@ -112,15 +112,6 @@ Static Files: Number of blocks per file for the storage changesets segment Storage: - --storage.v2 - Enable v2 storage defaults (static files + `RocksDB` routing). - - When enabled, the node uses optimized storage settings: - Receipts and transaction senders in static files - History indices in `RocksDB` (accounts, storages, transaction hashes) - Account and storage changesets in static files - - This is a genesis-initialization-only setting: changing it after genesis requires a re-sync. - - Individual settings can still be overridden with `--static-files.*` and `--rocksdb.*` flags. - --no-state Disables stages that require state. diff --git a/docs/vocs/docs/pages/cli/reth/init-state.mdx b/docs/vocs/docs/pages/cli/reth/init-state.mdx index ca1d3357271..7f78b1478c3 100644 --- a/docs/vocs/docs/pages/cli/reth/init-state.mdx +++ b/docs/vocs/docs/pages/cli/reth/init-state.mdx @@ -112,15 +112,6 @@ Static Files: Number of blocks per file for the storage changesets segment Storage: - --storage.v2 - Enable v2 storage defaults (static files + `RocksDB` routing). - - When enabled, the node uses optimized storage settings: - Receipts and transaction senders in static files - History indices in `RocksDB` (accounts, storages, transaction hashes) - Account and storage changesets in static files - - This is a genesis-initialization-only setting: changing it after genesis requires a re-sync. - - Individual settings can still be overridden with `--static-files.*` and `--rocksdb.*` flags. - --without-evm Specifies whether to initialize the state without relying on EVM historical data. diff --git a/docs/vocs/docs/pages/cli/reth/init.mdx b/docs/vocs/docs/pages/cli/reth/init.mdx index 997162becbc..d0eddd2de16 100644 --- a/docs/vocs/docs/pages/cli/reth/init.mdx +++ b/docs/vocs/docs/pages/cli/reth/init.mdx @@ -111,16 +111,6 @@ Static Files: --static-files.blocks-per-file.storage-change-sets Number of blocks per file for the storage changesets segment -Storage: - --storage.v2 - Enable v2 storage defaults (static files + `RocksDB` routing). - - When enabled, the node uses optimized storage settings: - Receipts and transaction senders in static files - History indices in `RocksDB` (accounts, storages, transaction hashes) - Account and storage changesets in static files - - This is a genesis-initialization-only setting: changing it after genesis requires a re-sync. - - Individual settings can still be overridden with `--static-files.*` and `--rocksdb.*` flags. - Logging: --log.stdout.format The format to use for logs written to stdout diff --git a/docs/vocs/docs/pages/cli/reth/node.mdx b/docs/vocs/docs/pages/cli/reth/node.mdx index 9b4fe8a3024..e623f91c61d 100644 --- a/docs/vocs/docs/pages/cli/reth/node.mdx +++ b/docs/vocs/docs/pages/cli/reth/node.mdx @@ -1051,16 +1051,6 @@ Static Files: --static-files.blocks-per-file.storage-change-sets Number of blocks per file for the storage changesets segment -Storage: - --storage.v2 - Enable v2 storage defaults (static files + `RocksDB` routing). - - When enabled, the node uses optimized storage settings: - Receipts and transaction senders in static files - History indices in `RocksDB` (accounts, storages, transaction hashes) - Account and storage changesets in static files - - This is a genesis-initialization-only setting: changing it after genesis requires a re-sync. - - Individual settings can still be overridden with `--static-files.*` and `--rocksdb.*` flags. - Logging: --log.stdout.format The format to use for logs written to stdout diff --git a/docs/vocs/docs/pages/cli/reth/prune.mdx b/docs/vocs/docs/pages/cli/reth/prune.mdx index a24228c7414..86c176dbe88 100644 --- a/docs/vocs/docs/pages/cli/reth/prune.mdx +++ b/docs/vocs/docs/pages/cli/reth/prune.mdx @@ -111,16 +111,6 @@ Static Files: --static-files.blocks-per-file.storage-change-sets Number of blocks per file for the storage changesets segment -Storage: - --storage.v2 - Enable v2 storage defaults (static files + `RocksDB` routing). - - When enabled, the node uses optimized storage settings: - Receipts and transaction senders in static files - History indices in `RocksDB` (accounts, storages, transaction hashes) - Account and storage changesets in static files - - This is a genesis-initialization-only setting: changing it after genesis requires a re-sync. - - Individual settings can still be overridden with `--static-files.*` and `--rocksdb.*` flags. - Metrics: --metrics Enable Prometheus metrics. diff --git a/docs/vocs/docs/pages/cli/reth/re-execute.mdx b/docs/vocs/docs/pages/cli/reth/re-execute.mdx index c09131bad9c..c9901f6ef64 100644 --- a/docs/vocs/docs/pages/cli/reth/re-execute.mdx +++ b/docs/vocs/docs/pages/cli/reth/re-execute.mdx @@ -112,15 +112,6 @@ Static Files: Number of blocks per file for the storage changesets segment Storage: - --storage.v2 - Enable v2 storage defaults (static files + `RocksDB` routing). - - When enabled, the node uses optimized storage settings: - Receipts and transaction senders in static files - History indices in `RocksDB` (accounts, storages, transaction hashes) - Account and storage changesets in static files - - This is a genesis-initialization-only setting: changing it after genesis requires a re-sync. - - Individual settings can still be overridden with `--static-files.*` and `--rocksdb.*` flags. - --from The height to start at diff --git a/docs/vocs/docs/pages/cli/reth/stage/drop.mdx b/docs/vocs/docs/pages/cli/reth/stage/drop.mdx index 88d395cc099..b038dc6cf65 100644 --- a/docs/vocs/docs/pages/cli/reth/stage/drop.mdx +++ b/docs/vocs/docs/pages/cli/reth/stage/drop.mdx @@ -112,15 +112,6 @@ Static Files: Number of blocks per file for the storage changesets segment Storage: - --storage.v2 - Enable v2 storage defaults (static files + `RocksDB` routing). - - When enabled, the node uses optimized storage settings: - Receipts and transaction senders in static files - History indices in `RocksDB` (accounts, storages, transaction hashes) - Account and storage changesets in static files - - This is a genesis-initialization-only setting: changing it after genesis requires a re-sync. - - Individual settings can still be overridden with `--static-files.*` and `--rocksdb.*` flags. - Possible values: - headers: The headers stage within the pipeline diff --git a/docs/vocs/docs/pages/cli/reth/stage/dump.mdx b/docs/vocs/docs/pages/cli/reth/stage/dump.mdx index 8a5d54d2257..2366fc9826b 100644 --- a/docs/vocs/docs/pages/cli/reth/stage/dump.mdx +++ b/docs/vocs/docs/pages/cli/reth/stage/dump.mdx @@ -118,16 +118,6 @@ Static Files: --static-files.blocks-per-file.storage-change-sets Number of blocks per file for the storage changesets segment -Storage: - --storage.v2 - Enable v2 storage defaults (static files + `RocksDB` routing). - - When enabled, the node uses optimized storage settings: - Receipts and transaction senders in static files - History indices in `RocksDB` (accounts, storages, transaction hashes) - Account and storage changesets in static files - - This is a genesis-initialization-only setting: changing it after genesis requires a re-sync. - - Individual settings can still be overridden with `--static-files.*` and `--rocksdb.*` flags. - Logging: --log.stdout.format The format to use for logs written to stdout diff --git a/docs/vocs/docs/pages/cli/reth/stage/run.mdx b/docs/vocs/docs/pages/cli/reth/stage/run.mdx index e1a2748e734..7ea51f6741b 100644 --- a/docs/vocs/docs/pages/cli/reth/stage/run.mdx +++ b/docs/vocs/docs/pages/cli/reth/stage/run.mdx @@ -112,15 +112,6 @@ Static Files: Number of blocks per file for the storage changesets segment Storage: - --storage.v2 - Enable v2 storage defaults (static files + `RocksDB` routing). - - When enabled, the node uses optimized storage settings: - Receipts and transaction senders in static files - History indices in `RocksDB` (accounts, storages, transaction hashes) - Account and storage changesets in static files - - This is a genesis-initialization-only setting: changing it after genesis requires a re-sync. - - Individual settings can still be overridden with `--static-files.*` and `--rocksdb.*` flags. - --metrics Enable Prometheus metrics. diff --git a/docs/vocs/docs/pages/cli/reth/stage/unwind.mdx b/docs/vocs/docs/pages/cli/reth/stage/unwind.mdx index cb9675dba61..efe541ddbb1 100644 --- a/docs/vocs/docs/pages/cli/reth/stage/unwind.mdx +++ b/docs/vocs/docs/pages/cli/reth/stage/unwind.mdx @@ -117,15 +117,6 @@ Static Files: Number of blocks per file for the storage changesets segment Storage: - --storage.v2 - Enable v2 storage defaults (static files + `RocksDB` routing). - - When enabled, the node uses optimized storage settings: - Receipts and transaction senders in static files - History indices in `RocksDB` (accounts, storages, transaction hashes) - Account and storage changesets in static files - - This is a genesis-initialization-only setting: changing it after genesis requires a re-sync. - - Individual settings can still be overridden with `--static-files.*` and `--rocksdb.*` flags. - --offline If this is enabled, then all stages except headers, bodies, and sender recovery will be unwound