-
Notifications
You must be signed in to change notification settings - Fork 232
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
IPNS Record Owner Optimisation #274
Comments
Yeah, this would be really nice. Basically, IPNS records could contain "canonical" sources for finding the latest version. |
Turns out you actually mentioned something very similar to this about 4 years ago: libp2p/go-libp2p-kad-dht#145 (comment) |
Having an optional Context: #319 |
I've created #350 to close this issue |
Here's the current situation when fetching the latest IPNS record:
12D3KooWowner
creates an IPNS recordk51key...
and distributes it through the network.12D3KooWresolver
wants to find the latest version ofk51key...
.12D3KooWresolver
searches the network and findsn
peers who advertisek51key...
, they then fetch the record fromn
number of peers and check which record has the highest sequence value.The problem with this system is that it's very slow needing multiple peers to verify that you've fetched the latest record, however, there is an optimisation for speeding this up for when one of the
n
peers happens to be the record owner. Here's how it might work:12D3KooWowner
creates an IPNS recordk51key...
and distributes it through the network.12D3KooWresolver
wants to find the latest version ofk51key...
.12D3KooWresolver
searches the network and findsn
peers who advertisek51key...
. Instead of trying to fetchn
number of records, they start by fetching a few at random (let's say three for this example).12D3KooWresolver
reads the record to find PeerID12D3KooWowner
, they then check to see if any of then
peers they found have PeerID12D3KooWowner
.k51key...
is guaranteed to be the latest and has already been fetched.n-3
peers is the record holder,12D3KooWresolver
can attempt to fetchk51key...
directly from them. If it succeeds, the search can immediately stop since the record owner's copy ofk51key...
is guaranteed to be the latest.12D3KooWowner
isn't any of then
peers, or the attempt to fetchk51key...
from12D3KooWowner
failed,12D3KooWresolver
will continue to fetch all remaining records to compare them as before.Because IPNS records expire, record owners are likely to be online most of the time in order to ensure the record doesn't disappear from the network, this means the chance of finding the record holder amongst the
n
peers will be relatively high in the current environment.The text was updated successfully, but these errors were encountered: