ethereum-optimism / optimism

Optimism is Ethereum, scaled.
https://optimism.io
MIT License
5.64k stars 3.27k forks source link

Error Starting op-geth Node with Archive Mode: "incompatible state scheme #12013

Closed WhizIkem closed 1 month ago

WhizIkem commented 1 month ago

I am following the Optimism documentation to set up a Layer 2 Rollup testnet and have encountered an issue while running my op-geth node. Here’s what I have done so far:

  1. Initialized the op-geth node: I used the following command to initialize the node with the genesis block:

    ./build/bin/geth init --datadir=datadir genesis.json

    This command executed successfully.

  2. Started the Sequencer node: I used the following command to start the Sequencer node with archive mode enabled:

    ./build/bin/geth \
     --datadir ./datadir \
     --http \
     --http.corsdomain="*" \
     --http.vhosts="*" \
     --http.addr=0.0.0.0 \
     --http.api=web3,debug,eth,txpool,net,engine \
     --ws \
     --ws.addr=0.0.0.0 \
     --ws.port=8546 \
     --ws.origins="*" \
     --ws.api=debug,eth,txpool,net,engine \
     --syncmode=full \
     --gcmode=archive \
     --nodiscover \
     --maxpeers=0 \
     --networkid=42069 \
     --authrpc.vhosts="*" \
     --authrpc.addr=0.0.0.0 \
     --authrpc.port=8551 \
     --authrpc.jwtsecret=./jwt.txt \
     --rollup.disabletxpoolgossip=true

    However, I am getting the following error:

    INFO [09-11|14:23:55.024] Maximum peer count                       ETH=0 total=0
    INFO [09-11|14:23:55.025] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
    INFO [09-11|14:23:55.038] Enabling recording of key preimages since archive mode is used
    WARN [09-11|14:23:55.039] Disabled transaction unindexing for archive node
    WARN [09-11|14:23:55.039] Forcing hash state-scheme for archive mode   
    INFO [09-11|14:23:55.039] Set global gas cap                       cap=50,000,000
    INFO [09-11|14:23:55.040] Initializing the KZG library             backend=gokzg
    INFO [09-11|14:23:55.126] Allocated trie memory caches             clean=307.00MiB dirty=0.00B
    INFO [09-11|14:23:55.138] Using pebble as the backing database
    INFO [09-11|14:23:55.138] Allocated cache and file handles         database=/mnt/c/Users/HP/Desktop/Lisk/Lisk/op-geth/datadir/geth/chaindata cache=512.00MiB handles=524,288
    INFO [09-11|14:23:55.280] Opened ancient database                  database=/mnt/c/Users/HP/Desktop/Lisk/Lisk/op-geth/datadir/geth/chaindata/ancient/chain readonly=false
    Fatal: Failed to register the Ethereum service: incompatible state scheme, stored: path, provided: hash

Details:

Questions:

  1. What could be causing the "incompatible state scheme" error?
  2. Are there specific steps or configurations I might be missing?
  3. How can I resolve this issue to successfully start my op-geth node?

Any guidance or troubleshooting tips would be greatly appreciated!

mininny commented 1 month ago

When running ./build/bin/geth init --datadir=datadir genesis.json, can you try adding --state.scheme=hash? :) This issue looks identical to https://github.com/ethereum-optimism/op-geth/issues/375.

WhizIkem commented 1 month ago

Thank you so much, Minhyuk Kim! Your suggestion to run geth init with --state.scheme=hash worked perfectly, and op-geth is now running smoothly. I really appreciate your help and quick response!