optimism: op-replica-data-transport-layer-1:TypeError: Cannot read properties of null

Describe the bug #op-replica-data-transport-layer-1 error logs:

op-replica-data-transport-layer-1 | {“level”:50,“time”:1668411148974,“extra”:{“message”:“TypeError: Cannot read properties of null (reading ‘from’)”,“stack”:“TypeError: Cannot read properties of null (reading ‘from’)\n at Object.getExtraData (/opt/optimism/packages/data-transport-layer/dist/src/services/l1-ingestion/handlers/sequencer-batch-appended.js:27:38)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async L1IngestionService._syncEvents (/opt/optimism/packages/data-transport-layer/dist/src/services/l1-ingestion/service.js:230:39)\n at async L1IngestionService._start (/opt/optimism/packages/data-transport-layer/dist/src/services/l1-ingestion/service.js:140:17)\n at async L1IngestionService.start (/opt/optimism/packages/common-ts/dist/base-service/base-service.js:33:9)\n at async Promise.all (index 1)\n at async L1DataTransportService._start (/opt/optimism/packages/data-transport-layer/dist/src/services/main/service.js:69:13)\n at async L1DataTransportService.start (/opt/optimism/packages/common-ts/dist/base-service/base-service.js:33:9)\n at async /opt/optimism/packages/data-transport-layer/dist/src/services/run.js:77:9”},“msg”:“Caught an unhandled error”}

.env config file: ` COMPOSE_PROJECT_NAME=op-replica COMPOSE_FILE=replica.yml:replica-shared.yml:replica-toml.yml ETH_NETWORK=mainnet DATA_TRANSPORT_LAYER__L1_RPC_ENDPOINT=http://192.1.1.17:8545 DATA_TRANSPORT_LAYER__L2_RPC_ENDPOINT=https://mainnet.optimism.io SEQUENCER_CLIENT_HTTP=https://mainnet.optimism.io SHARED_ENV_PATH=…/envs/mainnet GCMODE=archive L2GETH_IMAGE_TAG=0.5.29 DTL_IMAGE_TAG=0.5.48 HC_IMAGE_TAG=1.1.12 L2GETH_HTTP_PORT=9991 L2GETH_WS_PORT=9992 DTL_PORT=7878 GETH_INIT_SCRIPT=check-for-chaindata-berlin.sh HEALTHCHECK__REFERENCE_RPC_PROVIDER=https://mainnet.optimism.io HEALTHCHECK__TARGET_RPC_PROVIDER=http://l2geth-replica:8545

RESTART=unless-stopped

# Sync source ROLLUP_BACKEND=l2 DATA_TRANSPORT_LAYER__DEFAULT_BACKEND=l2 DATA_TRANSPORT_LAYER__L1_GAS_PRICE_BACKEND=l2 DATA_TRANSPORT_LAYER__SYNC_FROM_L1=true DATA_TRANSPORT_LAYER__SYNC_FROM_L2=true ` then: docker-compose up -d && docker-compose logs -f found this issuse at this time

How can I solve this problem ????

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 43 (3 by maintainers)

Most upvoted comments

@sanbotto @zhy827827 I think I figured the issue. Back in Feb 2021 Geth started unindexing txs by hash after 1 year. So you are no longer able to look up transactions by their hashes. I did some looking at how Optimism is finding transactions and it is trying to look up transactions by hash.

The way to fix this should be to set --txlookuplimit=0 and the Geth node should start reindexing again. After I set this and restarted Geth I am seeing:

INFO [12-14|22:19:18.060] Indexing transactions                    blocks=12838 txs=2,399,722 tail=13,789,288 total=13,802,126 elapsed=25.016s

You can check to see if this is your issue by running the command below:

curl http://your-eth-node:8545 \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_getTransactionByHash","params":["0x896440b9bb3a942e8891a964fd70b4fff8338b89d7b66e3c06978b4ee98d9d3c"],"id":1,"jsonrpc":"2.0"}'

Seems to be working now, after letting the Indexing run I am now getting the following:

{"level":30,"time":1671075241065,"msg":"Service is starting..."}
{"level":30,"time":1671075241066,"msg":"Service is initializing..."}
{"level":30,"time":1671075241066,"msg":"Initializing L1 Data Transport Service..."}
{"level":30,"time":1671075241113,"msg":"L2 chain ID is: 10"}
{"level":30,"time":1671075241113,"msg":"BSS HF1 will activate at: 2824317"}
{"level":30,"time":1671075241118,"msg":"Service is initializing..."}
{"level":30,"time":1671075241123,"defaultBackend":"l1","l1GasPriceBackend":"l1","msg":"HTTP Server Options"}
{"level":30,"time":1671075241123,"url":"REDACTED_L1_NODE:8545","msg":"HTTP Server L1 RPC Provider initialized"}
{"level":40,"time":1671075241123,"msg":"HTTP Server L2 RPC Provider not initialized"}
{"level":30,"time":1671075241123,"msg":"Service has initialized."}
{"level":30,"time":1671075241123,"msg":"Service is initializing..."}
{"level":30,"time":1671075241124,"addressManager":"0xdE1FCfB0851916CA5101820A69b13a4E276bd81F","msg":"Using AddressManager"}
{"level":30,"time":1671075241190,"startingL1BlockNumber":13596466,"msg":"Starting sync"}
{"level":30,"time":1671075241196,"msg":"Service has initialized."}
{"level":30,"time":1671075241196,"msg":"Service has initialized."}
{"level":30,"time":1671075241196,"msg":"Service is starting..."}
{"level":30,"time":1671075241196,"msg":"Service is starting..."}
{"level":30,"time":1671075241197,"host":"0.0.0.0","port":7878,"msg":"Server started and listening"}
{"level":30,"time":1671075241197,"msg":"Service has started"}
{"level":30,"time":1671075241202,"highestSyncedL1Block":14568466,"targetL1Block":14570466,"msg":"Synchronizing events from Layer 1 (Ethereum)"}
{"level":30,"time":1671075241643,"eventName":"TransactionEnqueued","numEvents":63,"durationMs":22,"msg":"Processed events"}
{"level":30,"time":1671075242830,"method":"GET","url":"/batch/transaction/latest","elapsed":14,"msg":"Served HTTP Request"}
{"level":30,"time":1671075243271,"method":"GET","url":"/batch/transaction/index/15261","elapsed":423,"msg":"Served HTTP Request"}
{"level":30,"time":1671075244903,"method":"GET","url":"/batch/transaction/index/15262","elapsed":16,"msg":"Served HTTP Request"}
{"level":30,"time":1671075246443,"method":"GET","url":"/batch/transaction/index/15263","elapsed":10,"msg":"Served HTTP Request"}
{"level":30,"time":1671075247953,"method":"GET","url":"/batch/transaction/index/15264","elapsed":23,"msg":"Served HTTP Request"}
{"level":30,"time":1671075249029,"method":"GET","url":"/batch/transaction/index/15265","elapsed":11,"msg":"Served HTTP Request"}
{"level":30,"time":1671075250431,"method":"GET","url":"/batch/transaction/index/15266","elapsed":13,"msg":"Served HTTP Request"}
{"level":30,"time":1671075251893,"method":"GET","url":"/batch/transaction/index/15267","elapsed":8,"msg":"Served HTTP Request"}
{"level":30,"time":1671075254163,"method":"GET","url":"/batch/transaction/index/15268","elapsed":9,"msg":"Served HTTP Request"}
{"level":30,"time":1671075255163,"method":"GET","url":"/batch/transaction/index/15269","elapsed":8,"msg":"Served HTTP Request"}
{"level":30,"time":1671075256431,"method":"GET","url":"/batch/transaction/index/15270","elapsed":7,"msg":"Served HTTP Request"}
{"level":30,"time":1671075257707,"method":"GET","url":"/batch/transaction/index/15271","elapsed":12,"msg":"Served HTTP Request"}
{"level":30,"time":1671075259346,"method":"GET","url":"/batch/transaction/index/15272","elapsed":10,"msg":"Served HTTP Request"}
{"level":30,"time":1671075260747,"method":"GET","url":"/batch/transaction/index/15273","elapsed":8,"msg":"Served HTTP Request"}
{"level":30,"time":1671075262317,"method":"GET","url":"/batch/transaction/index/15274","elapsed":8,"msg":"Served HTTP Request"}
{"level":30,"time":1671075263726,"method":"GET","url":"/batch/transaction/index/15275","elapsed":10,"msg":"Served HTTP Request"}

Where you able to determine what was going on with Geth that was causing the issue? From what I understand, you resolved it by using different Ethereum node software all together.

No. I thought the missing --http.api and --ws.api flags were the issue but I’m now using --http.api "eth,txpool,debug,web3,net" and --ws.api "eth,txpool,debug,web3,net" and nothing has changed on the Optimism side, I’m still getting the Cannot read properties of null error. Maybe I’m missing a particular API that I don’t know about, but that geth node works fine with absolutely everything else…

I haven’t had issues with Infura or Alchemy. I’m using both on different nodes.

@zhy827827 I saw that you had

ROLLUP_BACKEND=l2
DATA_TRANSPORT_LAYER__DEFAULT_BACKEND=l2
DATA_TRANSPORT_LAYER__L1_GAS_PRICE_BACKEND=l2
DATA_TRANSPORT_LAYER__SYNC_FROM_L1=true
DATA_TRANSPORT_LAYER__SYNC_FROM_L2=true

Configured so I assumed you were trying to sync from L2. If you want to sync from L1 then you will need to set:

ROLLUP_BACKEND=l1
DATA_TRANSPORT_LAYER__DEFAULT_BACKEND=l1
DATA_TRANSPORT_LAYER__L1_GAS_PRICE_BACKEND=l1
DATA_TRANSPORT_LAYER__SYNC_FROM_L1=true
DATA_TRANSPORT_LAYER__SYNC_FROM_L2=false

if i use l1 to data sync,then ethereumoptimism/data-transport-layer:latest have error:

{“level”:50,“time”:1670926343808,“extra”:{“message”:“TypeError: Cannot read properties of null (reading ‘from’)”,“stack”:“TypeError: Cannot read properties of null (reading ‘from’)\n at Object.getExtraData (/opt/optimism/packages/data-transport-layer/dist/src/services/l1-ingestion/handlers/sequencer-batch-appended.js:27:38)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async L1IngestionService._syncEvents (/opt/optimism/packages/data-transport-layer/dist/src/services/l1-ingestion/service.js:277:39)\n at async L1IngestionService._start (/opt/optimism/packages/data-transport-layer/dist/src/services/l1-ingestion/service.js:156:17)\n at async L1IngestionService.start (/opt/optimism/packages/common-ts/dist/base-service/base-service.js:33:9)\n at async Promise.all (index 1)\n at async L1DataTransportService._start (/opt/optimism/packages/data-transport-layer/dist/src/services/main/service.js:69:13)\n at async L1DataTransportService.start (/opt/optimism/packages/common-ts/dist/base-service/base-service.js:33:9)\n at async /opt/optimism/packages/data-transport-layer/dist/src/services/run.js:78:9”},“msg”:“Caught an unhandled error”} {“level”:30,“time”:1670926344318,“highestSyncedL1Block”:13596466,“targetL1Block”:13598466,“msg”:“Synchronizing events from Layer 1 (Ethereum)”}

and ethereumoptimism/data-transport-layer:latest not sync block. I really don’t know how to solve the problem of optimism。 @smartcontracts Take a moment,thank you~~~