Introduction
Publishing content in Distributed Hash Tables (DHTs) has traditionally been a slow operation, especially when: i) the network is large, and ii) the nodes participating in the network are churning frequently. The case is no different for IPFS’s Amino DHT, which meets both of these conditions. The ProbeLab team identified this problem years ago, through extensive measurements, and proposed an optimisation that was shown to improve performance, i.e., reduce the content publication time by over one order of magnitude while simultaneously reducing the network overhead by 40%.
The optimisation was named Optimistic Provide and it only recently shipped as a default in IPFS’s Kubo 0.39.0! The study was published in IEEE INFOCOM 2024, and we point readers to the publication for more but denser details.
In this blogpost we provide an overview of the technique proposed by our team, alongside basic technical details and, of course, results that prove the validity of our initial claims regarding its effectiveness.
A big thanks to the IPShipyard team for their support along the way and the final push to get this feature into production. According to the results, it was worth the effort.
TL;DR
The basic ideas behind Optimistic Provide are the following:
While walking the DHT, immediately store records with peers that are likely among the 20 network-wide closest peers. Terminate the DHT walk immediately when the set of the discovered 20 closest peers likely constitute the network-wide closest peers. Return control back to the user after most (not all) of the PUT RPCs have succeeded and continue with the remaining ones in the background.
Points 1. and 2. require knowledge of the total network size which we derive from a lightweight estimation method piggy-backing on the routing table refresh mechanism to not incur any additional networking overhead.
Optimistic Provide decreases significantly the upload latency, from more than 13 seconds (often close to 20 seconds) to less than 1 second, and brings tremendous value and impact to the performance of IPFS.
... continue reading