ethereum-optimism / ethereum-optimism/optimism

op-reth v2.0.0 cannot import the bedrock state snapshot with storage.v2 enabled

Open
#20,160 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
6.5k
Forks
4k
Avg merge
2d 15h
Merged PRs (30d)
145

Description

**Bug Description**
The bedrock state snapshot cannot be imported with storage.v2 enabled using the latest `v2.0.0` op-reth release. This prevents syncing a new archive node from scratch using the new storage scheme.

**Steps to Reproduce**
op-reth binary is built from source using the latest git release `op-reth/v2.0.0` and the command:

`export CARGO_BUILD_JOBS=32 && RUSTFLAGS="-C target-cpu=native" cargo build --bin op-reth --profile maxperf --features jemalloc`

The bedrock state snapshot is downloaded from: https://datadirs.optimism.io/

The following command is run:

```op-reth init-state --without-ovm --chain optimism --storage.v2 --datadir /home/optimism/.reth /data/pre-bedrock/op-mainnet-pre-bedrockstate```

**Expected behavior**
The state snapshot should be imported and we should get the same output seen when initializing without storage.v2 enabled:

``` Computed state root matches state root in state dump computed_state_root=0x920314c198da844a041d63bf6cbe8b59583165fd2229d1b3f599da812fd424cb
2026-04-19T18:41:18.082220Z INFO Genesis block written hash=0xdbf6a80fef073de06add9b0d14026d6e5a86c85f6d102c36d3d8e9cf89c2afd3
```

**Environment Information:**
- Operating System: Debian Bookworm
- op-reth built from the `op-reth/v2.0.0` git tag, running `op-reth --version` shows:
```
Reth Version: 1.11.3-dev
Commit SHA: d6324d63e27ef6b7c49cdc9b1977c1b808234c7b
Build Timestamp: 2026-04-19T03:24:59.412333826Z
Build Features: asm_keccak,jemalloc,keccak_cache_global,otlp
Build Profile: maxperf
```

**Logs:**
```2026-04-19T18:55:30.741844Z INFO Initialized tracing, debug log directory: /home/optimism/.cache/reth/logs/optimism
2026-04-19T18:55:30.742237Z INFO Reth init-state starting for OP mainnet
2026-04-19T18:55:30.742741Z INFO Opening storage db_path="/home/optimism/.reth/db" sf_path="/home/optimism/.reth/static_files"
2026-04-19T18:55:30.787594Z INFO check_consistency{read_only=false}: Verifying storage consistency.
2026-04-19T18:55:30.866013Z INFO Setting up dummy EVM chain before importing state. new_tip=NumHash { number: 105235063, hash: 0xdbf6a80fef073de06add9b0d14026d6e5a86c85f6d102c36d3d8e9cf89c2afd3 }
2026-04-19T18:57:58.269394Z INFO Appending first valid block.
2026-04-19T18:57:58.304444Z INFO Set up finished.
2026-04-19T18:57:58.318554Z INFO Initiating state dump
2026-04-19T19:00:07.458277Z INFO Writing accounts to db total_inserted_accounts=682797
Error: trying to append data to StorageChangeSets as block #105235063 but expected block #1

Location:
/usr/local/cargo/git/checkouts/reth-e231042ee7db3fb7/082c36e/crates/storage/db-common/src/init.rs:654:13
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with the op-reth v2.0.0 build and the documented init-state command using --storage.v2. Start at crates/storage/db-common/src/init.rs:654 and trace why StorageChangeSets expects block #1 after the dummy EVM chain is initialized. Done means the bedrock snapshot imports successfully, with a matching computed state root and genesis block output.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.