Code Monkey home page Code Monkey logo

specs's People

Contributors

gammazero avatar ischasny avatar masih avatar olizilla avatar willscott avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

specs's Issues

Define address discovery specification

There are no IPNI specifications for discovering addresses given a peer ID even though the IPNI implementation running at cid.contact offers this via the /providers/<peer-id> endpoint.

  • Update IPNI specification with HTTP endpoints that allow address discovery given peer ID
  • Update OpenAPI specification as needed.

Relates to: ipni/caskadht#10

Add markdown lint

Add lint for all markdown files similar to the setup used by ipfs/specs

Introduce "height" field to Provider's `head` payload

Calculating the height of advertisement chain is cheap and fast for a provider. That information can provide a significant cause in conflict resolution across indexers.

Indexers can also calculate this number while ingesting ads. However

  • adding that on provider's side within the signed head payload reduces the need for trusting indexers.
  • existing indexers who have not measured height do not need to re-ingest or re-traverse the ad chain to calculate this number.

Direct HTTP announce should include topic name

The concept topic is present in gossipsub announcements which separates publications by network name. But direct HTTP announce has no such primitive defined in message schema.

We most likely want the topic separation at IPNI protocol level to reduce testing noise from non-mainnet announcements.

Specify Mirror HTTP API

Specify a HTTP protocol for retrieving advertisements from other indexers via their mirror instance. The specification should provide additional headers to communicate rate limits on retrieval to its users. It may also be only limited to indexers in the same federation (instead of public access)

Refine `GET /multihash/<multihash>` response for `ndjson`

The response structure used by IPNI for GET /multihash/<multihash> is optimised for batch find: it includes the multihash that is being looked up as base64 encoded string, along with a nested array of results.

I believe the rationale has been to use the same response model for both batch find, and single find request. For non-streaming responses this is fine; however, for responses streamted using new-line delimited json (i.e. ndjson) it becomes suboptimal:

  • in ndjson each response needs to be a JSON object.
  • because the results for a single mulithash are nested in an array, to stream the response using the current model one has to repeat the multihash that is being looked up in every streamed response.

This is less than optimum considering the vast majority of traffic received by cid.contact is for explicit multihash lookups.

Consider spec changes for a more optimal response structure for single multihash lookup, such that:

  • the original multihash looked up via GET request is not repeated in the response or optionally included.
  • the response model is preferably made up of a series of self contained JSON objects optimised for the streaming case, which hopefully becomes the default/preferred response media type when Accept request header permits it.

Support for advertisement chain truncation

If all of the advertisements in the oldest segment of an advertisement chain no longer advertise valid content, then it may be reasonable for the provider to have a way to stop serving those advertisements. The reasons for doing so are:

  • Reduce storage used for old outdated advertisements
  • Prevent indexers from traversing empty end segment of chain

Even if all of the advertisements at the oldest end of the advertisement chain have been deleted by removal ads later in the chain, indexers will still traverse those advertisements looking for non-deleted advertisements. This incurs a chain traversal for each indexer that could be prevented if a chain truncation mechanism were available.

Chain truncation may also be wanted in cases where a lost/corrupt database results in older advertisement data being unavailable and unrecoverable, yet it is not desirable to start an entirely new chain. Indexing will not be able to proceed unless the unavailable end of the chain is understood by indexers to be truncated.

Possible truncation mechanisms:

  • Publish a new advertisement with a new TruncateAt field that specifies where to end traversal of the ad chain.
  • Return NotFound or new Truncated error when fetching advertisement after truncation point.

Requiring a new advertisement that specifies chain truncation is explicit, so cannot happen due to some error condition as interpreting an error can.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.