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

refactor(iroh-net)!: Rename endpoint for nodes to node_state #2222

Merged
merged 5 commits into from
Apr 23, 2024

Conversation

flub
Copy link
Contributor

@flub flub commented Apr 23, 2024

Description

We still have too many things named "endpoint", this targets cleaning
up the naming of the state for each node that is stored in the NodeMap.
This is now called NodeState instead of Endpoint. All related APIs
now talk about nodes and node states instead of endpoints.

Another minor cleanup is in the NodeState we had private fields with
accessor functions, except for one field which was directly
accessible. This is migrated to accessor functions for consistency as
well.

Finally it marks the visibility of some functions more explicitly, the
visibility of those was already as such. This makes it easier to work
and realise the impact changes have however.

Breaking Changes

  • MagicSock::tracked_endpoints -> MagicSock::connection_infos
  • MagicSock::tracked_endpoint -> MagicSock::connection_info
  • magicsock::EndpointInfo -> magicsock::ConnectionInfo

Notes & open questions

Finally had to courage to change this, it's much less worse than I
feared and to me it really helps calling this NodeState. I find
it a noticeable improvement.

Change checklist

  • Self-review.
  • Documentation updates if relevant.
  • Tests if relevant.
  • All breaking changes documented.

We still have many things named "endpoint", this targets cleaning up
the naming of the state for each node that is stored in the NodeMap.
This is now called NodeState instead of Endpoint.  All related APIs
now talk about nodes and node states instead of endpoints.

Another minor cleanup is in the NodeState we had private fields with
accessor functions, except for one field which was directly
accessible.  This is migrated to accessor functions for consistency as
well.
This visibility was already implicitly so, making it explicit makes
this much easier to work with.
@flub flub changed the title refactor(iroh-net): Rename endpoint for nodes to node_state refactor(iroh-net)!: Rename endpoint for nodes to node_state Apr 23, 2024
Copy link
Contributor

@divagant-martian divagant-martian left a comment

Choose a reason for hiding this comment

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

awesome!

@divagant-martian divagant-martian added this pull request to the merge queue Apr 23, 2024
Merged via the queue into main with commit 26e4564 Apr 23, 2024
21 of 22 checks passed
@divagant-martian divagant-martian deleted the flub/rename-endpoint-nodestate branch April 23, 2024 17:11
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