Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Called on_block_announce with a bad PeerId #5592

Closed
@tomaka

Description

I'm trying to debug this error log being printed at the moment.

For example, here is a selection of logs concerning a faulty peer:

2020-04-09 05:28:04.113 main-tokio- DEBUG sub-libp2p Libp2p => Connection (ConnectionId(TaskId(48824)),Listener { local_addr: "/ip4/10.128.0.9/tcp/30333", send_back_addr: "/ip4/35.198.126.58/tcp/46740" }) to Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8 closed.
2020-04-09 05:28:04.113 main-tokio- DEBUG sub-libp2p Libp2p => Disconnected(Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8): Was disabled.
2020-04-09 05:29:16.519 main-tokio- DEBUG sub-libp2p Libp2p => Connection (ConnectionId(TaskId(48992)),Listener { local_addr: "/ip4/10.128.0.9/tcp/30333", send_back_addr: "/ip4/35.198.126.58/tcp/47480" }) to Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8 established.
2020-04-09 05:29:16.520 main-tokio- DEBUG sub-libp2p Libp2p => Connected(Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8, Listener { local_addr: "/ip4/10.128.0.9/tcp/30333", send_back_addr: "/ip4/35.198.126.58/tcp/47480" }): Incoming connection
2020-04-09 05:29:16.520 main-tokio- DEBUG sub-libp2p PSM <= Incoming(Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8, IncomingIndex(24268)).
2020-04-09 05:29:16.520 main-tokio- DEBUG sub-libp2p PSM => Accept(IncomingIndex(24268), PeerId("Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8")): Enabling connections.
2020-04-09 05:29:16.520 main-tokio- DEBUG sub-libp2p Handler(PeerId("Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8")) <= Enable
2020-04-09 05:29:17.146 main-tokio- DEBUG sub-libp2p Handler(PeerId("Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8")) => Endpoint Listener { local_addr: "/ip4/10.128.0.9/tcp/30333", send_back_addr: "/ip4/35.198.126.58/tcp/47480" } open for custom protocols.
2020-04-09 05:29:17.146 main-tokio- DEBUG sub-libp2p External API <= Open(PeerId("Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8"))
2020-04-09 05:29:17.146 main-tokio- TRACE sync Connecting Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8
2020-04-09 05:29:17.146 main-tokio- TRACE sync New peer Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8 Status { version: 6, min_supported_version: 3, roles: AUTHORITY, best_number: 1807687, best_hash: 0x0b5673dee66fa81b6c6d81bc9259865deda933b4c11d297e252bb160bf07c1c5, genesis_hash: 0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe, chain_status: [] }
2020-04-09 05:29:17.146 main-tokio- DEBUG sync Connected Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8
2020-04-09 06:03:42.423 main-tokio- DEBUG sub-libp2p Libp2p => Connection (ConnectionId(TaskId(51883)),Listener { local_addr: "/ip4/10.128.0.9/tcp/30333", send_back_addr: "/ip4/35.198.126.58/tcp/49894" }) to Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8 established.
2020-04-09 06:03:42.423 main-tokio- DEBUG sub-libp2p Handler(Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8,ConnectionId(TaskId(51883))) <= Enable secondary connection
2020-04-09 06:03:42.677 main-tokio- DEBUG sub-libp2p Libp2p => Connection (ConnectionId(TaskId(51883)),Listener { local_addr: "/ip4/10.128.0.9/tcp/30333", send_back_addr: "/ip4/35.198.126.58/tcp/49894" }) to Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8 closed.
2020-04-09 06:03:42.678 main-tokio- DEBUG sub-libp2p External API <= Closed(Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8)
2020-04-09 06:03:42.678 main-tokio- TRACE sync Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8 disconnected
2020-04-09 06:03:49.304 main-tokio- DEBUG sync Received block announcement 0x3e521bdd4f3b6bdb16e3c545b0bd7acb79a4686e8acf0d5305c301f8f7038462 with number 1808030 from Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8
2020-04-09 06:03:49.305 main-tokio- ERROR sync 💔 Called on_block_announce with a bad peer ID

(I made the effort to find all the entries that are possibly relevant to this peer, but the logs are huge and it's not impossible that I have missed some)
(also, feel free to copy-paste these logs for better readability)

It seems to me that:

  • A first connection to Qmar25qYxcoLzPuzHDZ9nM7o38mNPqnKrZaksf3aY8rdM8 is established with task ID 48992.
  • The PSM approves it.
  • We report to the external API that the substream has been opened.
  • A second connection with task ID 51883 gets established to the same peer.
  • That second connection (task ID 51883) gets closed shortly after (200ms)
  • We report to the external API that the substream has been closed.

The last step seems wrong to me, as the first connection should still be alive. I didn't find anything in the logs about task ID 48992 other than what is above.

cc @romanb is that related to libp2p/rust-libp2p#1546?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    I3-bugThe node fails to follow expected behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions