diff --git a/crates/cli/commands/Cargo.toml b/crates/cli/commands/Cargo.toml index 6ef89bec1e..e5be230f0d 100644 --- a/crates/cli/commands/Cargo.toml +++ b/crates/cli/commands/Cargo.toml @@ -43,7 +43,7 @@ reth-node-metrics.workspace = true reth-ethereum-primitives = { workspace = true, optional = true } reth-provider.workspace = true reth-prune.workspace = true -reth-prune-types = { workspace = true, optional = true } +reth-prune-types.workspace = true reth-revm.workspace = true reth-stages.workspace = true reth-stages-types = { workspace = true, optional = true } @@ -125,7 +125,7 @@ arbitrary = [ "reth-stages-types/test-utils", "reth-trie-common/test-utils", "reth-codecs/arbitrary", - "reth-prune-types?/arbitrary", + "reth-prune-types/arbitrary", "reth-stages-types?/arbitrary", "reth-trie-common/arbitrary", "alloy-consensus/arbitrary", diff --git a/crates/cli/commands/src/db/mod.rs b/crates/cli/commands/src/db/mod.rs index 74608b99e1..deec48440c 100644 --- a/crates/cli/commands/src/db/mod.rs +++ b/crates/cli/commands/src/db/mod.rs @@ -16,6 +16,7 @@ mod copy; mod diff; mod get; mod list; +mod prune_checkpoints; mod repair_trie; mod settings; mod state; @@ -67,6 +68,8 @@ pub enum Subcommands { Path, /// Manage storage settings Settings(settings::Command), + /// View or set prune checkpoints + PruneCheckpoints(prune_checkpoints::Command), /// Gets storage size information for an account AccountStorage(account_storage::Command), /// Gets account state and storage at a specific block @@ -205,6 +208,11 @@ impl> Command command.execute(&tool)?; }); } + Subcommands::PruneCheckpoints(command) => { + db_exec!(self.env, tool, N, command.access_rights(), { + command.execute(&tool)?; + }); + } Subcommands::AccountStorage(command) => { db_exec!(self.env, tool, N, AccessRights::RO, { command.execute(&tool)?; diff --git a/crates/cli/commands/src/db/prune_checkpoints.rs b/crates/cli/commands/src/db/prune_checkpoints.rs new file mode 100644 index 0000000000..fb95936056 --- /dev/null +++ b/crates/cli/commands/src/db/prune_checkpoints.rs @@ -0,0 +1,221 @@ +//! `reth db prune-checkpoints` command for viewing and setting prune checkpoint values. + +use clap::{Args, Parser, Subcommand, ValueEnum}; +use reth_db_common::DbTool; +use reth_provider::{providers::ProviderNodeTypes, DBProvider, DatabaseProviderFactory}; +use reth_prune_types::{PruneCheckpoint, PruneMode, PruneSegment}; +use reth_storage_api::{PruneCheckpointReader, PruneCheckpointWriter}; + +use crate::common::AccessRights; + +/// `reth db prune-checkpoints` subcommand +#[derive(Debug, Parser)] +pub struct Command { + #[command(subcommand)] + command: Subcommands, +} + +impl Command { + /// Returns database access rights required for the command. + pub fn access_rights(&self) -> AccessRights { + match &self.command { + Subcommands::Get { .. } => AccessRights::RO, + Subcommands::Set(_) => AccessRights::RW, + } + } +} + +#[derive(Debug, Subcommand)] +enum Subcommands { + /// Get prune checkpoint(s) from database. + /// + /// Shows the current prune progress for each segment, including the highest + /// pruned block/tx number and the active prune mode. + Get { + /// Specific segment to query. If omitted, shows all segments. + #[arg(long, value_enum)] + segment: Option, + }, + /// Set a prune checkpoint for a segment. + /// + /// WARNING: Manually setting checkpoints can cause data inconsistencies. + /// Only use this if you know what you're doing (e.g., recovering from a + /// corrupted checkpoint or forcing a re-prune from a specific block). + Set(SetArgs), +} + +/// Arguments for the `set` subcommand +#[derive(Debug, Args)] +pub struct SetArgs { + /// The prune segment to update + #[arg(long, value_enum)] + segment: SegmentArg, + + /// Highest pruned block number + #[arg(long)] + block_number: Option, + + /// Highest pruned transaction number + #[arg(long)] + tx_number: Option, + + /// Prune mode to write: full, distance, or before + #[arg(long, value_enum)] + mode: PruneModeArg, + + /// Value for distance or before mode (required unless mode is full) + #[arg(long, required_if_eq_any([("mode", "distance"), ("mode", "before")]))] + mode_value: Option, +} + +/// CLI-friendly prune segment names (excludes deprecated variants) +#[derive(Debug, Clone, Copy, ValueEnum)] +#[clap(rename_all = "kebab-case")] +pub enum SegmentArg { + SenderRecovery, + TransactionLookup, + Receipts, + ContractLogs, + AccountHistory, + StorageHistory, + Bodies, +} + +impl From for PruneSegment { + fn from(arg: SegmentArg) -> Self { + match arg { + SegmentArg::SenderRecovery => Self::SenderRecovery, + SegmentArg::TransactionLookup => Self::TransactionLookup, + SegmentArg::Receipts => Self::Receipts, + SegmentArg::ContractLogs => Self::ContractLogs, + SegmentArg::AccountHistory => Self::AccountHistory, + SegmentArg::StorageHistory => Self::StorageHistory, + SegmentArg::Bodies => Self::Bodies, + } + } +} + +/// CLI-friendly prune mode +#[derive(Debug, Clone, Copy, ValueEnum)] +#[clap(rename_all = "kebab-case")] +pub enum PruneModeArg { + /// Prune all blocks + Full, + /// Keep the last N blocks (requires --mode-value) + Distance, + /// Prune blocks before a specific block number (requires --mode-value) + Before, +} + +impl Command { + /// Execute the command + pub fn execute(self, tool: &DbTool) -> eyre::Result<()> { + match self.command { + Subcommands::Get { segment } => Self::get(tool, segment), + Subcommands::Set(args) => Self::set(tool, args), + } + } + + fn get( + tool: &DbTool, + segment: Option, + ) -> eyre::Result<()> { + let provider = tool.provider_factory.provider()?; + + match segment { + Some(seg) => { + let segment: PruneSegment = seg.into(); + match provider.get_prune_checkpoint(segment)? { + Some(checkpoint) => print_checkpoint(segment, &checkpoint), + None => println!("No checkpoint found for {segment}"), + } + } + None => { + let mut checkpoints = provider.get_prune_checkpoints()?; + checkpoints.sort_by_key(|(seg, _)| *seg); + if checkpoints.is_empty() { + println!("No prune checkpoints found."); + } else { + println!( + "{:<25} {:>15} {:>15} {:>20}", + "Segment", "Block Number", "Tx Number", "Prune Mode" + ); + println!("{}", "-".repeat(80)); + for (segment, checkpoint) in &checkpoints { + println!( + "{:<25} {:>15} {:>15} {:>20}", + segment.to_string(), + fmt_opt(checkpoint.block_number), + fmt_opt(checkpoint.tx_number), + fmt_mode(&checkpoint.prune_mode), + ); + } + } + } + } + + Ok(()) + } + + fn set(tool: &DbTool, args: SetArgs) -> eyre::Result<()> { + eyre::ensure!( + args.block_number.is_some() || args.tx_number.is_some(), + "at least one of --block-number or --tx-number must be provided" + ); + + let prune_mode = match args.mode { + PruneModeArg::Full => PruneMode::Full, + PruneModeArg::Distance => PruneMode::Distance( + args.mode_value + .ok_or_else(|| eyre::eyre!("--mode-value is required for distance mode"))?, + ), + PruneModeArg::Before => PruneMode::Before( + args.mode_value + .ok_or_else(|| eyre::eyre!("--mode-value is required for before mode"))?, + ), + }; + + let segment: PruneSegment = args.segment.into(); + let checkpoint = PruneCheckpoint { + block_number: args.block_number, + tx_number: args.tx_number, + prune_mode, + }; + + let provider_rw = tool.provider_factory.database_provider_rw()?; + + // Show previous value if any + if let Some(prev) = provider_rw.get_prune_checkpoint(segment)? { + println!("Previous checkpoint for {segment}:"); + print_checkpoint(segment, &prev); + println!(); + } + + provider_rw.save_prune_checkpoint(segment, checkpoint)?; + provider_rw.commit()?; + + println!("Updated checkpoint for {segment}:"); + print_checkpoint(segment, &checkpoint); + + Ok(()) + } +} + +fn print_checkpoint(segment: PruneSegment, checkpoint: &PruneCheckpoint) { + println!(" Segment: {segment}"); + println!(" Block Number: {}", fmt_opt(checkpoint.block_number)); + println!(" Tx Number: {}", fmt_opt(checkpoint.tx_number)); + println!(" Prune Mode: {}", fmt_mode(&checkpoint.prune_mode)); +} + +fn fmt_opt(val: Option) -> String { + val.map_or("-".to_string(), |n| n.to_string()) +} + +fn fmt_mode(mode: &PruneMode) -> String { + match mode { + PruneMode::Full => "Full".to_string(), + PruneMode::Distance(d) => format!("Distance({d})"), + PruneMode::Before(b) => format!("Before({b})"), + } +} diff --git a/docs/vocs/docs/pages/cli/SUMMARY.mdx b/docs/vocs/docs/pages/cli/SUMMARY.mdx index 5499909e17..646538e704 100644 --- a/docs/vocs/docs/pages/cli/SUMMARY.mdx +++ b/docs/vocs/docs/pages/cli/SUMMARY.mdx @@ -32,6 +32,9 @@ - [`reth db settings get`](./reth/db/settings/get.mdx) - [`reth db settings set`](./reth/db/settings/set.mdx) - [`reth db settings set v2`](./reth/db/settings/set/v2.mdx) + - [`reth db prune-checkpoints`](./reth/db/prune-checkpoints.mdx) + - [`reth db prune-checkpoints get`](./reth/db/prune-checkpoints/get.mdx) + - [`reth db prune-checkpoints set`](./reth/db/prune-checkpoints/set.mdx) - [`reth db account-storage`](./reth/db/account-storage.mdx) - [`reth db state`](./reth/db/state.mdx) - [`reth download`](./reth/download.mdx) diff --git a/docs/vocs/docs/pages/cli/reth/db.mdx b/docs/vocs/docs/pages/cli/reth/db.mdx index 3979c4bf5a..2245c9dd3b 100644 --- a/docs/vocs/docs/pages/cli/reth/db.mdx +++ b/docs/vocs/docs/pages/cli/reth/db.mdx @@ -22,6 +22,7 @@ Commands: version Lists current and local database versions path Returns the full database path settings Manage storage settings + prune-checkpoints View or set prune checkpoints account-storage Gets storage size information for an account state Gets account state and storage at a specific block help Print this message or the help of the given subcommand(s) diff --git a/docs/vocs/docs/pages/cli/reth/db/prune-checkpoints.mdx b/docs/vocs/docs/pages/cli/reth/db/prune-checkpoints.mdx new file mode 100644 index 0000000000..c158fa1b7f --- /dev/null +++ b/docs/vocs/docs/pages/cli/reth/db/prune-checkpoints.mdx @@ -0,0 +1,171 @@ +# reth db prune-checkpoints + +View or set prune checkpoints + +```bash +$ reth db prune-checkpoints --help +``` +```txt +Usage: reth db prune-checkpoints [OPTIONS] + +Commands: + get Get prune checkpoint(s) from database + set Set a prune checkpoint for a segment + help Print this message or the help of the given subcommand(s) + +Options: + -h, --help + Print help (see a summary with '-h') + +Datadir: + --chain + The chain this node is running. + Possible values are either a built-in chain or the path to a chain specification file. + + Built-in chains: + mainnet, sepolia, holesky, hoodi, dev + + [default: mainnet] + +Logging: + --log.stdout.format + The format to use for logs written to stdout + + Possible values: + - json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging + - log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications + - terminal: Represents terminal-friendly formatting for logs + + [default: terminal] + + --log.stdout.filter + The filter to use for logs written to stdout + + [default: ] + + --log.file.format + The format to use for logs written to the log file + + Possible values: + - json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging + - log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications + - terminal: Represents terminal-friendly formatting for logs + + [default: terminal] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.name + The prefix name of the log files + + [default: reth.log] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --color + Sets whether or not the formatter emits ANSI terminal escape codes for colors and other text formatting + + Possible values: + - always: Colors on + - auto: Auto-detect + - never: Colors off + + [default: always] + + --logs-otlp[=] + Enable `Opentelemetry` logs export to an OTLP endpoint. + + If no value provided, defaults based on protocol: - HTTP: `http://localhost:4318/v1/logs` - gRPC: `http://localhost:4317` + + Example: --logs-otlp=http://collector:4318/v1/logs + + [env: OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=] + + --logs-otlp.filter + Set a filter directive for the OTLP logs exporter. This controls the verbosity of logs sent to the OTLP endpoint. It follows the same syntax as the `RUST_LOG` environment variable. + + Example: --logs-otlp.filter=info,reth=debug + + Defaults to INFO if not specified. + + [default: info] + +Display: + -v, --verbosity... + Set the minimum log level. + + -v Errors + -vv Warnings + -vvv Info + -vvvv Debug + -vvvvv Traces (warning: very verbose!) + + -q, --quiet + Silence all log output + +Tracing: + --tracing-otlp[=] + Enable `Opentelemetry` tracing export to an OTLP endpoint. + + If no value provided, defaults based on protocol: - HTTP: `http://localhost:4318/v1/traces` - gRPC: `http://localhost:4317` + + Example: --tracing-otlp=http://collector:4318/v1/traces + + [env: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=] + + --tracing-otlp-protocol + OTLP transport protocol to use for exporting traces and logs. + + - `http`: expects endpoint path to end with `/v1/traces` or `/v1/logs` - `grpc`: expects endpoint without a path + + Defaults to HTTP if not specified. + + Possible values: + - http: HTTP/Protobuf transport, port 4318, requires `/v1/traces` path + - grpc: gRPC transport, port 4317 + + [env: OTEL_EXPORTER_OTLP_PROTOCOL=] + [default: http] + + --tracing-otlp.filter + Set a filter directive for the OTLP tracer. This controls the verbosity of spans and events sent to the OTLP endpoint. It follows the same syntax as the `RUST_LOG` environment variable. + + Example: --tracing-otlp.filter=info,reth=debug,hyper_util=off + + Defaults to TRACE if not specified. + + [default: debug] + + --tracing-otlp.sample-ratio + Trace sampling ratio to control the percentage of traces to export. + + Valid range: 0.0 to 1.0 - 1.0, default: Sample all traces - 0.01: Sample 1% of traces - 0.0: Disable sampling + + Example: --tracing-otlp.sample-ratio=0.0. + + [env: OTEL_TRACES_SAMPLER_ARG=] +``` \ No newline at end of file diff --git a/docs/vocs/docs/pages/cli/reth/db/prune-checkpoints/get.mdx b/docs/vocs/docs/pages/cli/reth/db/prune-checkpoints/get.mdx new file mode 100644 index 0000000000..35e0595b75 --- /dev/null +++ b/docs/vocs/docs/pages/cli/reth/db/prune-checkpoints/get.mdx @@ -0,0 +1,171 @@ +# reth db prune-checkpoints get + +Get prune checkpoint(s) from database. + +```bash +$ reth db prune-checkpoints get --help +``` +```txt +Usage: reth db prune-checkpoints get [OPTIONS] + +Options: + --segment + Specific segment to query. If omitted, shows all segments + + [possible values: sender-recovery, transaction-lookup, receipts, contract-logs, account-history, storage-history, bodies] + + -h, --help + Print help (see a summary with '-h') + +Datadir: + --chain + The chain this node is running. + Possible values are either a built-in chain or the path to a chain specification file. + + Built-in chains: + mainnet, sepolia, holesky, hoodi, dev + + [default: mainnet] + +Logging: + --log.stdout.format + The format to use for logs written to stdout + + Possible values: + - json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging + - log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications + - terminal: Represents terminal-friendly formatting for logs + + [default: terminal] + + --log.stdout.filter + The filter to use for logs written to stdout + + [default: ] + + --log.file.format + The format to use for logs written to the log file + + Possible values: + - json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging + - log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications + - terminal: Represents terminal-friendly formatting for logs + + [default: terminal] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.name + The prefix name of the log files + + [default: reth.log] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --color + Sets whether or not the formatter emits ANSI terminal escape codes for colors and other text formatting + + Possible values: + - always: Colors on + - auto: Auto-detect + - never: Colors off + + [default: always] + + --logs-otlp[=] + Enable `Opentelemetry` logs export to an OTLP endpoint. + + If no value provided, defaults based on protocol: - HTTP: `http://localhost:4318/v1/logs` - gRPC: `http://localhost:4317` + + Example: --logs-otlp=http://collector:4318/v1/logs + + [env: OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=] + + --logs-otlp.filter + Set a filter directive for the OTLP logs exporter. This controls the verbosity of logs sent to the OTLP endpoint. It follows the same syntax as the `RUST_LOG` environment variable. + + Example: --logs-otlp.filter=info,reth=debug + + Defaults to INFO if not specified. + + [default: info] + +Display: + -v, --verbosity... + Set the minimum log level. + + -v Errors + -vv Warnings + -vvv Info + -vvvv Debug + -vvvvv Traces (warning: very verbose!) + + -q, --quiet + Silence all log output + +Tracing: + --tracing-otlp[=] + Enable `Opentelemetry` tracing export to an OTLP endpoint. + + If no value provided, defaults based on protocol: - HTTP: `http://localhost:4318/v1/traces` - gRPC: `http://localhost:4317` + + Example: --tracing-otlp=http://collector:4318/v1/traces + + [env: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=] + + --tracing-otlp-protocol + OTLP transport protocol to use for exporting traces and logs. + + - `http`: expects endpoint path to end with `/v1/traces` or `/v1/logs` - `grpc`: expects endpoint without a path + + Defaults to HTTP if not specified. + + Possible values: + - http: HTTP/Protobuf transport, port 4318, requires `/v1/traces` path + - grpc: gRPC transport, port 4317 + + [env: OTEL_EXPORTER_OTLP_PROTOCOL=] + [default: http] + + --tracing-otlp.filter + Set a filter directive for the OTLP tracer. This controls the verbosity of spans and events sent to the OTLP endpoint. It follows the same syntax as the `RUST_LOG` environment variable. + + Example: --tracing-otlp.filter=info,reth=debug,hyper_util=off + + Defaults to TRACE if not specified. + + [default: debug] + + --tracing-otlp.sample-ratio + Trace sampling ratio to control the percentage of traces to export. + + Valid range: 0.0 to 1.0 - 1.0, default: Sample all traces - 0.01: Sample 1% of traces - 0.0: Disable sampling + + Example: --tracing-otlp.sample-ratio=0.0. + + [env: OTEL_TRACES_SAMPLER_ARG=] +``` \ No newline at end of file diff --git a/docs/vocs/docs/pages/cli/reth/db/prune-checkpoints/set.mdx b/docs/vocs/docs/pages/cli/reth/db/prune-checkpoints/set.mdx new file mode 100644 index 0000000000..af7457086e --- /dev/null +++ b/docs/vocs/docs/pages/cli/reth/db/prune-checkpoints/set.mdx @@ -0,0 +1,188 @@ +# reth db prune-checkpoints set + +Set a prune checkpoint for a segment. + +```bash +$ reth db prune-checkpoints set --help +``` +```txt +Usage: reth db prune-checkpoints set [OPTIONS] --segment --mode + +Options: + --segment + The prune segment to update + + [possible values: sender-recovery, transaction-lookup, receipts, contract-logs, account-history, storage-history, bodies] + + --block-number + Highest pruned block number + + --tx-number + Highest pruned transaction number + + --mode + Prune mode to write: full, distance, or before + + Possible values: + - full: Prune all blocks + - distance: Keep the last N blocks (requires --mode-value) + - before: Prune blocks before a specific block number (requires --mode-value) + + --mode-value + Value for distance or before mode (required unless mode is full) + + -h, --help + Print help (see a summary with '-h') + +Datadir: + --chain + The chain this node is running. + Possible values are either a built-in chain or the path to a chain specification file. + + Built-in chains: + mainnet, sepolia, holesky, hoodi, dev + + [default: mainnet] + +Logging: + --log.stdout.format + The format to use for logs written to stdout + + Possible values: + - json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging + - log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications + - terminal: Represents terminal-friendly formatting for logs + + [default: terminal] + + --log.stdout.filter + The filter to use for logs written to stdout + + [default: ] + + --log.file.format + The format to use for logs written to the log file + + Possible values: + - json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging + - log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications + - terminal: Represents terminal-friendly formatting for logs + + [default: terminal] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.name + The prefix name of the log files + + [default: reth.log] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --color + Sets whether or not the formatter emits ANSI terminal escape codes for colors and other text formatting + + Possible values: + - always: Colors on + - auto: Auto-detect + - never: Colors off + + [default: always] + + --logs-otlp[=] + Enable `Opentelemetry` logs export to an OTLP endpoint. + + If no value provided, defaults based on protocol: - HTTP: `http://localhost:4318/v1/logs` - gRPC: `http://localhost:4317` + + Example: --logs-otlp=http://collector:4318/v1/logs + + [env: OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=] + + --logs-otlp.filter + Set a filter directive for the OTLP logs exporter. This controls the verbosity of logs sent to the OTLP endpoint. It follows the same syntax as the `RUST_LOG` environment variable. + + Example: --logs-otlp.filter=info,reth=debug + + Defaults to INFO if not specified. + + [default: info] + +Display: + -v, --verbosity... + Set the minimum log level. + + -v Errors + -vv Warnings + -vvv Info + -vvvv Debug + -vvvvv Traces (warning: very verbose!) + + -q, --quiet + Silence all log output + +Tracing: + --tracing-otlp[=] + Enable `Opentelemetry` tracing export to an OTLP endpoint. + + If no value provided, defaults based on protocol: - HTTP: `http://localhost:4318/v1/traces` - gRPC: `http://localhost:4317` + + Example: --tracing-otlp=http://collector:4318/v1/traces + + [env: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=] + + --tracing-otlp-protocol + OTLP transport protocol to use for exporting traces and logs. + + - `http`: expects endpoint path to end with `/v1/traces` or `/v1/logs` - `grpc`: expects endpoint without a path + + Defaults to HTTP if not specified. + + Possible values: + - http: HTTP/Protobuf transport, port 4318, requires `/v1/traces` path + - grpc: gRPC transport, port 4317 + + [env: OTEL_EXPORTER_OTLP_PROTOCOL=] + [default: http] + + --tracing-otlp.filter + Set a filter directive for the OTLP tracer. This controls the verbosity of spans and events sent to the OTLP endpoint. It follows the same syntax as the `RUST_LOG` environment variable. + + Example: --tracing-otlp.filter=info,reth=debug,hyper_util=off + + Defaults to TRACE if not specified. + + [default: debug] + + --tracing-otlp.sample-ratio + Trace sampling ratio to control the percentage of traces to export. + + Valid range: 0.0 to 1.0 - 1.0, default: Sample all traces - 0.01: Sample 1% of traces - 0.0: Disable sampling + + Example: --tracing-otlp.sample-ratio=0.0. + + [env: OTEL_TRACES_SAMPLER_ARG=] +``` \ No newline at end of file diff --git a/docs/vocs/sidebar-cli-reth.ts b/docs/vocs/sidebar-cli-reth.ts index 314bc946fd..73dc757101 100644 --- a/docs/vocs/sidebar-cli-reth.ts +++ b/docs/vocs/sidebar-cli-reth.ts @@ -156,6 +156,21 @@ export const rethCliSidebar: SidebarItem = { } ] }, + { + text: "reth db prune-checkpoints", + link: "/cli/reth/db/prune-checkpoints", + collapsed: true, + items: [ + { + text: "reth db prune-checkpoints get", + link: "/cli/reth/db/prune-checkpoints/get" + }, + { + text: "reth db prune-checkpoints set", + link: "/cli/reth/db/prune-checkpoints/set" + } + ] + }, { text: "reth db account-storage", link: "/cli/reth/db/account-storage"