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

fix(kad): re-export NodeStatus #4645

Merged
merged 3 commits into from
Oct 16, 2023

Conversation

nathanielc
Copy link
Contributor

@nathanielc nathanielc commented Oct 13, 2023

Description

The EntryView struct exposes the node status however its type is not public making it impossible to use the status field. This change re-exports NodeStatus.

Related: #4108.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@nathanielc
Copy link
Contributor Author

For a little more context I have code very similar to this which checks for disconnected nodes. Without this change it is impossible to upgrade to v0.52 from v0.51 of libp2p for this specific case.

Copy link
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

Thanks for the patch!

This needs a changelog entry before we can merge it. Plus, while I appreciate the consistency, I wonder whether just NodeStatus wouldn't be descriptive enough when used as kad::NodeStatus?

@thomaseizinger thomaseizinger mentioned this pull request Oct 13, 2023
@thomaseizinger thomaseizinger changed the title fix: expose NodeStatus as KBucketNodeStatus fix(kad): reexport NodeStatus Oct 16, 2023
@thomaseizinger
Copy link
Contributor

For a little more context I have code very similar to this which checks for disconnected nodes. Without this change it is impossible to upgrade to v0.52 from v0.51 of libp2p for this specific case.

I've added this to the release milestone to make sure we merge it before we cut the next breaking release.

@thomaseizinger thomaseizinger changed the title fix(kad): reexport NodeStatus fix(kad): re-export NodeStatus Oct 16, 2023
The EntryView struct exposes the node status however its type is not public making it impossible to
use the status field.

This change re-exports NodeStatus according to the existing naming pattern.
See libp2p#4108 which was fixed however the NodeStatus type
was not exposed.
@nathanielc
Copy link
Contributor Author

@thomaseizinger Thanks for the review, I have updated the change and added CHANGELOG entry.

Copy link
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

Thanks!

@mergify mergify bot merged commit 82902fc into libp2p:master Oct 16, 2023
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants