ethereum-optimism / optimism

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

v1.9.1 WARN path & hash #12171

Open AdamRabbit opened 1 month ago

AdamRabbit commented 1 month ago

I encountered the following error when running Optimism version 1.9.1:

Fatal: Failed to register the Ethereum service: incompatible state scheme, stored: path, provided: hash

The error was resolved by removing the --gcmode=archive option. After synchronizing the data, transactions are functioning correctly, but there are continuous warning logs like the following:

WARN [09-27|06:47:49.691] Served eth_getBalance conn=172.31.18.226:50638 reqid=25 duration="7.009µs" err="missing trie node 18d5c42044ee35a292df57229fe87e6389771360e805d66bb16a26e719297d2f (path ) state 0x18d5c42044ee35a292df57229fe87e6389771360e805d66bb16a26e719297d2f is not available"
WARN [09-27|06:47:49.691] Served eth_getBalance conn=172.31.18.226:50638 reqid=34 duration="7.784µs" err="missing trie node 1ddccc4cca915e168572e83606db18c3ac515c8f95fb85b65981ff377524ce02 (path ) state 0x1ddccc4cca915e168572e83606db18c3ac515c8f95fb85b65981ff377524ce02 is not available"

These warnings appear frequently, generating over 100GB of logs per hour. I want to understand what the issue might be and how to resolve it.

dome commented 1 month ago

for custom chain use --state.scheme=hash when init geth init --state.scheme=hash --datadir=/root/datadir /root/config/genesis.json

tynes commented 1 month ago

The database format for go-ethereum changed which is causing this error. If syncing OP Mainnet, you can resync your node with the new format if you would like a smaller database overall or just pass in the legacy flay --state.scheme=path

TAdev0 commented 1 month ago

Hi @dome,

I encounter the same issue, but its not resolved when adding --state.scheme=hash to the init command. I'm following the tutorial here : https://docs.optimism.io/builders/chain-operators/tutorials/create-l2-rollup

adding the flag to the geth init command still returns the error:

build/bin/geth init --state.scheme=hash --datadir=datadir genesis.json
...
Fatal: incompatible state scheme, stored: path, provided: hash

any idea? I suppose that the issue lies in the content of my genesis.json file... which I generated with :

go run cmd/main.go genesis l2 \
  --deploy-config ../packages/contracts-bedrock/deploy-config/getting-started.json \
  --l1-deployments ../packages/contracts-bedrock/deployments/getting-started/.deploy \
  --outfile.l2 genesis.json \
  --outfile.rollup rollup.json \
  --l1-rpc $L1_RPC_URL

thanks a lot!

TAdev0 commented 1 month ago

well my bad, just found out the issue, had to remove the datadir directory and re create a fresh one before doing init again!