simple-optimism-node
simple-optimism-node copied to clipboard
L1 RPC endpoint protected by basic auth is not working
My L1 RPC endpoint is protected by a basic auth. In my .env file I have something like this:
# L1 node to run fault detection against
FAULT_DETECTOR__L1_RPC_PROVIDER=https://username:[email protected]
# Node to get chain data from (if SYNC_SOURCE is "l1" then use L1 node, etc.)
DATA_TRANSPORT_LAYER__RPC_ENDPOINT=https://username:[email protected]
It doesn't seem to work, here is the DTL error:
simple-optimism-node-dtl-1 | {"level":30,"time":1682413470213,"msg":"Service is starting..."}
simple-optimism-node-dtl-1 | {"level":30,"time":1682413470214,"msg":"Service is initializing..."}
simple-optimism-node-dtl-1 | {"level":30,"time":1682413470214,"msg":"Initializing L1 Data Transport Service..."}
simple-optimism-node-dtl-1 | {"level":30,"time":1682413470249,"msg":"L2 chain ID is: 10"}
simple-optimism-node-dtl-1 | {"level":30,"time":1682413470249,"msg":"BSS HF1 will activate at: 2824317"}
simple-optimism-node-dtl-1 | {"level":30,"time":1682413470258,"msg":"Service is initializing..."}
simple-optimism-node-dtl-1 | {"level":30,"time":1682413470268,"defaultBackend":"l1","l1GasPriceBackend":"l1","msg":"HTTP Server Options"}
simple-optimism-node-dtl-1 | {"level":30,"time":1682413470268,"url":"https://username:[email protected].","msg":"HTTP Server L1 RPC Provider initialized"}
simple-optimism-node-dtl-1 | {"level":30,"time":1682413470269,"url":"https://username:[email protected].","msg":"HTTP Server L2 RPC Provider initialized"}
simple-optimism-node-dtl-1 | {"level":30,"time":1682413470269,"msg":"Service has initialized."}
simple-optimism-node-dtl-1 | {"level":30,"time":1682413470269,"msg":"Service is initializing..."}
simple-optimism-node-dtl-1 | Well, that's that. We ran into a fatal error. Here's the dump. Goodbye!
simple-optimism-node-dtl-1 | /opt/optimism/node_modules/@ethersproject/logger/lib/index.js:238
simple-optimism-node-dtl-1 | var error = new Error(message);
simple-optimism-node-dtl-1 | ^
simple-optimism-node-dtl-1 |
simple-optimism-node-dtl-1 | Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.7.1)
simple-optimism-node-dtl-1 | at Logger.makeError (/opt/optimism/node_modules/@ethersproject/logger/lib/index.js:238:21)
simple-optimism-node-dtl-1 | at Logger.throwError (/opt/optimism/node_modules/@ethersproject/logger/lib/index.js:247:20)
simple-optimism-node-dtl-1 | at StaticJsonRpcProvider.<anonymous> (/opt/optimism/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:609:54)
simple-optimism-node-dtl-1 | at step (/opt/optimism/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23)
simple-optimism-node-dtl-1 | at Object.throw (/opt/optimism/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53)
simple-optimism-node-dtl-1 | at rejected (/opt/optimism/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65)
simple-optimism-node-dtl-1 | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
simple-optimism-node-dtl-1 | reason: 'could not detect network',
simple-optimism-node-dtl-1 | code: 'NETWORK_ERROR',
simple-optimism-node-dtl-1 | event: 'noNetwork'
simple-optimism-node-dtl-1 | }
simple-optimism-node-dtl-1 exited with code 1
Do you have any idea how I can get around this problem?
It seems that there are envs
for this problem: https://github.com/ethereum-optimism/optimism/tree/develop/packages/data-transport-layer#configuration-1
envs:
-
DATA_TRANSPORT_LAYER__L1_RPC_USER
-
DATA_TRANSPORT_LAYER__L1_RPC_PASSWORD
-
DATA_TRANSPORT_LAYER__L2_RPC_USER
-
DATA_TRANSPORT_LAYER__L2_RPC_PASSWORD
I'll try to create a PR to support this envs
Unfortunately it seems that there are no user and password options for FAULT_DETECTOR__L1_RPC_PROVIDER
and OP_NODE__RPC_ENDPOINT
Do you have any ideas?
I tried to use DATA_TRANSPORT_LAYER__L1_RPC_USER
and DATA_TRANSPORT_LAYER__L1_RPC_PASSWORD
for DATA_TRANSPORT_LAYER__RPC_ENDPOINT
.
And use https://user:password@host:port
syntax for FAULT_DETECTOR__L1_RPC_PROVIDER
and OP_NODE__RPC_ENDPOINT
.
Here is what I changed (just add DATA_TRANSPORT_LAYER__L1_RPC_USER
and DATA_TRANSPORT_LAYER__L1_RPC_PASSWORD
support)
https://github.com/smartcontracts/simple-optimism-node/compare/main...olivbau:simple-optimism-node:basicauth-support
But it's not working, here is the type of errors I get on the DTL:
{
"level":50,
"time":1682520117625,"extra":{"message":"TypeError: Cannot read properties of null (reading 'from')","stack":"TypeError: Cannot read properties of null (reading 'from')
at Object.getExtraData (/opt/optimism/packages/data-transport-layer/dist/src/services/l1-ingestion/handlers/sequencer-batch-appended.js:27:38)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async L1IngestionService._syncEvents (/opt/optimism/packages/data-transport-layer/dist/src/services/l1-ingestion/service.js:286:39)
at async L1IngestionService._start (/opt/optimism/packages/data-transport-layer/dist/src/services/l1-ingestion/service.js:165:17)
at async L1IngestionService.start (/opt/optimism/packages/common-ts/dist/base-service/base-service.js:33:9)
at async Promise.all (index 1)
at async L1DataTransportService._start (/opt/optimism/packages/data-transport-layer/dist/src/services/main/service.js:69:13)
at async L1DataTransportService.start (/opt/optimism/packages/common-ts/dist/base-service/base-service.js:33:9)
at async /opt/optimism/packages/data-transport-layer/dist/src/services/run.js:78:9"},"msg":"Caught an unhandled error"
}
Do you have any ideas on how to fix this problem?