mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(rpc): Add flags to disable read tx timeout (#11856)
This commit is contained in:
3
book/cli/reth/db.md
vendored
3
book/cli/reth/db.md
vendored
@ -81,6 +81,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
Logging:
|
Logging:
|
||||||
--log.stdout.format <FORMAT>
|
--log.stdout.format <FORMAT>
|
||||||
The format to use for logs written to stdout
|
The format to use for logs written to stdout
|
||||||
|
|||||||
3
book/cli/reth/db/diff.md
vendored
3
book/cli/reth/db/diff.md
vendored
@ -45,6 +45,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
--table <TABLE>
|
--table <TABLE>
|
||||||
The table name to diff. If not specified, all tables are diffed.
|
The table name to diff. If not specified, all tables are diffed.
|
||||||
|
|
||||||
|
|||||||
3
book/cli/reth/debug/build-block.md
vendored
3
book/cli/reth/debug/build-block.md
vendored
@ -69,6 +69,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
--trusted-setup-file <PATH>
|
--trusted-setup-file <PATH>
|
||||||
Overrides the KZG trusted setup by reading from the supplied file
|
Overrides the KZG trusted setup by reading from the supplied file
|
||||||
|
|
||||||
|
|||||||
3
book/cli/reth/debug/execution.md
vendored
3
book/cli/reth/debug/execution.md
vendored
@ -69,6 +69,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
Networking:
|
Networking:
|
||||||
-d, --disable-discovery
|
-d, --disable-discovery
|
||||||
Disable the discovery service
|
Disable the discovery service
|
||||||
|
|||||||
3
book/cli/reth/debug/in-memory-merkle.md
vendored
3
book/cli/reth/debug/in-memory-merkle.md
vendored
@ -69,6 +69,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
Networking:
|
Networking:
|
||||||
-d, --disable-discovery
|
-d, --disable-discovery
|
||||||
Disable the discovery service
|
Disable the discovery service
|
||||||
|
|||||||
3
book/cli/reth/debug/merkle.md
vendored
3
book/cli/reth/debug/merkle.md
vendored
@ -69,6 +69,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
Networking:
|
Networking:
|
||||||
-d, --disable-discovery
|
-d, --disable-discovery
|
||||||
Disable the discovery service
|
Disable the discovery service
|
||||||
|
|||||||
3
book/cli/reth/debug/replay-engine.md
vendored
3
book/cli/reth/debug/replay-engine.md
vendored
@ -69,6 +69,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
Networking:
|
Networking:
|
||||||
-d, --disable-discovery
|
-d, --disable-discovery
|
||||||
Disable the discovery service
|
Disable the discovery service
|
||||||
|
|||||||
3
book/cli/reth/import.md
vendored
3
book/cli/reth/import.md
vendored
@ -69,6 +69,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
--no-state
|
--no-state
|
||||||
Disables stages that require state.
|
Disables stages that require state.
|
||||||
|
|
||||||
|
|||||||
3
book/cli/reth/init-state.md
vendored
3
book/cli/reth/init-state.md
vendored
@ -69,6 +69,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
<STATE_DUMP_FILE>
|
<STATE_DUMP_FILE>
|
||||||
JSONL file with state dump.
|
JSONL file with state dump.
|
||||||
|
|
||||||
|
|||||||
3
book/cli/reth/init.md
vendored
3
book/cli/reth/init.md
vendored
@ -69,6 +69,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
Logging:
|
Logging:
|
||||||
--log.stdout.format <FORMAT>
|
--log.stdout.format <FORMAT>
|
||||||
The format to use for logs written to stdout
|
The format to use for logs written to stdout
|
||||||
|
|||||||
3
book/cli/reth/node.md
vendored
3
book/cli/reth/node.md
vendored
@ -590,6 +590,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
Dev testnet:
|
Dev testnet:
|
||||||
--dev
|
--dev
|
||||||
Start the node in dev mode
|
Start the node in dev mode
|
||||||
|
|||||||
3
book/cli/reth/p2p.md
vendored
3
book/cli/reth/p2p.md
vendored
@ -247,6 +247,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
Logging:
|
Logging:
|
||||||
--log.stdout.format <FORMAT>
|
--log.stdout.format <FORMAT>
|
||||||
The format to use for logs written to stdout
|
The format to use for logs written to stdout
|
||||||
|
|||||||
3
book/cli/reth/prune.md
vendored
3
book/cli/reth/prune.md
vendored
@ -69,6 +69,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
Logging:
|
Logging:
|
||||||
--log.stdout.format <FORMAT>
|
--log.stdout.format <FORMAT>
|
||||||
The format to use for logs written to stdout
|
The format to use for logs written to stdout
|
||||||
|
|||||||
3
book/cli/reth/recover/storage-tries.md
vendored
3
book/cli/reth/recover/storage-tries.md
vendored
@ -69,6 +69,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
Logging:
|
Logging:
|
||||||
--log.stdout.format <FORMAT>
|
--log.stdout.format <FORMAT>
|
||||||
The format to use for logs written to stdout
|
The format to use for logs written to stdout
|
||||||
|
|||||||
3
book/cli/reth/stage/drop.md
vendored
3
book/cli/reth/stage/drop.md
vendored
@ -69,6 +69,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
<STAGE>
|
<STAGE>
|
||||||
Possible values:
|
Possible values:
|
||||||
- headers: The headers stage within the pipeline
|
- headers: The headers stage within the pipeline
|
||||||
|
|||||||
3
book/cli/reth/stage/dump.md
vendored
3
book/cli/reth/stage/dump.md
vendored
@ -76,6 +76,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
Logging:
|
Logging:
|
||||||
--log.stdout.format <FORMAT>
|
--log.stdout.format <FORMAT>
|
||||||
The format to use for logs written to stdout
|
The format to use for logs written to stdout
|
||||||
|
|||||||
3
book/cli/reth/stage/run.md
vendored
3
book/cli/reth/stage/run.md
vendored
@ -69,6 +69,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
--metrics <SOCKET>
|
--metrics <SOCKET>
|
||||||
Enable Prometheus metrics.
|
Enable Prometheus metrics.
|
||||||
|
|
||||||
|
|||||||
3
book/cli/reth/stage/unwind.md
vendored
3
book/cli/reth/stage/unwind.md
vendored
@ -74,6 +74,9 @@ Database:
|
|||||||
|
|
||||||
[possible values: true, false]
|
[possible values: true, false]
|
||||||
|
|
||||||
|
--db.read-transaction-timeout <READ_TRANSACTION_TIMEOUT>
|
||||||
|
Read transaction timeout in seconds, 0 means no timeout
|
||||||
|
|
||||||
Networking:
|
Networking:
|
||||||
-d, --disable-discovery
|
-d, --disable-discovery
|
||||||
Disable the discovery service
|
Disable the discovery service
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
//! clap [Args](clap::Args) for database configuration
|
//! clap [Args](clap::Args) for database configuration
|
||||||
|
|
||||||
|
use std::time::Duration;
|
||||||
|
|
||||||
use crate::version::default_client_version;
|
use crate::version::default_client_version;
|
||||||
use clap::{
|
use clap::{
|
||||||
builder::{PossibleValue, TypedValueParser},
|
builder::{PossibleValue, TypedValueParser},
|
||||||
error::ErrorKind,
|
error::ErrorKind,
|
||||||
Arg, Args, Command, Error,
|
Arg, Args, Command, Error,
|
||||||
};
|
};
|
||||||
use reth_db::ClientVersion;
|
use reth_db::{mdbx::MaxReadTransactionDuration, ClientVersion};
|
||||||
use reth_storage_errors::db::LogLevel;
|
use reth_storage_errors::db::LogLevel;
|
||||||
|
|
||||||
/// Parameters for database configuration
|
/// Parameters for database configuration
|
||||||
@ -20,6 +22,9 @@ pub struct DatabaseArgs {
|
|||||||
/// NFS volume.
|
/// NFS volume.
|
||||||
#[arg(long = "db.exclusive")]
|
#[arg(long = "db.exclusive")]
|
||||||
pub exclusive: Option<bool>,
|
pub exclusive: Option<bool>,
|
||||||
|
/// Read transaction timeout in seconds, 0 means no timeout.
|
||||||
|
#[arg(long = "db.read-transaction-timeout")]
|
||||||
|
pub read_transaction_timeout: Option<u64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl DatabaseArgs {
|
impl DatabaseArgs {
|
||||||
@ -33,9 +38,16 @@ impl DatabaseArgs {
|
|||||||
&self,
|
&self,
|
||||||
client_version: ClientVersion,
|
client_version: ClientVersion,
|
||||||
) -> reth_db::mdbx::DatabaseArguments {
|
) -> reth_db::mdbx::DatabaseArguments {
|
||||||
|
let max_read_transaction_duration = match self.read_transaction_timeout {
|
||||||
|
None => None, // if not specified, use default value
|
||||||
|
Some(0) => Some(MaxReadTransactionDuration::Unbounded), // if 0, disable timeout
|
||||||
|
Some(secs) => Some(MaxReadTransactionDuration::Set(Duration::from_secs(secs))),
|
||||||
|
};
|
||||||
|
|
||||||
reth_db::mdbx::DatabaseArguments::new(client_version)
|
reth_db::mdbx::DatabaseArguments::new(client_version)
|
||||||
.with_log_level(self.log_level)
|
.with_log_level(self.log_level)
|
||||||
.with_exclusive(self.exclusive)
|
.with_exclusive(self.exclusive)
|
||||||
|
.with_max_read_transaction_duration(max_read_transaction_duration)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user