Skip to content
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

Promoting Optimistic Provide from experimental to production ready #10047

Open
dennis-tra opened this issue Aug 3, 2023 · 1 comment
Open
Labels
effort/weeks Estimated to take multiple weeks exp/expert Having worked on the specific codebase is important kind/feature A new feature P2 Medium: Good to have, but can wait until someone steps up

Comments

@dennis-tra
Copy link
Contributor

dennis-tra commented Aug 3, 2023

Context

With Kubo 0.20.0 we released the experimental flag to enable Optimistic Provide. A technique that can dramatically accelerate DHT PUT performance. Recently, we measured sub-second provide latencies from North America and central Europe for >90% percent of the provide operations that we performed (N > 10k) while reducing networking overhead by >40% without compromising record availability.

This is a tracking issue to discuss when and if we should promote it to a production-ready feature.

Outreach/Adoption

I reached out to a couple of projects to gather feedback:

Production-Ready Criteria

TBD

Kubo

At the moment, the feature is a global flag that enables the technique for every provide operation. Given the specific trade-offs of the mechanism, I would rather apply it for specific use-cases only.

For example, non-time-sensitive operations like re-provides don't necessarily need to use it. On the other hand, if users add files to Kubo, I'd argue that they will expect them to be immediately available in the network.

Next Steps

Right now, you can only enable Optimistic Provide globally. This means you either provide content to the Amino DHT using the classic or the optimistic approach. I think it would be better if users could decide which strategy to use based on the use-case.

There are some paths that could benefit from providing optimistically and others where the benefits are debatable:

  1. Where providing optimistically makes sense because I believe users expect content to be available immediately:

    • Running ipfs add .../ipfs dag put and the likes
    • Drag & drop a file into IPFS Desktop/Companion
    • Importing a file into IPFS Desktop/Companion

    These golden paths could be crucial for users to adopt IPFS. If they don't have immediate feedback that it works, the chances are high that they bounce.

  2. Where it makes sense to keep the classic approach:

    • Reproviding, because you could argue that it's not time critical and you really want to make sure to find the actual 20 closest peers.

    Preferably, reproviding would even use something like Reprovide Sweep.

The challenge is that the current routing interface doesn't have an API to pass context information further down the stack. This means we cannot indicate which strategy we prefer to use.

@dennis-tra dennis-tra added the kind/feature A new feature label Aug 3, 2023
@Jorropo
Copy link
Contributor

Jorropo commented Aug 15, 2023

If this is production ready, shouldn't this change be made in go-libp2p-kad-dht ?

@lidel lidel added exp/expert Having worked on the specific codebase is important P2 Medium: Good to have, but can wait until someone steps up effort/weeks Estimated to take multiple weeks labels Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/weeks Estimated to take multiple weeks exp/expert Having worked on the specific codebase is important kind/feature A new feature P2 Medium: Good to have, but can wait until someone steps up
Projects
No open projects
Status: No status
Development

No branches or pull requests

3 participants