You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
L1 follower mode runs a node that only follows the finalized L1 and DA to read and derive the L2 chain. In this mode the node does not participate directly in the L2.
147
+
This mode is useful for reconstructing the L2 state by only following the L1.
148
+
</Aside>
149
+
150
+
Run `l2geth` with the `--da.sync` flag. Provide blob APIs and beacon node with
-`--da.blob.blobscan "https://api.blobscan.com/blobs/"``--da.blob.blocknative "https://api.ethernow.xyz/v1/blob/"` for mainnet
153
+
-`--da.blob.blobscan "https://api.sepolia.blobscan.com/blobs/"` for Sepolia.
154
+
155
+
Strictly speaking only one of the blob providers is necessary, but during testing blobscan and blocknative were not fully reliable. That's why using a beacon node with historical blob data is recommended (can be additionally to blobscan and blobnative).
A full sync will take about 2 weeks depending on the speed of the RPC node, beacon node and the local machine. Progess is reported as follows for every 1000 blocks applied:
171
+
172
+
```bash
173
+
INFO [08-01|16:44:42.173] L1 sync progress blockhain height=87000 block hash=608eec..880ebd root=218215..9a58a2
A full sync will take about 2-3 days depending on the speed of the RPC node, beacon node and the local machine. Progess is reported as follows for every 1000 blocks applied:
190
+
191
+
```bash
192
+
INFO [08-01|16:44:42.173] L1 sync progress blockhain height=87000 block hash=608eec..880ebd root=218215..9a58a2
193
+
```
194
+
195
+
196
+
### Troubleshooting
197
+
You should see something like this shortly after starting:
198
+
- the node (APIs, geth console, etc) will not be responsive until all the L1 messages have been synced
199
+
- but it is already starting the derivation pipeline which can be seen through `L1 sync progress [...]`.
200
+
- for Sepolia it might take a little longer (10-20mins) for the first `L1 sync progress [...]` to appear as the L1 blocks are more sparse at the beginning
201
+
```bash
202
+
INFO [09-18|13:41:34.039] Starting L1 message sync service latestProcessedBlock=20,633,529
203
+
WARN [09-18|13:41:34.551] Running initial sync of L1 messages before starting l2geth, this might take a while...
204
+
INFO [09-18|13:41:45.249] Syncing L1 messages processed=20,634,929 confirmed=20,777,179 collected=71 progress(%)=99.315
205
+
INFO [09-18|13:41:55.300] Syncing L1 messages processed=20,637,029 confirmed=20,777,179 collected=145 progress(%)=99.325
206
+
INFO [09-18|13:42:05.400] Syncing L1 messages processed=20,638,329 confirmed=20,777,179 collected=220 progress(%)=99.332
207
+
INFO [09-18|13:42:15.610] Syncing L1 messages processed=20,640,129 confirmed=20,777,179 collected=303 progress(%)=99.340
208
+
INFO [09-18|13:42:24.324] L1 sync progress "blockhain height"=1000 "block hash"=a28c48..769cee root=174edb..9d9fbd
209
+
INFO [09-18|13:42:25.555] Syncing L1 messages processed=20,641,529 confirmed=20,777,179 collected=402 progress(%)=99.347
210
+
```
211
+
212
+
**Temporary errors**
213
+
Especially at the beginning some errors like below might appear in the console. This is expected, as the pipeline relies on the L1 messages but in case they're not synced fast enough such an error might pop up. It will continue once the L1 messages are available.
214
+
```
215
+
WARN [09-18|13:52:25.843] syncing pipeline step failed due to temporary error, retrying err="temporary: failed to process logs to DA, error: failed to get commit batch da: 7, err: failed to get L1 messages for v0 batch 7: EOF: <nil>"
216
+
```
217
+
218
+
## Limitations
219
+
220
+
The `state root` of a block can be reproduced when using this mode of syncing but currently not the `block hash`. This is due to the fact that currently the header fields `difficulty` and `extraData` are not stored on DA but these fields are utilized by [Clique consensus](https://eips.ethereum.org/EIPS/eip-225) which is used by the Scroll protocol. This will be fixed in a future upgrade where the main implementation on l2geth is already done: https://github.com/scroll-tech/go-ethereum/pull/903https://github.com/scroll-tech/go-ethereum/pull/913.
221
+
222
+
To verify the locally created `state root` against mainnet (`https://sepolia-rpc.scroll.io/` for Sepolia), we can do the following:
223
+
224
+
```bash
225
+
# query local block info
226
+
curl localhost:8545 -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getHeaderByNumber","params":["0x2AF8"],"id":0}'| jq
227
+
228
+
# query mainnet block info
229
+
curl https://rpc.scroll.io -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getHeaderByNumber","params":["0x2AF8"],"id":0}'| jq
230
+
```
231
+
232
+
By comparing the headers we can most importantly see that **`state root` , `receiptsRoot` and everything that has to do with the state matches**. However, the following fields will be different:
0 commit comments