identify: simplify implementation by removing peer tracking #1965
Labels
effort/days
Estimated to take multiple days, but less than a week
exp/intermediate
Prior experience is likely helpful
kind/enhancement
A net-new feature or improvement to an existing feature
P0
Critical: Tackled by core team ASAP
Identify currently deduplicates deltas sent to peers that we hold multiple connections to. This creates a lot of complexity in the implementation of the protocol.
It would be nice if we could simplify the logic to act on connections instead. There'd be no complicated tracking logic: start handling a connection when it's opened / accepted, and handle it until it is closed.
I measured how frequent duplicate connections really are by running Kubo both on my local machine (behind a CGNAT) and on a public server. The highest number of peers with duplicate connections I've come across was duplicates to 9 peers out of a total of 159, but that value quickly dropped as connections churned. For the vast majority of the time, we had duplicate connections to about 1% of the peers.
I expect that the number of duplicates will drop even further once we implement a smarter dialing logic (#1785), although we will never be able to completely eliminate them, given that two peers dialing each other at exactly the same time will end up with two connections.
@vyzo @Stebalien quick sanity check, does this make sense?
The text was updated successfully, but these errors were encountered: