Skip to content

Commit

Permalink
SNAP and Bonsai are now Besu defaults (#1515)
Browse files Browse the repository at this point in the history
* snap and checkpoint no longer early access; snap is now default

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

* bonsai is default storage

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

* removed unnecessary config since this is now default

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

* remove description of the deleted commands.

Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Co-authored-by: bgravenorst <byron.gravenorst@consensys.net>
  • Loading branch information
macfarla and bgravenorst committed Feb 19, 2024
1 parent 625e95d commit 5cd41b3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 27 deletions.
8 changes: 2 additions & 6 deletions docs/public-networks/get-started/connect/mainnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ Run the following command or specify the options in a [configuration file](../..

```bash
besu \
--sync-mode=X_SNAP \
--data-storage-format=BONSAI \
--rpc-http-enabled=true \
--rpc-http-host=0.0.0.0 \
--rpc-ws-enabled=true \
Expand All @@ -77,8 +75,6 @@ Specify:

Also, in the command:

- [`--sync-mode`](../../reference/cli/options.md#sync-mode) specifies using [snap sync](sync-node.md#snap-synchronization).
- [`--data-storage-format`](../../reference/cli/options.md#data-storage-format) specifies using [Bonsai Tries](../../concepts/data-storage-formats.md#bonsai-tries).
- [`--rpc-http-enabled`](../../reference/cli/options.md#rpc-http-enabled) enables the HTTP JSON-RPC service.
- [`--rpc-http-host`](../../reference/cli/options.md#rpc-http-host) is set to `0.0.0.0` to allow remote RPC connections.
- [`--rpc-ws-enabled`](../../reference/cli/options.md#rpc-ws-enabled) enables the WebSocket JSON-RPC service.
Expand Down Expand Up @@ -109,7 +105,7 @@ After starting Besu and the consensus client, your node starts syncing and conne

```bash
{"@timestamp":"2023-02-03T04:43:49,555","level":"INFO","thread":"main","class":"DefaultSynchronizer","message":"Starting synchronizer.","throwable":""}
{"@timestamp":"2023-02-03T04:43:49,556","level":"INFO","thread":"main","class":"FastSyncDownloader","message":"Starting sync","throwable":""}
{"@timestamp":"2023-02-03T04:43:49,556","level":"INFO","thread":"main","class":"SnapSyncDownloader","message":"Starting sync","throwable":""}
{"@timestamp":"2023-02-03T04:43:49,559","level":"INFO","thread":"main","class":"Runner","message":"Ethereum main loop is up.","throwable":""}
{"@timestamp":"2023-02-03T04:43:53,106","level":"INFO","thread":"Timer-0","class":"DNSResolver","message":"Resolved 2409 nodes","throwable":""}
{"@timestamp":"2023-02-03T04:45:04,803","level":"INFO","thread":"nioEventLoopGroup-3-10","class":"SnapWorldStateDownloader","message":"Downloading world state from peers for pivot block 16545859 (0x616ae3c4cf85f95a9bce2814a7282d75dc2eac36
Expand All @@ -119,7 +115,7 @@ cb9f0fcc6f16386df70da3c5). State root 0xa7114541f42c62a72c8b6bb9901c2ccf4b424cd7
{"@timestamp":"2023-02-03T04:49:09,931","level":"INFO","thread":"EthScheduler-Services-3 (batchPersistAccountData)","class":"SnapsyncMetricsManager","message":"Worldstate download progress: 0.41%, Peer count: 11","throwable":""}
{"@timestamp":"2023-02-03T04:50:12,466","level":"INFO","thread":"EthScheduler-Services-3 (batchPersistAccountData)","class":"SnapsyncMetricsManager","message":"Worldstate download progress: 0.61%, Peer count: 10","throwable":""}
{"@timestamp":"2023-02-03T04:51:20,977","level":"INFO","thread":"EthScheduler-Services-3 (batchPersistAccountData)","class":"SnapsyncMetricsManager","message":"Worldstate download progress: 0.75%, Peer count: 10","throwable":""}
{"@timestamp":"2023-02-03T04:51:28,985","level":"INFO","thread":"EthScheduler-Services-29 (importBlock)","class":"FastImportBlocksStep","message":"Block import progress: 180400 of 16545859 (1%)","throwable":""}
{"@timestamp":"2023-02-03T04:51:28,985","level":"INFO","thread":"EthScheduler-Services-29 (importBlock)","class":"ImportBlocksStep","message":"Block import progress: 180400 of 16545859 (1%)","throwable":""}
```

</TabItem>
Expand Down
12 changes: 3 additions & 9 deletions docs/public-networks/get-started/connect/sync-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,19 @@ We recommend using snap sync with the [Bonsai](../../concepts/data-storage-forma

:::

Enable snap sync using [`--sync-mode=X_SNAP`](../../reference/cli/options.md#sync-mode). You need Besu version 22.4.0 or later to use snap sync.
Enable snap sync using [`--sync-mode=SNAP`](../../reference/cli/options.md#sync-mode). You need Besu version 22.4.0 or later to use snap sync.

Instead of downloading the [state trie](../../concepts/data-storage-formats.md) node by node, snap sync downloads as many leaves of the trie as possible, and reconstructs the trie locally.

You can't switch from fast sync to snap sync. If your node is blocked in the middle of a fast sync, you can start over using snap sync instead by stopping the node, deleting the data directory, and starting over using `--sync-mode=X_SNAP`.
You can't switch from fast sync to snap sync. If your node is blocked in the middle of a fast sync, you can start over using snap sync instead by stopping the node, deleting the data directory, and starting over using `--sync-mode=SNAP`.

You can restart Besu during a snap sync in case of hardware or software problems. The sync resumes from the last valid world state and continues to download blocks starting from the last downloaded block.

See [how to read the Besu metrics charts](../../how-to/monitor/understand-metrics.md) when using snap sync.

### Checkpoint synchronization

:::caution

Checkpoint sync is an early access feature.

:::

Enable checkpoint sync using [`--sync-mode=X_CHECKPOINT`](../../reference/cli/options.md#sync-mode). You need Besu version 22.4.3 or later to use checkpoint sync.
Enable checkpoint sync using [`--sync-mode=CHECKPOINT`](../../reference/cli/options.md#sync-mode). You need Besu version 22.4.3 or later to use checkpoint sync.

Checkpoint sync behaves like [snap sync](#snap-synchronization), but instead of syncing from the genesis block, it syncs from a specific checkpoint block configured in the [Besu genesis file](../../concepts/genesis-file.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/public-networks/get-started/start-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ By default, Besu syncs to the current state of the blockchain using [fast sync](
- Networks specified using [`--network`](../reference/cli/options.md#network) except for the `dev` development network.
- Ethereum Mainnet.

We recommend using [snap sync](connect/sync-node.md#snap-synchronization) for a faster sync, by starting Besu with [`--sync-mode=X_SNAP`](../reference/cli/options.md#sync-mode).
We recommend using [snap sync](connect/sync-node.md#snap-synchronization) for a faster sync, by starting Besu with [`--sync-mode=SNAP`](../reference/cli/options.md#sync-mode).

By default, Besu stores data in the [Forest of Tries](../concepts/data-storage-formats.md#forest-of-tries) format. We recommend using [Bonsai Tries](../concepts/data-storage-formats.md#bonsai-tries) for lower storage requirements, by starting Besu with [`--data-storage-format=BONSAI`](../reference/cli/options.md#data-storage-format).

Expand Down
19 changes: 9 additions & 10 deletions docs/public-networks/reference/cli/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,15 +533,15 @@ The path to the Besu data directory. The default is the directory you installed
<TabItem value="Example" label="Example">

```bash
--data-storage-format=BONSAI
--data-storage-format=FOREST
```

</TabItem>

<TabItem value="Environment variable" label="Environment variable">

```bash
BESU_DATA_STORAGE_FORMAT=BONSAI
BESU_DATA_STORAGE_FORMAT=FOREST
```

</TabItem>
Expand All @@ -556,7 +556,7 @@ data-storage-format="BONSAI"

</Tabs>

The [data storage format](../../concepts/data-storage-formats.md) to use. Set to `BONSAI` for Bonsai Tries or `FOREST` for Forest of Tries. The default is `FOREST`.
The [data storage format](../../concepts/data-storage-formats.md) to use. Set to `BONSAI` for Bonsai Tries or `FOREST` for Forest of Tries. The default is `BONSAI`.

### `discovery-dns-url`

Expand Down Expand Up @@ -4685,39 +4685,38 @@ This option does not apply to Proof of Stake networks.
<TabItem value="Example" label="Example">

```bash
--sync-mode=X_SNAP
--sync-mode=SNAP
```

</TabItem>

<TabItem value="Environment variable" label="Environment variable">

```bash
BESU_SYNC_MODE=X_SNAP
BESU_SYNC_MODE=SNAP
```

</TabItem>

<TabItem value="Configuration file" label="Configuration file">

```bash
sync-mode="X_SNAP"
sync-mode="SNAP"
```

</TabItem>

</Tabs>

The synchronization mode. Use `X_SNAP` for [snap sync](../../get-started/connect/sync-node.md#snap-synchronization), `X_CHECKPOINT` for [checkpoint sync](../../get-started/connect/sync-node.md#checkpoint-synchronization), `FAST` for [fast sync](../../get-started/connect/sync-node.md#fast-synchronization), and `FULL` for [full sync](../../get-started/connect/sync-node.md#run-an-archive-node).
The synchronization mode. Use `SNAP` for [snap sync](../../get-started/connect/sync-node.md#snap-synchronization), `CHECKPOINT` for [checkpoint sync](../../get-started/connect/sync-node.md#checkpoint-synchronization), `FAST` for [fast sync](../../get-started/connect/sync-node.md#fast-synchronization), and `FULL` for [full sync](../../get-started/connect/sync-node.md#run-an-archive-node).

- The default is `FULL` when connecting to a private network by not using the [`--network`](#network) option and specifying the [`--genesis-file`](#genesis-file) option.
- The default is `FAST` when using the [`--network`](#network) option with named networks, except for the `dev` development network. `FAST` is also the default if running Besu on the default network (Ethereum Mainnet) by specifying neither [network](#network) nor [genesis file](#genesis-file).
- The default is `SNAP` when using the [`--network`](#network) option with named networks, except for the `dev` development network. `SNAP` is also the default if running Besu on the default network (Ethereum Mainnet) by specifying neither [network](#network) nor [genesis file](#genesis-file).

:::tip

- We recommend using snap sync over fast sync because snap sync can be faster by several days.
- Checkpoint sync is an early access feature.
- It might become impossible to sync Ethereum Mainnet using fast sync in the future. Update Besu to a version that supports newer sync methods.
- It might become impossible to sync Ethereum Mainnet using fast sync in the future, as clients drop support for fast sync. We recommend you update Besu to a version that supports newer sync methods.
- When synchronizing in a mode other than `FULL`, most historical world state data is unavailable. Any methods attempting to access unavailable world state data return `null`.

:::
Expand Down
2 changes: 1 addition & 1 deletion docs/public-networks/tutorials/besu-teku-mainnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Run the following command or specify the options in a [configuration file](../ho

```bash
besu \
--sync-mode=X_SNAP \
--sync-mode=SNAP \
--data-storage-format=BONSAI \
--rpc-http-enabled=true \
--rpc-http-host="0.0.0.0" \
Expand Down

0 comments on commit 5cd41b3

Please sign in to comment.