bnb-chain / op-geth

GNU Lesser General Public License v3.0
59 stars 45 forks source link

Historical state is not available using PebbleDB #96

Closed mateipopp closed 5 months ago

mateipopp commented 6 months ago

System information

Network: mainnet

if you are running a local node, please provide the following information: op-node version: op-node version v0.0.0-426eea2d-1712565665 op-geth version: op-geth version 0.1.0-unstable-c18478a1 v0.3.1-alpha OS & Version: Linux

Actual behaviour

curl -X POST localhost:8545 -H 'Content-Type: application/json' --data '{"method":"debug_traceBlockByNumber","params":["0xf", {"tracer": "callTracer"}],"id":1,"jsonrpc":"2.0"}'

{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"historical state not available in path scheme yet"}}

Steps to reproduce the behaviour

/usr/local/bin/op-geth \
  --ws --ws.port=8546 --ws.addr=0.0.0.0 --ws.origins="*" \
  --http --http.port=8545 --http.addr=0.0.0.0 \
  --http.vhosts="*" \
  --http.corsdomain="*" \
  --authrpc.addr=localhost \
  --authrpc.jwtsecret=/node/data/secret.jwt \
  --authrpc.port=8551 \
  --authrpc.vhosts="*" \
  --datadir=/node/data/geth/ \
  --verbosity=3 \
  --rollup.sequencerhttp=https://opbnb-mainnet-rpc.bnbchain.org \
  --syncmode=full \
  --maxpeers=10 --http.api=eth,rollup,net,web3,debug --ws.api=eth,rollup,net,web3,debug \
  --gcmode=archive \
  --snapshot=false \
  --metrics \
  --metrics.addr=0.0.0.0 \
  --metrics.port=6060 \
  --miner.gaslimit=150000000 \
  --allow-insecure-unlock \
  --cache=32000 \
  --cache.preimages \
  --txpool.globalslots=10000 \
  --txpool.globalqueue=5000 \
  --txpool.accountqueue=200 \
  --txpool.accountslots=200 \
  --networkid=204 \
  --bootnodes="enr:-KO4QHs5qh_kPFcjMgqkuN9dbxXT4C5Cjad4SAheaUxveCbJQ3XdeMMDHeHilHyqisyYQAByfdhzyKAdUp2SvyzWeBqGAYvRDf80g2V0aMfGhHFtSjqAgmlkgnY0gmlwhDaykUmJc2VjcDI1NmsxoQJUevTL3hJwj21IT2GC6VaNqVQEsJFPtNtO-ld5QTNCfIRzbmFwwIN0Y3CCdl-DdWRwgnZf,enr:-KO4QKIByq-YMjs6IL2YCNZEmlo3dKWNOy4B6sdqE3gjOrXeKdNbwZZGK_JzT1epqCFs3mujjg2vO1lrZLzLy4Rl7PyGAYvRA8bEg2V0aMfGhHFtSjqAgmlkgnY0gmlwhDbjSM6Jc2VjcDI1NmsxoQNQhJ5pqCPnTbK92gEc2F98y-u1OgZVAI1Msx-UiHezY4RzbmFwwIN0Y3CCdl-DdWRwgnZf" \
 --opBNBMainnet --state.scheme path --db.engine pebble

/usr/local/bin/op-node  \
                --l1.trustrpc=true \
                --l1=https://bsc-mainnet.blastapi.io/ \
                --sequencer.l1-confs=15 \
                --verifier.l1-confs=15 \
                --l1.http-poll-interval 3s \
                --l1.epoch-poll-interval 45s \
                --l1.rpc-max-batch-size 20 \
                --l2=ws://localhost:8551 --rpc.addr=0.0.0.0  \
                --rpc.port=9545 --l2.jwt-secret=/node/data/secret.jwt \
                --metrics.enabled --rollup.load-protocol-versions=true \
                --l2.engine-sync=true \
                --l2.skip-sync-start-check=true \
                --p2p.bootnodes="enr:-J24QA9sgVxbZ0KoJ7-1gx_szfc7Oexzz7xL2iHS7VMHGj2QQaLc_IQZmFthywENgJWXbApj7tw7BiouKDOZD4noWEWGAYppffmvgmlkgnY0gmlwhDbjSM6Hb3BzdGFja4PMAQCJc2VjcDI1NmsxoQKetGQX7sXd4u8hZr6uayTZgHRDvGm36YaryqZkgnidS4N0Y3CCIyuDdWRwgiMs,enr:-J24QPSZMaGw3NhO6Ll25cawknKcOFLPjUnpy72HCkwqaHBKaaR9ylr-ejx20INZ69BLLj334aEqjNHKJeWhiAdVcn-GAYv28FmZgmlkgnY0gmlwhDTDWQOHb3BzdGFja4PMAQCJc2VjcDI1NmsxoQJ-_5GZKjs7jaB4TILdgC8EwnwyL3Qip89wmjnyjvDDwoN0Y3CCIyuDdWRwgiMs"\
                --rollup.config /node/data/rollup.json
will-2012 commented 6 months ago

The current path-base mode does not support the world state access of the archive history block, and can only access the latest 129 states (128difflayer+1disklayer). Therefore, the access to the historical block in the above log fails.

mateipopp commented 6 months ago

Hey @will-2012, thanks for the info. What would be the option for us to have historical data? Thank you.

will-2012 commented 6 months ago
./op-geth \
  ...
  --state.scheme hash \
  --gcmode=archive \
  ...

op-geth uses hash scheme, archive gcmode and synchronizes block data starting from 0, which will include all historical data.