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

Early integration of the DHT with smart-records #727

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

adlrocha
Copy link

This PR is a work in progress. It compiles, it passes a few tests, but it is not fully implemented. Expect messy code an lots of comments

Goal

Implement an early integration of the DHT with smart-records as described in libp2p/go-smart-record#33.

What is currently implemented

  • PutSmartValue that gets closest peers and puts a smart-record in every peer in the path.
  • Simple GetSmartValue implementation that performs a DHT lookup, gets the smart record from the closest peers, and locally aggregates the results to generate the final state of the smart-record.
  • An option to enable smart records in the DHT.

What is missing?

  • DHT lookups for GetSmartValue are currently run till the end. No quorum or stop functions are used to terminate the lookup early. We probably want to let users choose how many smart-records to fetch before terminating. This needs to be implemented.
  • In the original GetValue, every request from a remote peer can optionally return a list of closest peers. This information is used to update the routing tables and (IIRC) put values if we find closest/better peers. In the current implementation we are completely skipping this part.
  • The code doesn't pass a simple GetSetTest. The last piece of sr_test.go is failing, so there is probably a bug or some subtlety I may be missing from the implementation (it fails because the query hits a single peer that doesn't have the record).

I am leaving this draft here for future reference and for anyone to build upon, as I don't think I'll have time to finish it in the short-term. Do not hesitate to ping me if you need my support in any way.

//cc @petar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant