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

Fix error message when providing an incorrect peer-id #5724

Merged
merged 3 commits into from
Apr 23, 2020

Conversation

chevdor
Copy link
Contributor

@chevdor chevdor commented Apr 21, 2020

I was using docker-compose files with old peer-id and got the following errors:

dave            | 2020-04-21 13:44:43 💔 Invalid peer ID from bootnode, expected `QmQZ8TjTqeDj3ciwr93EJ95hxfDsb9pEYDizUAbWpigtQN` at address `/ip4/172.28.1.1/tcp/30333`.
bob             | 2020-04-21 13:44:43 💔 Invalid peer ID from bootnode, expected `QmQZ8TjTqeDj3ciwr93EJ95hxfDsb9pEYDizUAbWpigtQN` at address `/ip4/172.28.1.1/tcp/30333`.
eve             | 2020-04-21 13:44:43 💔 Invalid peer ID from bootnode, expected `QmQZ8TjTqeDj3ciwr93EJ95hxfDsb9pEYDizUAbWpigtQN` at address `/ip4/172.28.1.1/tcp/30333`.
dave            | 2020-04-21 13:44:43 💔 Invalid peer ID from bootnode, expected `QmQZ8TjTqeDj3ciwr93EJ95hxfDsb9pEYDizUAbWpigtQN` at address `/ip4/172.28.1.1/tcp/30333`.
charlie         | 2020-04-21 13:44:43 💔 Invalid peer ID from bootnode, expected `QmQZ8TjTqeDj3ciwr93EJ95hxfDsb9pEYDizUAbWpigtQN` at address `/ip4/172.28.1.1/tcp/30333`.

In that case, QmQZ8TjTqeDj3ciwr93EJ95hxfDsb9pEYDizUAbWpigtQN is not expected but the wrong one.

@bkchr
Copy link
Member

bkchr commented Apr 21, 2020

No, the chain spec/cli provides the peer ids. This is the peer id that will be expected by the node and not the peer id that the other node returned.

So, the error message is correct and I will close this pr. Ty anyway.

@bkchr bkchr closed this Apr 21, 2020
@chevdor
Copy link
Contributor Author

chevdor commented Apr 21, 2020

After discussion, an option would be to fix the message with a better one that address properly both cases.

Say we have 2 nodes: node1 and node2. For the sake of brevity, I keep the ids short below.

Node1 has a peer-id which n1.

When a user connects node2 to node1 and mentions that the peer-id should be node1 (which is wrong, it should be n1) , there are 2 possible explanations:

  • the user providing the peer-id node1 made a mistake (that was my case)
  • something malicious is going on and node1 is not the one we expect (the case initially implemented).

I will provide a new fix that provides a message that works for both cases.

@chevdor chevdor reopened this Apr 21, 2020
@bkchr bkchr added B0-silent Changes should not be mentioned in any release notes A8-mergeoncegreen labels Apr 21, 2020
@tomaka
Copy link
Contributor

tomaka commented Apr 23, 2020

I took the liberty to merge master in this branch.

@bkchr bkchr merged commit 45b1247 into paritytech:master Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
B0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants