From d0b3cd76e026c492f653bb8f72893e91bc28bf42 Mon Sep 17 00:00:00 2001 From: Simon Dudley Date: Mon, 1 Jul 2024 12:57:03 +1000 Subject: [PATCH] Add rocksdb and trie-log subcommands to storage command Signed-off-by: Simon Dudley --- .../reference/cli/subcommands.md | 122 +++++++++++++++++- 1 file changed, 119 insertions(+), 3 deletions(-) diff --git a/docs/public-networks/reference/cli/subcommands.md b/docs/public-networks/reference/cli/subcommands.md index 36ef4faac69..d1172f992b5 100644 --- a/docs/public-networks/reference/cli/subcommands.md +++ b/docs/public-networks/reference/cli/subcommands.md @@ -306,7 +306,7 @@ If you need to downgrade Besu, run this subcommand before installing the previou ```bash -besu storage revert-variables --config-file +besu --config-file storage revert-variables ``` @@ -314,7 +314,7 @@ besu storage revert-variables --config-file ```bash -besu storage revert-variables --config-file ../besu-local-nodes/config/besu/besu1.conf +besu --config-file config.toml storage revert-variables ``` @@ -326,6 +326,122 @@ If you need to downgrade Besu, first run this subcommand specifying the path to the [configuration file](../../how-to/use-configuration-file/index.md) normally used to start Besu. +### `rocksdb usage` + + + + + +```bash +besu --config-file storage rocksdb usage +``` + + + + + +```bash +besu --config-file config.toml storage rocksdb usage +``` + + + + + +```bash +|--------------------------------|-----------------|-------------|-----------------|------------------| +| Column Family | Keys | Total Size | SST Files Size | Blob Files Size | +|--------------------------------|-----------------|-------------|-----------------|------------------| +| BLOCKCHAIN | 2355141414 | 933 GiB | 166 GiB | 767 GiB | +| VARIABLES | 26 | 240 KiB | 240 KiB | 0 B | +| ACCOUNT_INFO_STATE | 9634454 | 496 MiB | 496 MiB | 0 B | +| ACCOUNT_STORAGE_STORAGE | 24041432 | 1 GiB | 1 GiB | 0 B | +| CODE_STORAGE | 37703864 | 12 GiB | 12 GiB | 0 B | +| TRIE_BRANCH_STORAGE | 1885032116 | 138 GiB | 138 GiB | 0 B | +| TRIE_LOG_STORAGE | 267301 | 17 GiB | 17 GiB | 0 B | +|--------------------------------|-----------------|-------------|-----------------|------------------| +| ESTIMATED TOTAL | 4311820607 | 1104 GiB | 337 GiB | 767 GiB | +|--------------------------------|-----------------|-------------|-----------------|------------------| +``` + + + + + +Displays the disk space used by the RocksDB key-value database, broken down into column families. + +### `trie-log` + +Provides Bonsai trie log related actions. + +#### `count` + + + + + +```bash +besu --config-file storage trie-log count +``` + + + + + +```bash +besu --config-file config.toml storage trie-log count +``` + + + + + +```bash +trieLog count: 742311 + - canonical count: 681039 + - fork count: 217 + - orphaned count: 61055 +``` + + + + + +Counts the number of trie logs in the database. This is the number of keys for the `TRIE_LOG_STORAGE` column family in RocksDB. Canonical count represents the finalized blockchain, fork count represents non-finalized branches of the blockchain and orphaned count represents trie logs not in the blockchain which can happen during block creation. + +#### `prune` + + + + + +```bash +besu --config-file storage trie-log prune +``` + + + + + +```bash +besu --config-file config.toml storage trie-log prune +``` + + + + + +```bash +besu --config-file config.toml --bonsai-historical-block-limit=1024 storage trie-log prune +``` + + + + + +Prunes all trie log layers below the retention limit, including orphaned trie logs. The retention limit can be configured with [`--bonsai-historical-block-limit`](options.md#bonsai-historical-block-limit). This limit should match the configuration used with [`--bonsai-limit-trie-logs-enabled`](options.md#bonsai-limit-trie-logs-enabled). The default limit is `512`. + + ## `validate-config` @@ -341,7 +457,7 @@ besu validate-config --config-file ```bash -besu validate-config --config-file ../besu-local-nodes/config/besu/besu1.conf +besu validate-config --config-file config.toml ```