ipfs / ipfs/boxo

gateway: rollback IPNS

Open
#397 1 comment 0 reactions 0 assignees View on GitHub
need/triage
Dominant language
Go
Stars
316
Forks
163
Avg merge
4d 12h
Merged PRs (30d)
8

Description

Currently IPNS over the DHT is very fast to find *a* record but it then waits for a while trying to contact various nodes trying to ensure this record is updated until a timeout is reached.
(see `ipfs name resolve -s $SOME_IPNS_NAME`)

We should start the gateway serving process as soon as the first record is found, but hold onto serving response.
If an other better record is found we can cancel the first request and make a new one, "*rolling back*".
Given reaching consensus on IPNS is often the longest thing before first byte, it would make the TTFB === IPNS resolution time, since initial data resolution (traversing path and ranges in the file until we find the first piece of data), provider record resolution and bitswap session building would be pipelined into quorum process.

Given bitswap sessions and the block cache it's also likely doing an outdated request first will accelerate the real request later. For example if I found you host an old version of some IPNS name, I think it's reasonable to optimistically ask you for the newer one when I learn about it even tho I didn't finished my provider record step yet.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.