Skip to content

Uncaught exception in discv5 #9310

@yorickdowne

Description

@yorickdowne

Describe the bug

Lodestar may print an exception in logs on a discv5 message that does not match its expectations. This is likely just cosmetic

consensus-1  | Apr-30 09:13:05.001[]                 info: Synced - slot: 14226363 - head: 0xad37…4795 - exec-block: syncing(24991950 0x0f57…) - finalized: 0xb3d0…8e71:444571 - peers: 90
consensus-1  | Apr-30 09:13:14.266[network]         error: uncaughtException: Encoded protocol length should be 2
consensus-1  | Error: Encoded protocol length should be 2
consensus-1  |     at getProtocolValue (file:///usr/app/node_modules/.pnpm/@chainsafe+enr@6.0.1/node_modules/@chainsafe/enr/lib/enr.js:147:19)
consensus-1  |     at get udp (file:///usr/app/node_modules/.pnpm/@chainsafe+enr@6.0.1/node_modules/@chainsafe/enr/lib/enr.js:242:16)
consensus-1  |     at getSocketAddressOnENRByFamily (file:///usr/app/node_modules/.pnpm/@chainsafe+discv5@12.0.1/node_modules/@chainsafe/discv5/lib/util/ip.js:71:37)
consensus-1  |     at getSocketAddressOnENR (file:///usr/app/node_modules/.pnpm/@chainsafe+discv5@12.0.1/node_modules/@chainsafe/discv5/lib/util/ip.js:88:28)
consensus-1  |     at SessionService.onEstablished (file:///usr/app/node_modules/.pnpm/@chainsafe+discv5@12.0.1/node_modules/@chainsafe/discv5/lib/service/service.js:626:27)
consensus-1  |     at SessionService.emit (node:events:508:28)
consensus-1  |     at SessionService.handleChallenge (file:///usr/app/node_modules/.pnpm/@chainsafe+discv5@12.0.1/node_modules/@chainsafe/discv5/lib/session/service.js:335:22)
consensus-1  |     at UDPTransportService.processInboundPacket (file:///usr/app/node_modules/.pnpm/@chainsafe+discv5@12.0.1/node_modules/@chainsafe/discv5/lib/session/service.js:227:22)
consensus-1  |     at UDPTransportService.emit (node:events:508:28)
consensus-1  |     at Socket.handleIncoming (file:///usr/app/node_modules/.pnpm/@chainsafe+discv5@12.0.1/node_modules/@chainsafe/discv5/lib/transport/udp.js:113:14) - Encoded protocol length should be 2
consensus-1  | Error: Encoded protocol length should be 2
consensus-1  |     at getProtocolValue (file:///usr/app/node_modules/.pnpm/@chainsafe+enr@6.0.1/node_modules/@chainsafe/enr/lib/enr.js:147:19)
consensus-1  |     at get udp (file:///usr/app/node_modules/.pnpm/@chainsafe+enr@6.0.1/node_modules/@chainsafe/enr/lib/enr.js:242:16)
consensus-1  |     at getSocketAddressOnENRByFamily (file:///usr/app/node_modules/.pnpm/@chainsafe+discv5@12.0.1/node_modules/@chainsafe/discv5/lib/util/ip.js:71:37)
consensus-1  |     at getSocketAddressOnENR (file:///usr/app/node_modules/.pnpm/@chainsafe+discv5@12.0.1/node_modules/@chainsafe/discv5/lib/util/ip.js:88:28)
consensus-1  |     at SessionService.onEstablished (file:///usr/app/node_modules/.pnpm/@chainsafe+discv5@12.0.1/node_modules/@chainsafe/discv5/lib/service/service.js:626:27)
consensus-1  |     at SessionService.emit (node:events:508:28)
consensus-1  |     at SessionService.handleChallenge (file:///usr/app/node_modules/.pnpm/@chainsafe+discv5@12.0.1/node_modules/@chainsafe/discv5/lib/session/service.js:335:22)
consensus-1  |     at UDPTransportService.processInboundPacket (file:///usr/app/node_modules/.pnpm/@chainsafe+discv5@12.0.1/node_modules/@chainsafe/discv5/lib/session/service.js:227:22)
consensus-1  |     at UDPTransportService.emit (node:events:508:28)
consensus-1  |     at Socket.handleIncoming (file:///usr/app/node_modules/.pnpm/@chainsafe+discv5@12.0.1/node_modules/@chainsafe/discv5/lib/transport/udp.js:113:14)
consensus-1  | Apr-30 09:13:17.001[]                 info: Synced - slot: 14226364 - head: 0xaa34…83bc - exec-block: syncing(24991951 0xef1e…) - finalized: 0xb3d0…8e71:444571 - peers: 99

Expected behavior

Lodestar catches the exception and doesn't print a message at INFO level. Maybe this belongs in DEBUG

Steps to reproduce

  1. Start a Lodestar mainnet sync
  2. Wait - dependent on discv5 received and may be quite rare

Additional context

Full command line: node /usr/app/packages/cli/bin/lodestar beacon --dataDir /var/lib/lodestar/consensus --rest.address 0.0.0.0 --rest.port 5052 --port 9000 --quicPort 9001 --nat --metrics true --metrics.port 8008 --metrics.address 0.0.0.0 --execution.urls http://execution:8551 --jwtSecret /var/lib/lodestar/consensus/ee-secret/jwtsecret --logLevel info --suggestedFeeRecipient 0x<redacted> --listenAddress 0.0.0.0 --network mainnet --checkpointSyncUrl=https://beaconstate.info --chain.pruneHistory

Operating system

Linux

Lodestar version or commit hash

v1.42.0/443e0a4

Metadata

Metadata

Assignees

No one assigned

    Labels

    meta-bugIssues that identify a bug and require a fix.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions