libp2p / go-libp2p

libp2p implementation in Go
MIT License
5.97k stars 1.05k forks source link

go-libp2p v0.29 #2326

Closed marten-seemann closed 1 year ago

marten-seemann commented 1 year ago

🗺 What's left for release

Planned release date: 2023-07-14 (before the Kubo v0.22 rc cutoff: https://github.com/ipfs/kubo/issues/9911)

Smart Dialing:

QUIC:

Misc:

Metrics:

🔦 Highlights

Smart Dialing

In our last release, we shipped Smart Dialing. To reiterate, it’s a clever way to reduce the number of spurious dials. Instead of dialing all addresses in parallel (which is what we did before v0.28), we now carefully rank the addresses and dial them one by one.

However, there were two areas where the logic we introduced could lead to suboptimal results:

This is why smart dialing was disabled by default in v0.28.

For this release, we implemented a logic we call Black Hole Detection in this release. We now detect if UDP or IPv6 is completely blocked (blackholed) by observing the outcomes of dial attempts. When a black hole is detected, we skip QUIC / WebTransport and IPv6 addresses, respectively. This significantly reduces the number of unsuccessful dials for users in these environments. To monitor the status of black hole detection, we added two Grafana dashboards to our swarm dashboard, showing the percentage successful / failed dials on UDP and IPv6, and if that leads to our blackhole logic kicking in.

This now allows us to use RFC8305 Happy Eyballs for QUIC: When we dial a peer that has a QUIC IPv6 and IPv4 address, we dial the IPv6 address first, and only start dialing the IPv4 address if we haven’t heard back from the peer within 250ms. Only if we don’t hear back within another 250ms, we start dialing on TCP.

In a future release, we will enable a similar logic for TCP IPv6 and IPv4 addresses, however, this will require us to refactor our code a bit (see #2394 for details).

Preliminary measurements on the IPFS network show that:

Smart Dialing is now enabled by default. We don’t expect it to cause any performance regression, but if you find any problems, please open an issue. It can be disabled via a constructor option to libp2p.New:

libp2p.SwarmOpts(swarm.WithDialRanker(swarm.NoDelayDialRanker))

Metrics

Changelog

Contributors

Contributor Commits Lines ± Files Changed
Sukun 14 +1594/-711 48
Marco Munizaga 9 +1085/-541 48
Marten Seemann 14 +428/-205 44
Jorropo 4 +178/-51 8
Adrian Sutton 1 +190/-17 4
VM 2 +80/-79 49
Sahib Yar 1 +43/-4 5
Hlib Kanunnikov 2 +17/-14 5
libp2p-mgmt-read-write[bot] 1 +26/-0 1
GitHub 2 +6/-19 2
Prithvi Shahi 1 +3/-3 1
Bryan White 1 +2/-2 1

✅ Release Checklist

p-shahi commented 1 year ago

Per https://github.com/ipfs/kubo/issues/9911#issuecomment-1613586005 the Kubo 0.22 expected RC date is now (tentatively) 2023-07-20

marten-seemann commented 1 year ago

I pushed the release date to end of next week (July 14th).

MarcoPolo commented 1 year ago

I'm likely going to defer #2369 until the next release. #2318 was already a big enough change and we are enabling smart dialing by default for the first time.

I'm almost hesitant to include #2318 in order to keep this release smaller. But I think if anything fails there it should fail fast. So it's probably okay.

marten-seemann commented 1 year ago

Agreed. It’s ok to keep draft-29 around for another release. We will have to drop it in the next one though, since quic-go v0.37 is removing it.

MarcoPolo commented 1 year ago

v0.29.0 is released. Closing this issue.

sukunrt commented 1 year ago

I ran kubo v0.21.0 with v0.27.7 and v0.29.0.

The detailed numbers are here:

Successes Cancellations Total Cancelled Fraction
v0.27.7 908 1358 2266 0.60
v0.29.0 1083 456 1539 0.30
reduction 66% 32% 51%
sukunrt commented 1 year ago

We should link to the above numbers from the release notes. We should at least make it clear that cancellations are down from 60% of all dials to 30%.

cc @marten-seemann @BigLep