Skip to content

Commit

Permalink
Promote x-trie-log subcommand to trie-log (#1640)
Browse files Browse the repository at this point in the history
* Promote x-trie-log subcommand to trie-log
Signed-off-by: Simon Dudley <[email protected]>

* small edit

---------

Co-authored-by: Joan E <[email protected]>
  • Loading branch information
siladu and joaniefromtheblock authored Jun 28, 2024
1 parent 7f81a7c commit 40a103d
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions docs/public-networks/how-to/bonsai-limit-trie-logs.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

---
title: Reduce storage for Bonsai Tries
sidebar_position: 12
Expand Down Expand Up @@ -40,7 +41,7 @@ Before executing these example commands on your node, modify them to apply to yo
1. Stop Besu.
1. (Optional) Run the Besu trie log prune command. Specify the Bonsai Trie data storage format and the data directory for your Besu database:
```bash
sudo /usr/local/bin/besu/bin/besu --data-storage-format=BONSAI --data-path=/var/lib/besu --sync-mode=X_SNAP storage x-trie-log prune
sudo /usr/local/bin/besu/bin/besu --data-storage-format=BONSAI --data-path=/var/lib/besu --sync-mode=X_SNAP storage trie-log prune
```
1. Start Besu.
1. Look for `Limit trie logs enabled: retention: 512; prune window: 30000` in your Besu configuration printout at startup.
Expand All @@ -61,7 +62,7 @@ For minimal downtime, we recommend running the offline command before restarting

If you are following the guides by [Somer Esat](https://someresat.medium.com/guide-to-staking-on-ethereum-ubuntu-teku-f09ecd9ef2ee) or [CoinCashew](https://www.coincashew.com/coins/overview-eth/guide-or-how-to-setup-a-validator-on-eth2-mainnet/part-i-installation/step-3-installing-execution-client/besu), you have set the following options in your `besu.service` or `execution.service` systemd file:

```
```bash
...
ExecStart=/usr/local/bin/besu/bin/besu \
...
Expand All @@ -72,13 +73,13 @@ ExecStart=/usr/local/bin/besu/bin/besu \
```
To prune trie logs, the command should look similar to the following:

```
sudo /usr/local/bin/besu/bin/besu --data-storage-format=BONSAI --data-path=/var/lib/besu --sync-mode=SNAP storage x-trie-log prune
```bash
sudo /usr/local/bin/besu/bin/besu --data-storage-format=BONSAI --data-path=/var/lib/besu --sync-mode=SNAP storage trie-log prune
```

The logs should look similar to the following:

```
```bash
2024-02-02 05:45:41.162+00:00 | main | INFO | KeyPairUtil | Attempting to load public key from /data/besu/key
...
2024-02-02 05:45:43.433+00:00 | main | INFO | TrieLogSubCommand | Estimating trie logs size before pruning...
Expand All @@ -101,7 +102,7 @@ Prune ran successfully. We estimate you freed up 9 GiB!
If you are using a TOML configuration file, you can run a command similar to the following:

```bash
sudo /usr/local/bin/besu/bin/besu --config-file=besu-config.toml storage x-trie-log prune
sudo /usr/local/bin/besu/bin/besu --config-file=besu-config.toml storage trie-log prune
```

## Troubleshoot
Expand All @@ -118,7 +119,7 @@ To minimize errors, ensure your command specifies the following:
The prune command should look similar to the following:

```bash
sudo /usr/local/bin/besu/bin/besu --data-path=/var/lib/besu --data-storage-format=BONSAI --sync-mode=SNAP storage x-trie-log prune
sudo /usr/local/bin/besu/bin/besu --data-path=/var/lib/besu --data-storage-format=BONSAI --sync-mode=SNAP storage trie-log prune
```

Ensure you stop Besu before running the command.
Expand All @@ -132,7 +133,7 @@ To resolve, add the storage format.
The command should look similar to the following:

```bash
sudo /usr/local/bin/besu/bin/besu --data-storage-format=BONSAI --data-path=/var/lib/besu --sync-mode=SNAP storage x-trie-log prune
sudo /usr/local/bin/besu/bin/besu --data-storage-format=BONSAI --data-path=/var/lib/besu --sync-mode=SNAP storage trie-log prune
```

### Column handle not found for segment `TRIE_BRANCH_STORAGE`
Expand All @@ -143,7 +144,7 @@ Ensure you specify `--data-path`.
Your command should look similar to the following:

```bash
sudo /usr/local/bin/besu/bin/besu --data-path=/var/lib/besu --data-storage-format=BONSAI --sync-mode=SNAP storage x-trie-log prune
sudo /usr/local/bin/besu/bin/besu --data-path=/var/lib/besu --data-storage-format=BONSAI --sync-mode=SNAP storage trie-log prune
```

### Database not detected
Expand All @@ -154,7 +155,7 @@ Ensure you specify the correct `--data-path` for your node.
Your command should look similar to the following:

```bash
sudo /usr/local/bin/besu/bin/besu --data-path=/var/lib/besu --data-storage-format=BONSAI --sync-mode=SNAP storage x-trie-log prune
sudo /usr/local/bin/besu/bin/besu --data-path=/var/lib/besu --data-storage-format=BONSAI --sync-mode=SNAP storage trie-log prune
```

### Cannot store generated private key
Expand All @@ -165,7 +166,7 @@ Ensure you specify the correct `--data-path` for your node.
Your command should look similar to the following:

```bash
sudo /usr/local/bin/besu/bin/besu --data-path=/var/lib/besu --data-storage-format=BONSAI --sync-mode=SNAP storage x-trie-log prune
sudo /usr/local/bin/besu/bin/besu --data-path=/var/lib/besu --data-storage-format=BONSAI --sync-mode=SNAP storage trie-log prune
```

### Valid keypair not provided
Expand All @@ -175,7 +176,7 @@ sudo /usr/local/bin/besu/bin/besu --data-path=/var/lib/besu --data-storage-forma
Check your file permissions and try running a `sudo` command to resolve the issue:

```bash
sudo /usr/local/bin/besu/bin/besu --data-storage-format=BONSAI --data-path=/var/lib/besu storage --sync-mode=SNAP x-trie-log prune
sudo /usr/local/bin/besu/bin/besu --data-storage-format=BONSAI --data-path=/var/lib/besu storage --sync-mode=SNAP trie-log prune
```

### Column handle not found for segment `WORLD_STATE`
Expand Down Expand Up @@ -214,5 +215,5 @@ Check if you are running the command for a network other than Mainnet.
To specify a network, run a command that looks similar to the following:
```bash
sudo /usr/local/bin/besu/bin/besu --network=holesky --sync-mode=SNAP --data-storage-format=BONSAI --data-path=/var/lib/besu storage x-trie-log prune
sudo /usr/local/bin/besu/bin/besu --network=holesky --sync-mode=SNAP --data-storage-format=BONSAI --data-path=/var/lib/besu storage trie-log prune
```

0 comments on commit 40a103d

Please sign in to comment.