Skip to content
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.

dev: initial work on NameSystem, wrapping the underlying DHT network. #122

Merged
merged 6 commits into from
Nov 7, 2022

Conversation

jsantell
Copy link
Contributor

@jsantell jsantell commented Nov 1, 2022

Implementation of the NameSystem propagating records through the DHT network.

  • Top-level exports like NameSystem, NameSystemBuilder and NSRecord all have rather robust tests and docs.
    • NSRecord is the struct being transmitted over the DHT. Rolling our own de/serializer due to cid's built-in serde implementation always writing to bytes. The structure is transmitted as JSON UTF-8. Flexible about details here, but is an area that will need to be "standardized" as part of the protocol. I imagine additional fields on here once we add UCAN.
    • NameSystem and NameSystemBuilder APIs are flexible, but attempt to mimic DNS.
    • Re-exports aren't ideal, but the multiformats Cid and Multiaddr are rather intrinsic to Noosphere/NS.
  • ns_test is a good example of functionality.
  • Very few interesting changes in the underlying dht implementation, mostly clippy/lint changes.
  • Not yet implemented:
    • CLI demo; initial work stashed elsewhere for now, can integrate it fully into orb when ready
    • SphereIpld integration; initial work stashed elsewhere containing a names entry, can start this either with UCAN or CLI integration.
    • Any UCAN integration (hydration, validation)
    • Automatically propagating provided records at TTL interval

@jsantell jsantell requested a review from cdata November 1, 2022 20:25
rust/noosphere-ns/src/name_system.rs Outdated Show resolved Hide resolved
rust/noosphere-ns/src/name_system.rs Outdated Show resolved Hide resolved
rust/noosphere-ns/src/name_system.rs Outdated Show resolved Hide resolved
rust/noosphere-ns/src/name_system.rs Outdated Show resolved Hide resolved
rust/noosphere-ns/src/dht/swarm.rs Show resolved Hide resolved
rust/noosphere-ns/src/records.rs Outdated Show resolved Hide resolved
rust/noosphere-ns/src/records.rs Outdated Show resolved Hide resolved
rust/noosphere-ns/src/records.rs Outdated Show resolved Hide resolved
rust/noosphere-ns/src/records.rs Outdated Show resolved Hide resolved
rust/noosphere-ns/tests/ns_test.rs Show resolved Hide resolved
@jsantell jsantell force-pushed the namesystem branch 2 times, most recently from f4932c9 to 303ba5e Compare November 1, 2022 21:22
Copy link
Collaborator

@cdata cdata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really crisp iteration over what has already been landed, great work! I have some general questions and a few small actionable items, but otherwise I'm happy for us to ship it.

rust/noosphere-ns/src/builder.rs Outdated Show resolved Hide resolved
rust/noosphere-ns/src/builder.rs Outdated Show resolved Hide resolved
rust/noosphere-ns/src/dht/processor.rs Outdated Show resolved Hide resolved
rust/noosphere-ns/src/dht/swarm.rs Show resolved Hide resolved
rust/noosphere-ns/src/dht/swarm.rs Show resolved Hide resolved
rust/noosphere-ns/src/records.rs Outdated Show resolved Hide resolved
rust/noosphere-ns/src/records.rs Outdated Show resolved Hide resolved
rust/noosphere-ns/src/records.rs Show resolved Hide resolved
rust/noosphere-ns/src/records.rs Outdated Show resolved Hide resolved
rust/noosphere-ns/tests/ns_test.rs Outdated Show resolved Hide resolved
@jsantell jsantell force-pushed the namesystem branch 2 times, most recently from ccc027f to c909031 Compare November 3, 2022 20:47
@jsantell
Copy link
Contributor Author

jsantell commented Nov 3, 2022

Updated with UCAN integration, where records are authorized and set as UCAN tokens, and propagated on the network in their encoded form. Previous comments have been addressed; I'll inline the areas of interest from previous review -- NSRecord and ns_test are the majority of changes

@jsantell jsantell requested a review from cdata November 3, 2022 20:50
rust/noosphere-ns/src/records.rs Show resolved Hide resolved
rust/noosphere-ns/src/records.rs Show resolved Hide resolved
rust/noosphere-ns/src/records.rs Show resolved Hide resolved
rust/noosphere-ns/tests/ns_test.rs Show resolved Hide resolved
… can be stored/validated later, and enable NameSystem to evict expired records from cache.
cdata
cdata previously approved these changes Nov 7, 2022
Copy link
Collaborator

@cdata cdata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any feedback for changes, just some questions. This looks like really great progress, and we can land it when you are ready.

rust/noosphere-ns/Cargo.toml Outdated Show resolved Hide resolved
rust/noosphere-ns/src/utils.rs Outdated Show resolved Hide resolved
rust/noosphere-ns/tests/ns_test.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@cdata cdata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work as usual 🙌

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

Successfully merging this pull request may close these issues.

2 participants