optimism
optimism copied to clipboard
Bug: replica-healthcheck 1.0.2 cannot check l2geth 0.5.15
Describe the bug
replica-healthcheck 1.0.2 shows a constant stream of this error when combined with l2geth 0.5.15:
replica-healthcheck_1 | {"level":50,"time":1648212022362,"extra":{"message":"Cannot read properties of undefined (reading 'getBlock')","stack":"TypeError: Cannot read properties of undefined (reading 'getBlock')\n at HealthcheckService.main (/opt/optimism/packages/replica-healthcheck/src/service.ts:85:59)\n at HealthcheckService.run (/opt/optimism/packages/common-ts/src/base-service/base-service-v2.ts:294:22)"},"msg":"caught an unhandled exception"}
REPLICA_HEALTHCHECK__ETH_REPLICA_RPC_PROVIDER=http://l2geth-replica:8545 is from ./kustomize/replica/envs/mainnet/replica-healthcheck.env
replica-healthcheck 0.3.11 in the same environment with the exact same variables works.
replica-healthcheck 1.0.0 changed the environment variables. I don't think that change has been reflected in the envs. Note also that we've moved the replica stuff into the monorepo: https://github.com/ethereum-optimism/optimism/tree/develop/infra/op-replica
I think for now we need to change replica.yml to not use the latest version of the HC because other people will have the same problem: https://github.com/ethereum-optimism/optimism/blob/3e995d8e9b8bb5568731ca5e59ceec6bf39e0edd/infra/op-replica/docker-compose/replica.yml#L37
Feels like a bug that the error was thrown in the way you're observing. Service should probably be throwing earlier.
Edit: I opened #2366 to fix the bug in BaseServiceV2 where an error wasn't being thrown when options were missing.
Also opened #2369 to temporarily update the ops setup to use the older version of the healthcheck service by default, will go back to using latest when we fix all the environment variables.
I'll leave this open until we upgrade the envs to have the new variables for the latest version of the healthcheck service
ช่วยสอนทีค่ะ
Closing. We are updated to latest versions. Please use https://github.com/smartcontracts/simple-optimism-node if looking for an easy way to run an Optimism node.