Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error reporting on bad enr in --bootnodes #4522

Closed
dapplion opened this issue Sep 8, 2022 · 1 comment
Closed

Better error reporting on bad enr in --bootnodes #4522

dapplion opened this issue Sep 8, 2022 · 1 comment
Assignees
Labels
scope-ux Issues for CLI UX or general consumer UX.

Comments

@dapplion
Copy link
Contributor

dapplion commented Sep 8, 2022

Describe the bug

Running lodestar with --bootnodes=bad_enr results in

Sep-08 15:43:14.426[]                 info: Initializing beacon state from anchor state slot=0, epoch=0, stateRoot=0xea2855c3a4d341cfc991dcfc3d685347b0a69dbe63b51f1d838248e4cbfa0c1e
 ✖ Error: string encoded ENR must start with 'enr:'
    at Function.decodeTxt (/usr/app/node_modules/@chainsafe/discv5/lib/enr/enr.js:92:19)
    at createNodeJsLibp2p (file:///usr/app/packages/beacon-node/src/network/nodejs/util.ts:56:54)
    at Object.beaconHandler [as handler] (file:///usr/app/packages/cli/src/cmds/beacon/handler.ts:74:15)

It's hard to figure out that the cause of the error is a bad enr.

Expected behavior

Throw early and with a message: bad ENR formatting supplied as bootnode.

@philknows philknows added the scope-ux Issues for CLI UX or general consumer UX. label Sep 8, 2022
@nazarhussain nazarhussain self-assigned this Sep 5, 2023
@nazarhussain
Copy link
Contributor

We have updated a proper message and fail earlier during the command parsing. This applies to both beacon and bootnode commands.

throw new YargsError(`Provided ENR in bootnodes is invalid:\n ${enrStr}`);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope-ux Issues for CLI UX or general consumer UX.
Projects
None yet
Development

No branches or pull requests

3 participants