Skip to content
Merged
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
2 changes: 1 addition & 1 deletion crates/node/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ min-debug-logs = ["tracing/release_max_level_debug"]
min-trace-logs = ["tracing/release_max_level_trace"]

# Marker feature for edge/unstable builds - captured by vergen in build.rs
edge = []
edge = ["reth-provider/edge"]

[build-dependencies]
vergen = { workspace = true, features = ["build", "cargo", "emit_and_set"] }
Expand Down
39 changes: 33 additions & 6 deletions crates/node/core/src/args/static_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@ use reth_provider::StorageSettings;
/// 10000 blocks per static file allows us to prune all history every 10k blocks.
pub const MINIMAL_BLOCKS_PER_FILE: u64 = 10000;

/// Default value for static file storage flags.
///
/// When the `edge` feature is enabled, defaults to `true` to enable edge storage features.
/// Otherwise defaults to `false` for legacy behavior.
const fn default_static_file_flag() -> bool {
cfg!(feature = "edge")
}

/// Parameters for static files configuration
#[derive(Debug, Args, PartialEq, Eq, Default, Clone, Copy)]
#[derive(Debug, Args, PartialEq, Eq, Clone, Copy)]
#[command(next_help_heading = "Static Files")]
pub struct StaticFilesArgs {
/// Number of blocks per file for the headers segment.
Expand Down Expand Up @@ -39,7 +47,7 @@ pub struct StaticFilesArgs {
///
/// Note: This setting can only be configured at genesis initialization. Once
/// the node has been initialized, changing this flag requires re-syncing from scratch.
#[arg(long = "static-files.receipts")]
#[arg(long = "static-files.receipts", default_value_t = default_static_file_flag(), action = clap::ArgAction::Set)]
pub receipts: bool,

/// Store transaction senders in static files instead of the database.
Expand All @@ -49,7 +57,7 @@ pub struct StaticFilesArgs {
///
/// Note: This setting can only be configured at genesis initialization. Once
/// the node has been initialized, changing this flag requires re-syncing from scratch.
#[arg(long = "static-files.transaction-senders")]
#[arg(long = "static-files.transaction-senders", default_value_t = default_static_file_flag(), action = clap::ArgAction::Set)]
pub transaction_senders: bool,

/// Store account changesets in static files.
Expand All @@ -59,7 +67,7 @@ pub struct StaticFilesArgs {
///
/// Note: This setting can only be configured at genesis initialization. Once
/// the node has been initialized, changing this flag requires re-syncing from scratch.
#[arg(long = "static-files.account-change-sets")]
#[arg(long = "static-files.account-change-sets", default_value_t = default_static_file_flag(), action = clap::ArgAction::Set)]
pub account_changesets: bool,
}

Expand Down Expand Up @@ -97,9 +105,28 @@ impl StaticFilesArgs {

/// Converts the static files arguments into [`StorageSettings`].
pub const fn to_settings(&self) -> StorageSettings {
StorageSettings::legacy()
.with_receipts_in_static_files(self.receipts)
#[cfg(feature = "edge")]
let base = StorageSettings::edge();
#[cfg(not(feature = "edge"))]
let base = StorageSettings::legacy();

base.with_receipts_in_static_files(self.receipts)
.with_transaction_senders_in_static_files(self.transaction_senders)
.with_account_changesets_in_static_files(self.account_changesets)
}
}

impl Default for StaticFilesArgs {
fn default() -> Self {
Self {
blocks_per_file_headers: None,
blocks_per_file_transactions: None,
blocks_per_file_receipts: None,
blocks_per_file_transaction_senders: None,
blocks_per_file_account_change_sets: None,
receipts: default_static_file_flag(),
transaction_senders: default_static_file_flag(),
account_changesets: default_static_file_flag(),
}
}
}
1 change: 1 addition & 0 deletions crates/storage/provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ rand.workspace = true
tokio = { workspace = true, features = ["sync", "macros", "rt-multi-thread"] }

[features]
edge = ["reth-storage-api/edge"]
rocksdb = ["dep:rocksdb"]
test-utils = [
"reth-db/test-utils",
Expand Down
1 change: 1 addition & 0 deletions crates/storage/storage-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ serde_json = { workspace = true, optional = true }

[features]
default = ["std"]
edge = ["reth-db-api/edge"]
std = [
"reth-chainspec/std",
"alloy-consensus/std",
Expand Down
15 changes: 12 additions & 3 deletions docs/vocs/docs/pages/cli/op-reth/db.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,27 +124,36 @@ Static Files:
--static-files.blocks-per-file.account-change-sets <BLOCKS_PER_FILE_ACCOUNT_CHANGE_SETS>
Number of blocks per file for the account changesets segment

--static-files.receipts
--static-files.receipts <RECEIPTS>
Store receipts in static files instead of the database.

When enabled, receipts will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

--static-files.transaction-senders
[default: false]
[possible values: true, false]

--static-files.transaction-senders <TRANSACTION_SENDERS>
Store transaction senders in static files instead of the database.

When enabled, transaction senders will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

--static-files.account-change-sets
[default: false]
[possible values: true, false]

--static-files.account-change-sets <ACCOUNT_CHANGESETS>
Store account changesets in static files.

When enabled, account changesets will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

[default: false]
[possible values: true, false]

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout
Expand Down
15 changes: 12 additions & 3 deletions docs/vocs/docs/pages/cli/op-reth/import-op.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,36 @@ Static Files:
--static-files.blocks-per-file.account-change-sets <BLOCKS_PER_FILE_ACCOUNT_CHANGE_SETS>
Number of blocks per file for the account changesets segment

--static-files.receipts
--static-files.receipts <RECEIPTS>
Store receipts in static files instead of the database.

When enabled, receipts will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

--static-files.transaction-senders
[default: false]
[possible values: true, false]

--static-files.transaction-senders <TRANSACTION_SENDERS>
Store transaction senders in static files instead of the database.

When enabled, transaction senders will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

--static-files.account-change-sets
[default: false]
[possible values: true, false]

--static-files.account-change-sets <ACCOUNT_CHANGESETS>
Store account changesets in static files.

When enabled, account changesets will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

[default: false]
[possible values: true, false]

--chunk-len <CHUNK_LEN>
Chunk byte length to read from file.

Expand Down
15 changes: 12 additions & 3 deletions docs/vocs/docs/pages/cli/op-reth/import-receipts-op.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,36 @@ Static Files:
--static-files.blocks-per-file.account-change-sets <BLOCKS_PER_FILE_ACCOUNT_CHANGE_SETS>
Number of blocks per file for the account changesets segment

--static-files.receipts
--static-files.receipts <RECEIPTS>
Store receipts in static files instead of the database.

When enabled, receipts will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

--static-files.transaction-senders
[default: false]
[possible values: true, false]

--static-files.transaction-senders <TRANSACTION_SENDERS>
Store transaction senders in static files instead of the database.

When enabled, transaction senders will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

--static-files.account-change-sets
[default: false]
[possible values: true, false]

--static-files.account-change-sets <ACCOUNT_CHANGESETS>
Store account changesets in static files.

When enabled, account changesets will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

[default: false]
[possible values: true, false]

--chunk-len <CHUNK_LEN>
Chunk byte length to read from file.

Expand Down
15 changes: 12 additions & 3 deletions docs/vocs/docs/pages/cli/op-reth/init-state.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,36 @@ Static Files:
--static-files.blocks-per-file.account-change-sets <BLOCKS_PER_FILE_ACCOUNT_CHANGE_SETS>
Number of blocks per file for the account changesets segment

--static-files.receipts
--static-files.receipts <RECEIPTS>
Store receipts in static files instead of the database.

When enabled, receipts will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

--static-files.transaction-senders
[default: false]
[possible values: true, false]

--static-files.transaction-senders <TRANSACTION_SENDERS>
Store transaction senders in static files instead of the database.

When enabled, transaction senders will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

--static-files.account-change-sets
[default: false]
[possible values: true, false]

--static-files.account-change-sets <ACCOUNT_CHANGESETS>
Store account changesets in static files.

When enabled, account changesets will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

[default: false]
[possible values: true, false]

--without-evm
Specifies whether to initialize the state without relying on EVM historical data.

Expand Down
15 changes: 12 additions & 3 deletions docs/vocs/docs/pages/cli/op-reth/init.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,36 @@ Static Files:
--static-files.blocks-per-file.account-change-sets <BLOCKS_PER_FILE_ACCOUNT_CHANGE_SETS>
Number of blocks per file for the account changesets segment

--static-files.receipts
--static-files.receipts <RECEIPTS>
Store receipts in static files instead of the database.

When enabled, receipts will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

--static-files.transaction-senders
[default: false]
[possible values: true, false]

--static-files.transaction-senders <TRANSACTION_SENDERS>
Store transaction senders in static files instead of the database.

When enabled, transaction senders will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

--static-files.account-change-sets
[default: false]
[possible values: true, false]

--static-files.account-change-sets <ACCOUNT_CHANGESETS>
Store account changesets in static files.

When enabled, account changesets will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

[default: false]
[possible values: true, false]

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout
Expand Down
15 changes: 12 additions & 3 deletions docs/vocs/docs/pages/cli/op-reth/node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1003,27 +1003,36 @@ Static Files:
--static-files.blocks-per-file.account-change-sets <BLOCKS_PER_FILE_ACCOUNT_CHANGE_SETS>
Number of blocks per file for the account changesets segment

--static-files.receipts
--static-files.receipts <RECEIPTS>
Store receipts in static files instead of the database.

When enabled, receipts will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

--static-files.transaction-senders
[default: false]
[possible values: true, false]

--static-files.transaction-senders <TRANSACTION_SENDERS>
Store transaction senders in static files instead of the database.

When enabled, transaction senders will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

--static-files.account-change-sets
[default: false]
[possible values: true, false]

--static-files.account-change-sets <ACCOUNT_CHANGESETS>
Store account changesets in static files.

When enabled, account changesets will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

[default: false]
[possible values: true, false]

Rollup:
--rollup.sequencer <SEQUENCER>
Endpoint for the sequencer mempool (can be both HTTP and WS)
Expand Down
15 changes: 12 additions & 3 deletions docs/vocs/docs/pages/cli/op-reth/prune.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,36 @@ Static Files:
--static-files.blocks-per-file.account-change-sets <BLOCKS_PER_FILE_ACCOUNT_CHANGE_SETS>
Number of blocks per file for the account changesets segment

--static-files.receipts
--static-files.receipts <RECEIPTS>
Store receipts in static files instead of the database.

When enabled, receipts will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

--static-files.transaction-senders
[default: false]
[possible values: true, false]

--static-files.transaction-senders <TRANSACTION_SENDERS>
Store transaction senders in static files instead of the database.

When enabled, transaction senders will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

--static-files.account-change-sets
[default: false]
[possible values: true, false]

--static-files.account-change-sets <ACCOUNT_CHANGESETS>
Store account changesets in static files.

When enabled, account changesets will be written to static files on disk instead of the database.

Note: This setting can only be configured at genesis initialization. Once the node has been initialized, changing this flag requires re-syncing from scratch.

[default: false]
[possible values: true, false]

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout
Expand Down
Loading
Loading