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

docs(iroh-net): Update discovery and dialing docs, signatures #2472

Merged
merged 5 commits into from
Jul 8, 2024

Conversation

flub
Copy link
Contributor

@flub flub commented Jul 8, 2024

Description

This updates the documentationfor the dialing and discovery modules.
It also fixes up some signatures to be more consistent with the rest
of iroh-net:

  • NodeId is used to identify an iroh-net node that is communicated
    with. PublicKey is only used in contexts where
    encryption/decryption happens

  • NodeId is Copy and we pass it by value normally. Not by reference.

Some more changes:

  • DialFuture is entirely unused, probably left over from a refactor.
    Removed.

  • Use pub(super) explicitly, helps clarity of intention as well as
    dead-code detection.

Breaking Changes

The following APIs now take NodeId by value rather than by reference:

  • iroh_blobs::downloader::Dialer::is_pending
  • iroh_net::dialer::Dialer::abort_dial
  • iroh_net::dialer::Dialer::is_pending
  • iroh_net::Endpoint::connect_by_node_id

Other changes:

  • iroh_blobs::downloader::ProviderMap::get_candidates yields NodeId rather than &NodeId

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • [ ] Tests if relevant.
  • All breaking changes documented.

This updates the documentationfor the dialing and discovery modules.
It also fixes up some signatures to be more consistent with the rest
of iroh-net:

- NodeId is used to identify an iroh-net node that is communicated
  with.  PublicKey is only used in contexts where
  encryption/decryption happens

- NodeId is Copy and we pass it by value normally.  Not by reference.

Some more changes:

- DialFuture is entirely unused, probably left over from a refactor.
  Removed.

- Use pub(super) explicitly, helps clarity of intention as well as
  dead-code detection.
@flub flub requested a review from Frando July 8, 2024 10:21
iroh-net/src/discovery.rs Outdated Show resolved Hide resolved
iroh-net/src/discovery.rs Outdated Show resolved Hide resolved
Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
@flub
Copy link
Contributor Author

flub commented Jul 8, 2024

I really need to work on my commas... thanks!

@flub flub enabled auto-merge July 8, 2024 17:06
@flub flub added this pull request to the merge queue Jul 8, 2024
Merged via the queue into main with commit e53714c Jul 8, 2024
26 checks passed
@dignifiedquire dignifiedquire deleted the flub/net-docs-dialier-discovery branch July 9, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants