Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: --db.exclusive flag for nfs volumes #7346

Merged
merged 5 commits into from Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions book/cli/reth/db.md
Expand Up @@ -67,6 +67,11 @@ Database:
- trace: Enables logging for trace debug-level messages
- extra: Enables logging for extra debug-level messages

--db.exclusive <EXCLUSIVE>
Open environment in exclusive/monopolistic mode. Makes it possible to open a database on an NFS volume

[possible values: true, false]

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout
Expand Down
5 changes: 5 additions & 0 deletions book/cli/reth/db/diff.md
Expand Up @@ -58,6 +58,11 @@ Database:
- trace: Enables logging for trace debug-level messages
- extra: Enables logging for extra debug-level messages

--db.exclusive <EXCLUSIVE>
Open environment in exclusive/monopolistic mode. Makes it possible to open a database on an NFS volume

[possible values: true, false]

--table <TABLE>
The table name to diff. If not specified, all tables are diffed.

Expand Down
5 changes: 5 additions & 0 deletions book/cli/reth/import.md
Expand Up @@ -58,6 +58,11 @@ Database:
- trace: Enables logging for trace debug-level messages
- extra: Enables logging for extra debug-level messages

--db.exclusive <EXCLUSIVE>
Open environment in exclusive/monopolistic mode. Makes it possible to open a database on an NFS volume

[possible values: true, false]

<IMPORT_PATH>
The path to a block file for import.

Expand Down
5 changes: 5 additions & 0 deletions book/cli/reth/init.md
Expand Up @@ -55,6 +55,11 @@ Database:
- trace: Enables logging for trace debug-level messages
- extra: Enables logging for extra debug-level messages

--db.exclusive <EXCLUSIVE>
Open environment in exclusive/monopolistic mode. Makes it possible to open a database on an NFS volume

[possible values: true, false]

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout
Expand Down
16 changes: 9 additions & 7 deletions book/cli/reth/node.md
Expand Up @@ -46,9 +46,6 @@ Options:

Mutually exclusive with `--instance`.

--trusted-setup-file <PATH>
Overrides the KZG trusted setup by reading from the supplied file

-h, --help
Print help (see a summary with '-h')

Expand Down Expand Up @@ -98,7 +95,7 @@ Networking:
--identity <IDENTITY>
Custom node identity

[default: reth/<VERSION>-<SHA>/<ARCH>]
[default: reth/<VERSION>-<SHA>/<ARCH>-gnu]

--p2p-secret-key <PATH>
Secret key to use for this node.
Expand Down Expand Up @@ -130,14 +127,14 @@ Networking:
Maximum number of inbound requests. default: 30

--pooled-tx-response-soft-limit <BYTES>
Soft limit for the byte size of a [`PooledTransactions`](reth_eth_wire::PooledTransactions) response on assembling a [`GetPooledTransactions`](reth_eth_wire::GetPooledTransactions) request. Spec'd at 2 MiB.
Soft limit for the byte size of a `PooledTransactions` response on assembling a `GetPooledTransactions` request. Spec'd at 2 MiB.

<https://github.com/ethereum/devp2p/blob/master/caps/eth.md#protocol-messages>.

[default: 2097152]

--pooled-tx-pack-soft-limit <BYTES>
Default soft limit for the byte size of a [`PooledTransactions`](reth_eth_wire::PooledTransactions) response on assembling a [`GetPooledTransactions`](reth_eth_wire::PooledTransactions) request. This defaults to less than the [`SOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESPONSE`], at 2 MiB, used when assembling a [`PooledTransactions`](reth_eth_wire::PooledTransactions) response. Default is 128 KiB
Default soft limit for the byte size of a `PooledTransactions` response on assembling a `GetPooledTransactions` request. This defaults to less than the [`SOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESPONSE`], at 2 MiB, used when assembling a `PooledTransactions` response. Default is 128 KiB

[default: 131072]

Expand Down Expand Up @@ -238,7 +235,7 @@ RPC:
--rpc-max-tracing-requests <COUNT>
Maximum number of concurrent tracing requests

[default: 10]
[default: 14]

--rpc-max-blocks-per-filter <COUNT>
Maximum number of blocks that could be scanned per filter request. (0 = entire chain)
Expand Down Expand Up @@ -434,6 +431,11 @@ Database:
- trace: Enables logging for trace debug-level messages
- extra: Enables logging for extra debug-level messages

--db.exclusive <EXCLUSIVE>
Open environment in exclusive/monopolistic mode. Makes it possible to open a database on an NFS volume

[possible values: true, false]

Dev testnet:
--dev
Start the node in dev mode
Expand Down
5 changes: 5 additions & 0 deletions book/cli/reth/p2p.md
Expand Up @@ -101,6 +101,11 @@ Database:
- trace: Enables logging for trace debug-level messages
- extra: Enables logging for extra debug-level messages

--db.exclusive <EXCLUSIVE>
Open environment in exclusive/monopolistic mode. Makes it possible to open a database on an NFS volume

[possible values: true, false]

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout
Expand Down
5 changes: 5 additions & 0 deletions book/cli/reth/recover/storage-tries.md
Expand Up @@ -55,6 +55,11 @@ Database:
- trace: Enables logging for trace debug-level messages
- extra: Enables logging for extra debug-level messages

--db.exclusive <EXCLUSIVE>
Open environment in exclusive/monopolistic mode. Makes it possible to open a database on an NFS volume

[possible values: true, false]

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout
Expand Down
5 changes: 5 additions & 0 deletions book/cli/reth/stage/drop.md
Expand Up @@ -55,6 +55,11 @@ Database:
- trace: Enables logging for trace debug-level messages
- extra: Enables logging for extra debug-level messages

--db.exclusive <EXCLUSIVE>
Open environment in exclusive/monopolistic mode. Makes it possible to open a database on an NFS volume

[possible values: true, false]

<STAGE>
Possible values:
- headers: The headers stage within the pipeline
Expand Down
5 changes: 5 additions & 0 deletions book/cli/reth/stage/dump.md
Expand Up @@ -62,6 +62,11 @@ Database:
- trace: Enables logging for trace debug-level messages
- extra: Enables logging for extra debug-level messages

--db.exclusive <EXCLUSIVE>
Open environment in exclusive/monopolistic mode. Makes it possible to open a database on an NFS volume

[possible values: true, false]

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout
Expand Down
11 changes: 8 additions & 3 deletions book/cli/reth/stage/run.md
Expand Up @@ -126,7 +126,7 @@ Networking:
--identity <IDENTITY>
Custom node identity

[default: reth/<VERSION>-<SHA>/<ARCH>]
[default: reth/<VERSION>-<SHA>/<ARCH>-gnu]

--p2p-secret-key <PATH>
Secret key to use for this node.
Expand Down Expand Up @@ -158,14 +158,14 @@ Networking:
Maximum number of inbound requests. default: 30

--pooled-tx-response-soft-limit <BYTES>
Soft limit for the byte size of a [`PooledTransactions`](reth_eth_wire::PooledTransactions) response on assembling a [`GetPooledTransactions`](reth_eth_wire::GetPooledTransactions) request. Spec'd at 2 MiB.
Soft limit for the byte size of a `PooledTransactions` response on assembling a `GetPooledTransactions` request. Spec'd at 2 MiB.

<https://github.com/ethereum/devp2p/blob/master/caps/eth.md#protocol-messages>.

[default: 2097152]

--pooled-tx-pack-soft-limit <BYTES>
Default soft limit for the byte size of a [`PooledTransactions`](reth_eth_wire::PooledTransactions) response on assembling a [`GetPooledTransactions`](reth_eth_wire::PooledTransactions) request. This defaults to less than the [`SOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESPONSE`], at 2 MiB, used when assembling a [`PooledTransactions`](reth_eth_wire::PooledTransactions) response. Default is 128 KiB
Default soft limit for the byte size of a `PooledTransactions` response on assembling a `GetPooledTransactions` request. This defaults to less than the [`SOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESPONSE`], at 2 MiB, used when assembling a `PooledTransactions` response. Default is 128 KiB

[default: 131072]

Expand All @@ -183,6 +183,11 @@ Database:
- trace: Enables logging for trace debug-level messages
- extra: Enables logging for extra debug-level messages

--db.exclusive <EXCLUSIVE>
Open environment in exclusive/monopolistic mode. Makes it possible to open a database on an NFS volume

[possible values: true, false]

-c, --commit
Commits the changes in the database. WARNING: potentially destructive.

Expand Down
5 changes: 5 additions & 0 deletions book/cli/reth/stage/unwind.md
Expand Up @@ -60,6 +60,11 @@ Database:
- trace: Enables logging for trace debug-level messages
- extra: Enables logging for extra debug-level messages

--db.exclusive <EXCLUSIVE>
Open environment in exclusive/monopolistic mode. Makes it possible to open a database on an NFS volume

[possible values: true, false]

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout
Expand Down
5 changes: 5 additions & 0 deletions crates/node-core/src/args/database_args.rs
Expand Up @@ -12,13 +12,18 @@ pub struct DatabaseArgs {
/// Database logging level. Levels higher than "notice" require a debug build.
#[arg(long = "db.log-level", value_enum)]
pub log_level: Option<LogLevel>,
/// Open environment in exclusive/monopolistic mode. Makes it possible to open a database on an
/// NFS volume.
#[arg(long = "db.exclusive", exclusive = false)]
Copy link
Collaborator

@shekhirin shekhirin Mar 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need exclusive here? https://docs.rs/clap/latest/clap/struct.Arg.html#method.exclusive

it doesn't set the default value for the argument, think we should rather leave it as None when not specified

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah OK that makes sense. Thanks for the link to the docs as well. Change incoming

pub exclusive: Option<bool>,
}

impl DatabaseArgs {
/// Returns default database arguments with configured log level and client version.
pub fn database_args(&self) -> reth_db::mdbx::DatabaseArguments {
reth_db::mdbx::DatabaseArguments::new(default_client_version())
.with_log_level(self.log_level)
.with_exclusive(self.exclusive)
}
}

Expand Down