ChainSafe / lodestar

🌟 TypeScript Implementation of Ethereum Consensus
https://lodestar.chainsafe.io
Apache License 2.0
1.18k stars 289 forks source link

Running beacon node locally reaches out to external services #7017

Open nazarhussain opened 3 months ago

nazarhussain commented 3 months ago

Describe the bug

Running the node locally reaches out to external serve.

Expected behavior

Node should not ping to any external services or server.

Steps to reproduce

lodestar on  unstable [$!] via 🐳 desktop-linux via  v22.4.0 
❯ ./lodestar beacon --network sepolia --logLevel info --jwtSecret=/tmp/geth/jwt
Aug-13 11:32:08.053[]                 info: Lodestar network=sepolia, version=v1.20.2/nh/state-diff-2/5f2da01, commit=5f2da01b975b0d638171fe3cd4a45983ee91c8af
Aug-13 11:32:08.057[]                 info: Connected to LevelDB database path=/Users/nazar/.local/share/lodestar/sepolia/chain-db
 ✖ RequestError: getaddrinfo ENOTFOUND github.com
    at ClientRequest.<anonymous> (/Users/nazar/Hub/Lodestar/dev/lodestar-2/node_modules/got/dist/source/core/index.js:970:111)
    at Object.onceWrapper (node:events:635:26)
    at ClientRequest.emit (node:events:532:35)
    at ClientRequest.origin.emit (/Users/nazar/Hub/Lodestar/dev/lodestar-2/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
    at TLSSocket.socketErrorListener (node:_http_client:502:9)
    at TLSSocket.emit (node:events:520:28)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
    at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26)

Additional context

Digging further shows that @szmarczak/http-timer is a webdriver dependency, which is a dev dependency so should not be involved in the runtime.

Operating system

Linux

Lodestar version or commit hash

unstbale

nflaig commented 3 months ago

It's not clear from the stack trace but I think this is the request to fetch bootnodes from config repos on github https://github.com/ChainSafe/lodestar/blob/64fe1db806050d5d794ad8bdf83554faed84308c/packages/cli/src/networks/index.ts#L94

https://github.com/ChainSafe/lodestar/blob/64fe1db806050d5d794ad8bdf83554faed84308c/packages/cli/src/networks/sepolia.ts#L4-L6

This should not cause issues, it just prints the error, we could think about making this less noisy.

I don't think we should remove fetching bootnode ENRs from github as otherwise we would solely rely on the hard coded bootnodes, which for mainnet works as it has a stable set of bootnodes but especially for testnets it's better to pull from github.

See previous discussion on managing bootnodes

nazarhussain commented 2 months ago

The error originated from @szmarczak/http-timer which is a webdriver dependency. That is weird and need to look into.

nflaig commented 2 months ago

The error originated from @szmarczak/http-timer which is a webdriver dependency.

It is from got which we use here to fetch the bootnodes, see node_modules/got/dist/source/core/index.js (from stack trace). It's a dependency of got https://www.npmjs.com/package/got?activeTab=dependencies