feat(trie): Add helper sub-command (#18301)

This commit is contained in:
Brian Picciano
2025-09-08 13:05:15 +02:00
committed by GitHub
parent 81b2e16fb6
commit 366d641cc3
12 changed files with 1714 additions and 13 deletions

View File

@@ -18,6 +18,7 @@
- [`reth db clear`](/cli/reth/db/clear)
- [`reth db clear mdbx`](/cli/reth/db/clear/mdbx)
- [`reth db clear static-file`](/cli/reth/db/clear/static-file)
- [`reth db repair-trie`](/cli/reth/db/repair-trie)
- [`reth db version`](/cli/reth/db/version)
- [`reth db path`](/cli/reth/db/path)
- [`reth download`](/cli/reth/download)

View File

@@ -9,16 +9,17 @@ $ reth db --help
Usage: reth db [OPTIONS] <COMMAND>
Commands:
stats Lists all the tables, their entry count and their size
list Lists the contents of a table
checksum Calculates the content checksum of a table
diff Create a diff between two database tables or two entire databases
get Gets the content of a table for the given key
drop Deletes all database entries
clear Deletes all table entries
version Lists current and local database versions
path Returns the full database path
help Print this message or the help of the given subcommand(s)
stats Lists all the tables, their entry count and their size
list Lists the contents of a table
checksum Calculates the content checksum of a table
diff Create a diff between two database tables or two entire databases
get Gets the content of a table for the given key
drop Deletes all database entries
clear Deletes all table entries
repair-trie Verifies trie consistency and outputs any inconsistencies
version Lists current and local database versions
path Returns the full database path
help Print this message or the help of the given subcommand(s)
Options:
-h, --help

View File

@@ -0,0 +1,109 @@
# reth db repair-trie
Verifies trie consistency and outputs any inconsistencies
```bash
$ reth db repair-trie --help
```
```txt
Usage: reth db repair-trie [OPTIONS]
Options:
--dry-run
Only show inconsistencies without making any repairs
-h, --help
Print help (see a summary with '-h')
Datadir:
--chain <CHAIN_OR_PATH>
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 <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 <FILTER>
The filter to use for logs written to stdout
[default: ]
--log.file.format <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 <FILTER>
The filter to use for logs written to the log file
[default: debug]
--log.file.directory <PATH>
The path to put log files in
[default: <CACHE_DIR>/logs]
--log.file.name <NAME>
The prefix name of the log files
[default: reth.log]
--log.file.max-size <SIZE>
The maximum size (in MB) of one log file
[default: 200]
--log.file.max-files <COUNT>
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 <FILTER>
The filter to use for logs written to journald
[default: error]
--color <COLOR>
Sets whether or not the formatter emits ANSI terminal escape codes for colors and other text formatting
Possible values:
- always: Colors on
- auto: Colors on
- never: Colors off
[default: always]
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
```