rolling-shutter icon indicating copy to clipboard operation
rolling-shutter copied to clipboard

Integrate libp2p's Kademlia for peer discovery

Open jannikluhn opened this issue 3 years ago • 5 comments

Instead of hardcoding the set of addresses we try to connect to, use Kademlia for peer discovery. The config should still contain a set of nodes to connect to initially if we don't know any other peers yet.

Ideally, we can also whitelist peers by libp2p peer id, but it can also be done separately.

jannikluhn avatar Feb 03 '22 15:02 jannikluhn

I still do not get why the group of keypers cannot be bothered to coordinate and maintain a list of machines that they do run. Is it too much work to ask for, or do we expect them to stay anonymous?

ghost avatar Feb 04 '22 11:02 ghost

I think it's too much work for them. We should make it as easy as reasonably possible to use our software. I see in general two UX problems with a list (maintained, say, in a git repo). First of all, setting up a keyper would be a two step process:

  1. initialize keyper, submit multiaddr to the list
  2. copy and paste the multiaddr list to the config file and start the keyper

Step 2 could only be done after all other nodes submitted their address (and, let's face it, some will miss the deadline and they'd be out).

The second problem is updating it: Whenever a keyper gets a new IP, they'd have to

  1. realize that there's a problem
  2. update the list
  3. convince at least some and ideally all other keypers to update their list and restart their nodes

Similarly if a new keyper joins the set.

I don't think that's practical.

jannikluhn avatar Feb 04 '22 14:02 jannikluhn

Having an explicit list, would have allowed them to firewall off non-keyper addresses. It's how I would have tried to run the system and IIRC it's also what the tendermint documentation suggests to do. If possible I would have tried to run this in a VPN, though I'm not sure if there is a viable solution for that.

Anyway, I'm also fine with not doing all of that and exposing every service to the public internet.

ghost avatar Feb 07 '22 05:02 ghost

Having an explicit list, would have allowed them to firewall off non-keyper addresses.

Using Kademlia doesn't rule out a whitelist, I mentioned it above too. But the whitelist shouldn't be based on physical addresses.

it's also what the tendermint documentation suggests to do.

We don't have an explicit list for shuttermint either.

Anyway, I'm also fine with not doing all of that and exposing every service to the public internet.

We already talked about alternatives, a bootstrap node was one. I'm open to other suggestions, but as discussed I don't think we should require all nodes to configure IP addresses.

jannikluhn avatar Feb 07 '22 08:02 jannikluhn

Using Kademlia doesn't rule out a whitelist, I mentioned it above too. But the whitelist shouldn't be based on physical addresses.

Using a firewall doesn't rule out a whitelist of p2p identities. It operates at a different level of the stack.

We don't have an explicit list for shuttermint either.

Yes, right. They recommend the VPC setup as a way to mitigate DDOS attack. We will also not have this.

ghost avatar Feb 07 '22 09:02 ghost

done

jannikluhn avatar May 29 '24 07:05 jannikluhn