-
Notifications
You must be signed in to change notification settings - Fork 237
Closed
Labels
P3Low: Not priority right nowLow: Not priority right nowkind/enhancementA net-new feature or an improvement to an existing featureA net-new feature or an improvement to an existing feature
Description
Here's the current situation when fetching the latest IPNS record:
- Peer
12D3KooWowner
creates an IPNS recordk51key...
and distributes it through the network. - Peer
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:
- Peer
12D3KooWowner
creates an IPNS recordk51key...
and distributes it through the network. - Peer
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
.- If one of the 3 random peers was the record owner, the search can immediately stop since the record owner's copy of
k51key...
is guaranteed to be the latest and has already been fetched. - If one of the
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. - If
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.
Stebalien and lidel
Metadata
Metadata
Assignees
Labels
P3Low: Not priority right nowLow: Not priority right nowkind/enhancementA net-new feature or an improvement to an existing featureA net-new feature or an improvement to an existing feature