From affafa8cfc6521efe2ac1f8c1c32e005fcbfea3b Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Tue, 21 May 2024 20:07:23 +0200 Subject: [PATCH] feat(op): docs sync op mainnet (#8309) --- book/run/sync-op-mainnet.md | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 book/run/sync-op-mainnet.md diff --git a/book/run/sync-op-mainnet.md b/book/run/sync-op-mainnet.md new file mode 100644 index 000000000..b50a32fb4 --- /dev/null +++ b/book/run/sync-op-mainnet.md @@ -0,0 +1,50 @@ +# Sync OP Mainnet + +To sync OP mainnet, the Bedrock datadir needs to be imported to use as starting point. +Blocks lower than the OP mainnet Bedrock fork, are built on the OVM and cannot be executed on the EVM. +For this reason, the chain segment from genesis until Bedrock, must be manually imported to circumvent +execution in reth's sync pipeline. + +Importing OP mainnet Bedrock datadir requires exported data: + +- Blocks [and receipts] below Bedrock +- State snapshot at first Bedrock block + +## Manual Export Steps + +See . + +Output from running the command to export state, can also be downloaded from . + +## Manual Import Steps + +### 1. Import Blocks + +Imports a `.rlp` file of blocks. + +Note! Requires running in debug mode (TODO: ). + +```bash +./op-reth import-op +``` + +### 2. Import Receipts + +This step is optional. To run a full node, skip this step. If however receipts are to be imported, the +corresponding transactions must already be imported (see [step 1](#1-import-blocks)). + +Imports a `.rlp` file of receipts, that has been exported with command specified in + (command for exporting receipts uses custom RLP-encoding). + +```bash +./op-reth import-receipts --chain optimism +``` + +### 3. Import State + +Imports a `.jsonl` state dump. The block at which the state dump is made, must be the latest block in +reth's database. + +```bash +./op-reth init-state --chain optimism +``` \ No newline at end of file