Skip to content

Commit 1cd803d

Browse files
authored
Merge pull request #1851 from jsvisa/snap-sync
docs(node): restruct the snap sync
2 parents 29f1e46 + 8520843 commit 1cd803d

File tree

5 files changed

+361
-99
lines changed

5 files changed

+361
-99
lines changed

docs.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,6 +2112,7 @@
21122112
{
21132113
"group": "Management",
21142114
"pages": [
2115+
"node-operators/guides/management/archive-node",
21152116
"node-operators/guides/management/blobs",
21162117
"node-operators/guides/management/regenesis-history",
21172118
"node-operators/guides/management/snap-sync",
@@ -2144,7 +2145,14 @@
21442145
"node-operators/reference/architecture/rollup-node"
21452146
]
21462147
},
2148+
{
2149+
"group": "Features",
2150+
"pages": [
2151+
"node-operators/reference/features/snap-sync"
2152+
]
2153+
},
21472154
"node-operators/reference/json-rpc",
2155+
"node-operators/reference/consensus-layer-sync",
21482156
"node-operators/reference/releases"
21492157
]
21502158
}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
---
2+
title: Running an archive node
3+
description: Learn how to configure and run an archive node.
4+
---
5+
6+
This guide shows you how to configure your node to run as an archive node. Archive nodes store the complete history of the blockchain, including all historical states.
7+
8+
## Overview
9+
10+
Archive nodes maintain the entire state history of the blockchain, allowing you to query any historical state at any block height. This is useful for:
11+
12+
* Block explorers that need to provide historical data
13+
* Analytics and data analysis applications
14+
* Services that need to query historical state
15+
* Debugging and auditing purposes
16+
17+
Archive nodes use execution-layer sync but configure the execution client to retain all historical state data instead of pruning it.
18+
19+
## Requirements
20+
21+
* **OP Mainnet**: Requires the [bedrock datadir](/operators/node-operators/management/snapshots)
22+
* **Other OP Stack networks**: No datadir required
23+
* **Storage**: Archive nodes require significantly more disk space than regular nodes (several terabytes for OP Mainnet)
24+
* **Sync time**: Archive sync with execution-layer mode is faster than full block-by-block execution
25+
26+
## Configuration
27+
28+
### Configuration for op-node
29+
30+
Set the following flag on `op-node`:
31+
32+
```shell
33+
--syncmode=execution-layer
34+
```
35+
36+
<Info>
37+
The `--syncmode=execution-layer` flag is not the default setting and must be explicitly configured.
38+
</Info>
39+
40+
### Configuration for op-geth
41+
42+
Set the following flags on `op-geth`:
43+
44+
```shell
45+
--syncmode=full
46+
--gcmode=archive
47+
```
48+
49+
<Info>
50+
Both flags are not the default settings and must be explicitly configured. The `--syncmode=full` flag ensures every block is executed, and `--gcmode=archive` disables state pruning.
51+
</Info>
52+
53+
### Configuration for Nethermind
54+
55+
Archive sync can be enabled by using the archive configuration for your network (configurations with `_archive` suffix):
56+
57+
```shell
58+
--config op-mainnet_archive
59+
```
60+
61+
<Info>
62+
Replace `op-mainnet_archive` with the appropriate archive configuration for your network (e.g., `op-sepolia_archive` for OP Sepolia).
63+
</Info>
64+
65+
## Archive mode with alternative clients
66+
67+
Alternative execution clients such as `reth` and `op-erigon` are designed as archive nodes by default, which means they always maintain the complete history of the chain. When using these clients with execution-layer sync, they will automatically operate in archive mode.
68+
69+
### Configuration for op-node with reth
70+
71+
Set the following flags on `op-node`:
72+
73+
```shell
74+
--syncmode=execution-layer
75+
--l2.enginekind=reth
76+
```
77+
78+
<Info>
79+
Both flags are not the default setting and must be explicitly configured on `op-node`. `reth` operates as an archive node by default.
80+
</Info>
81+
82+
### Configuration for op-node with op-erigon
83+
84+
Set the following flags on `op-node`:
85+
86+
```shell
87+
--syncmode=execution-layer
88+
--l2.enginekind=erigon
89+
```
90+
91+
<Info>
92+
Both flags are not the default setting and must be explicitly configured on `op-node`. `op-erigon` operates as an archive node by default.
93+
</Info>
94+
95+
## How archive sync works
96+
97+
With execution-layer sync mode enabled:
98+
99+
1. **Initial sync**: The node downloads block headers and data through the P2P network
100+
2. **Block execution**: The node executes every block in the chain to build the complete state history
101+
3. **State retention**: Unlike regular nodes, archive nodes never prune historical state data
102+
4. **Faster than legacy**: While still executing all blocks, this is faster than the legacy consensus-layer sync because block data is retrieved via P2P instead of being derived from L1
103+
104+
## Storage considerations
105+
106+
Archive nodes require substantial storage:
107+
108+
* **OP Mainnet**: Several terabytes and growing
109+
* **Other networks**: Varies by network age and activity
110+
* **Growth rate**: Storage requirements increase continuously as new blocks are added
111+
* **Recommendation**: Use fast SSD storage for optimal performance
112+
113+
## Next steps
114+
115+
* See the [Snap Sync guide](/node-operators/guides/management/snap-sync) for non-archive node configuration
116+
* See the [Node Configuration](/node-operators/guides/base-config#configuration) guide for additional explanation or customization
117+
* See the [Snapshots guide](/node-operators/guides/management/snapshots) for information about downloading the bedrock datadir
118+
* If you experience difficulty at any stage of this process, please reach out to [developer support](https://github.com/ethereum-optimism/developers/discussions)

node-operators/guides/management/snap-sync.mdx

Lines changed: 69 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -3,125 +3,95 @@ title: Using snap sync for node operators
33
description: Learn how to use and enable snap sync on your node.
44
---
55

6-
This guide reviews the optional feature of Snap Sync for node operators, including benefits and how to enable the feature.
7-
8-
Snap Sync significantly improves the experience of syncing an OP Stack node. Snap Sync is a native feature of the execution clients. Both `op-geth` and `nethermind` support Snap Sync, which can be optionally enabled on `op-node` with `op-geth` or `nethermind`.
9-
Snap Sync works by downloading a snapshot of the state from other nodes on the network and is then able to start executing blocks from the completed state rather than having to re-execute every single block.
10-
This means that performing a Snap Sync is significantly faster than performing a full sync.
11-
12-
* For OP Mainnet, node operators will be able to sync without having to download the [bedrock datadir](/operators/node-operators/management/snapshots).
13-
* This also enables nodes to join the network after Ecotone activates without requiring a [blob archiver](/operators/node-operators/management/blobs).
14-
* Archive nodes are also fully supported.
6+
This guide shows you how to enable and configure Snap Sync for your node. For an overview of how snap sync works and its benefits, see the [Snap Sync feature page](/node-operators/reference/features/snap-sync).
157

168
## Enable snap sync for your node
179

1810
<Info>
19-
For snap sync, all `op-geth` nodes should expose port `30303` TCP and `30303` UDP to easily find other op-geth nodes to sync from.
20-
* If you set the port with [`--discovery.port`](/node-operators/guides/execution-config#discoveryport), then you must open the port specified for UDP.
11+
For snap sync, all `op-geth` nodes should expose port `30303` TCP and `30303` UDP to easily find other op-geth nodes to sync from.
12+
* If you set the port with [`--discovery.port`](/node-operators/guides/execution-config#discoveryport), then you must open the port specified for UDP.
2113
* If you set [`--port`](/node-operators/guides/execution-config#port), then you must open the port specified for TCP.
2214
* The only exception is for sequencers and transaction ingress nodes.
2315
</Info>
2416

25-
Choose one of the following options to enable snap sync:
26-
27-
* **Option 1:** Snap sync, no required datadir on OP Mainnet. This is the recommended option because `op-node` tells `op-geth` to snap sync and then `op-geth` downloads the state at tip and once complete switches to inserting blocks one by one.
28-
29-
<Tabs items={['op-node', 'op-geth', 'Nethermind']}>
30-
<Tabs.Tab>
31-
```shell
32-
--syncmode=execution-layer (not default)
33-
```
34-
</Tabs.Tab>
35-
36-
<Tabs.Tab>
37-
```shell
38-
--syncmode=snap (default)
39-
```
40-
</Tabs.Tab>
41-
42-
<Tabs.Tab>
43-
```shell
44-
--config op-mainnet
45-
--Sync.SnapSync=true
46-
```
47-
48-
<Info>
49-
A single restart of `Nethermind` during Snap Sync may extend the sync time by up to 2 hours because `Nethermind` has to rebuild the caches by reading millions of values from the database.
50-
</Info>
51-
</Tabs.Tab>
52-
</Tabs>
53-
54-
* **Option 2:** Archive sync with required [datadir](/operators/node-operators/management/snapshots) for OP Mainnet, but no required datadir for other OP Stack networks.
55-
This option is faster for archive nodes than other options because `--syncmode=full` means `op-geth` executes every block in the chain.
56-
57-
<Tabs items={['op-node', 'op-geth', 'Nethermind']}>
58-
<Tabs.Tab>
59-
```shell
60-
--syncmode=execution-layer (not default)
61-
```
62-
</Tabs.Tab>
63-
64-
<Tabs.Tab>
65-
```shell
66-
--syncmode=full (not default)
67-
--gcmode=archive (not default)
68-
```
69-
</Tabs.Tab>
70-
71-
<Tabs.Tab>
72-
Archive sync can be enabled by using the archive configuration for your network (configurations with `_archive` suffix):
73-
```shell
74-
--config op-mainnet_archive
75-
```
76-
</Tabs.Tab>
77-
</Tabs>
78-
79-
* **Option 3:** Continue using current sync approach (before Ecotone) where `op-node` reads from L1 and inserts blocks into the execution client.
80-
This option might be preferred for decentralized developer groups who need to confirm everything on the chain.
81-
82-
<Tabs items={['op-node', 'op-geth', 'Nethermind']}>
83-
<Tabs.Tab>
84-
```shell
85-
--syncmode=consensus-layer (default)
86-
```
87-
</Tabs.Tab>
88-
89-
<Tabs.Tab>
90-
```shell
91-
--syncmode=full (not default)
92-
```
93-
</Tabs.Tab>
94-
95-
<Tabs.Tab>
96-
```shell
97-
--config op-mainnet
98-
--Sync.SnapSync=false
99-
--Sync.FastSync=false
100-
```
101-
</Tabs.Tab>
102-
</Tabs>
17+
Snap sync requires no datadir on OP Mainnet. With snap sync, `op-node` tells the execution client to snap sync, and then the execution client downloads the state at tip and once complete switches to inserting blocks one by one.
18+
19+
### Configuration for op-node
20+
21+
```shell
22+
--syncmode=execution-layer
23+
```
24+
25+
<Info>
26+
The `--syncmode=execution-layer` flag is not the default setting and must be explicitly configured.
27+
</Info>
28+
29+
### Configuration for op-geth
30+
31+
```shell
32+
--syncmode=snap
33+
```
34+
35+
<Info>
36+
The `--syncmode=snap` flag is the default setting for `op-geth`.
37+
</Info>
38+
39+
### Configuration for Nethermind
40+
41+
```shell
42+
--config op-mainnet
43+
--Sync.SnapSync=true
44+
```
45+
46+
<Warning>
47+
A single restart of `Nethermind` during Snap Sync may extend the sync time by up to 2 hours because `Nethermind` has to rebuild the caches by reading millions of values from the database.
48+
</Warning>
10349

10450
## Enabling execution layer sync for alternative clients
51+
10552
In addition to `op-geth` and `Nethermind`, you can enable execution-layer syncing with alternative execution clients such as `reth` and `op-erigon`.
10653

107-
Unlike `op-geth` and `Nethermind`, `reth` and `op-erigon` are designed as archive nodes, which means they require the complete history of the chain.
54+
Unlike `op-geth` and `Nethermind`, `reth` and `op-erigon` are designed as archive nodes, which means they require the complete history of the chain.
10855
However, these clients can still retrieve block headers and data through the P2P network instead of deriving each individual block, resulting in a faster initial sync.
10956

110-
For OP Mainnet, the [bedrock datadir](/operators/node-operators/management/snapshots) is required. For other OP Stack networks, no datadir is required.
57+
For OP Mainnet, the [bedrock datadir](/operators/node-operators/management/snapshots) is required. For other OP Stack networks, no datadir is required.
58+
59+
### Configuration for op-node with reth
60+
61+
Set the following flags on `op-node`:
11162

112-
To enable execution layer sync for these clients, set the following flags on `op-node`:
11363
```shell
114-
# for reth
115-
--syncmode=execution-layer (not default)
116-
--l2.enginekind=reth (not default)
64+
--syncmode=execution-layer
65+
--l2.enginekind=reth
66+
```
67+
68+
<Info>
69+
Both flags are not the default setting and must be explicitly configured on `op-node`.
70+
</Info>
11771

118-
# for erigon
119-
--syncmode=execution-layer (not default)
120-
--l2.enginekind=erigon (not default)
72+
### Configuration for op-node with op-erigon
73+
74+
Set the following flags on `op-node`:
75+
76+
```shell
77+
--syncmode=execution-layer
78+
--l2.enginekind=erigon
12179
```
12280

81+
<Info>
82+
Both flags are not the default setting and must be explicitly configured on `op-node`.
83+
</Info>
84+
85+
## Alternative sync modes
86+
87+
Snap sync is the recommended sync mode for most node operators, but other sync modes are available depending on your needs:
88+
89+
* **Archive nodes**: If you need to maintain complete historical state, see the [Archive Node guide](/node-operators/guides/management/archive-node)
90+
* **Consensus-layer sync**: For independent L1-based verification without P2P networking, see the [Consensus-Layer Sync reference](/node-operators/reference/consensus-layer-sync)
91+
12392
## Next steps
12493

125-
* See the [Node Configuration](/node-operators/guides/base-config#configuration) guide for additional explanation or customization.
94+
* See the [Snap Sync feature page](/node-operators/reference/features/snap-sync) for an overview of how snap sync works and its benefits.
95+
* See the [Node Configuration](/node-operators/guides/base-config#configuration) guide for additional explanation or customization.
12696
* To enable snap sync for your chain, see [Using Snap Sync for Chain Operators](/operators/chain-operators/management/snap-sync).
12797
* If you experience difficulty at any stage of this process, please reach out to [developer support](https://github.com/ethereum-optimism/developers/discussions).

0 commit comments

Comments
 (0)