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

Fixing Bootstrapping #6797

Closed
4 tasks done
Stebalien opened this issue Dec 14, 2019 · 6 comments
Closed
4 tasks done

Fixing Bootstrapping #6797

Stebalien opened this issue Dec 14, 2019 · 6 comments
Assignees
Labels
kind/bug A bug in existing code (including security flaws) status/in-progress In progress topic/meta Topic meta

Comments

@Stebalien
Copy link
Member

Stebalien commented Dec 14, 2019

Version information:

v0.5.0-dev

Description:

Libp2p recently increased the minimum RSA key size to 2048 bits. While almost all nodes in the network are using 2048 bit keys already, most of the built-in bootstrap nodes are not.

Luckily, we did have some newer nodes using 2048 bit keys. Specifically, the /dnsaddr/bootstrap.libp2p.io nodes. Unfortunately:

  1. These bootstrappers were added (relatively) recently. Nodes with older configs won't use them.
  2. The DNS record for these bootstrappers was too large: 4 bootstrappers, 4 IP addresses per bootstrapper) to fit into a single UDP packet.

To solve 2, we switched to indirect dnsaddr records: now we have 4 top-level records that each resolve two two dnsaddr records, one for each IP address for each bootstrapper. These records all, individually, fit into single UDP packets.

Unfortunately, go-libp2p doesn't support recursive dnsaddr resolution: libp2p/go-libp2p#744.


So, we need to:

  • Add support for recursive dnsaddr resolution to go-libp2p (Recursive dnsaddr resolution. libp2p/go-libp2p#744).
  • Add a repo migration that:
    • Checks if we already have the new bootstrappers in the config. If so, skip.
    • Checks to see if we have bootstrappers with known sub 2048 bit keys. If not, skip.
    • Otherwise, remove them and replace these old bootstrappers with the new bootstrappers.
    • Replace the /ipfs part of these multiaddrs with /p2p (no reason not to).
  • Test the migration.
  • Update the repo version in go-ipfs.
@Stebalien Stebalien added kind/bug A bug in existing code (including security flaws) topic/meta Topic meta labels Dec 14, 2019
@Stebalien Stebalien mentioned this issue Dec 14, 2019
21 tasks
@dirkmc dirkmc self-assigned this Dec 16, 2019
@dirkmc
Copy link
Contributor

dirkmc commented Dec 16, 2019

@olizilla which of the peers have sub 2048 bit keys?

@olizilla
Copy link
Member

olizilla commented Dec 17, 2019

The ones addressed by /dnsaddr... https://github.com/ipfs/go-ipfs-config/blob/98ec0ae9a3161d355da0615e54ca314232212615/bootstrap_peers.go#L22-L25

misread, the inverse of that... the ones not addressed by /dnsaddr are older and I believe all have 1024 bit keys, https://github.com/ipfs/go-ipfs-config/blob/98ec0ae9a3161d355da0615e54ca314232212615/bootstrap_peers.go#L26-L34

@Stebalien
Copy link
Member Author

@olizilla & @dirkmc

Ok, so, the nodes with peer IDs that start with QmSoL are the ones we need to remove. Notably, mars (/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ), uses a 4096 bit key. Let's leave that one where it is.

@Stebalien
Copy link
Member Author

@olizilla so, something has come up: when we update our new bootstrappers to the next go-ipfs release, we need to use a custom build that can (a) connect to the old bootstrappers and (b) does not disconnect from the old bootstrappers. Otherwise, peers connecting to the old bootstrappers will be isolated from the rest of the network.

@olizilla
Copy link
Member

Exciting! That's ok, we can roll out a custom build from a branch of go-ipfs like we do for gateways.

@Stebalien let me know the branch you set up for that, and I'll set up an autobuild rule for it on dockerhub.

@Stebalien
Copy link
Member Author

👍

Stebalien added a commit that referenced this issue Jan 7, 2020
We're bumping to version 8 to migrate bootstrappers:

1. Switch from /ipfs to /p2p. This isn't necessary but it's still "nice".
2. Add new bootstrappers to old nodes that don't have them.

part of #6797
@Stebalien Stebalien added the status/in-progress In progress label Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) status/in-progress In progress topic/meta Topic meta
Projects
None yet
Development

No branches or pull requests

3 participants