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

feat(kad): report automatic changes to kad mode #4503

Merged
merged 28 commits into from
Oct 20, 2023

Conversation

dhuseby
Copy link
Contributor

@dhuseby dhuseby commented Sep 14, 2023

Description

Previously, the kademlia protocol would only log changes to the internal mode. With this patch, we now also emit an event which allows users to code against the internal state of the kademlia protocol.

Fixes #4310.

Notes & open questions

Added code to emit a ModeChanged event whenever in automatic mode and we detect a mode change from the external addresses the swarm knows about.

Previous broken PRs: #4341 and #4499

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

@dhuseby dhuseby self-assigned this Sep 14, 2023
@dhuseby dhuseby changed the title Add kad modechange feat(kad): add kad modechange Sep 14, 2023
@dhuseby dhuseby changed the title feat(kad): add kad modechange feat(kad): report automatic changes to kad mode Sep 14, 2023
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 @dhuseby !

protocols/kad/CHANGELOG.md Outdated Show resolved Hide resolved
mxinden
mxinden previously approved these changes Sep 16, 2023
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Small suggestions, otherwise this looks good to me. Adding it to the v0.53 milestone.

protocols/kad/src/behaviour.rs Outdated Show resolved Hide resolved
protocols/kad/src/behaviour.rs Outdated Show resolved Hide resolved
@mxinden mxinden added this to the v0.53.0 milestone Sep 16, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 16, 2023

This pull request has merge conflicts. Could you please resolve them @dhuseby? 🙏

@dhuseby
Copy link
Contributor Author

dhuseby commented Sep 20, 2023

@mxinden or @thomaseizinger I just resolved the CHANGELOG.md issues and put this in the 0.44.5 version but I think this may be a breaking change; that's why we had it in a 0.45.0 release initially.

@dhuseby
Copy link
Contributor Author

dhuseby commented Sep 22, 2023

@thomaseizinger and @mxinden heads up, I bumped kad to 0.45.0 and made the corresponding change to the CHANGELOG.md.

thomaseizinger
thomaseizinger previously approved these changes Sep 24, 2023
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! Looking forward to this being included in the next release :)

@mergify
Copy link
Contributor

mergify bot commented Sep 27, 2023

This pull request has merge conflicts. Could you please resolve them @dhuseby? 🙏

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.

@dhuseby Can you deal with the CI errors? #4547 renamed some symbols in libp2p-kad.

@dhuseby
Copy link
Contributor Author

dhuseby commented Oct 1, 2023

@thomaseizinger the only CI test that fails now is the cargo dependency security check. I think this PR has caught up. Also, what's the process for taking care of the dependencies that need to be updated? Should I post issues for the old deps the CI found? How quickly do we usually address these?

@thomaseizinger
Copy link
Contributor

@thomaseizinger the only CI test that fails now is the cargo dependency security check. I think this PR has caught up. Also, what's the process for taking care of the dependencies that need to be updated? Should I post issues for the old deps the CI found? How quickly do we usually address these?

Thanks! I am not sure where that one slipped in. I'll send a separate PR to fix it.

@mergify

This comment was marked as resolved.

@mergify

This comment was marked as resolved.

@thomaseizinger thomaseizinger marked this pull request as ready for review October 20, 2023 05:50
@mergify mergify bot dismissed stale reviews from thomaseizinger and mxinden October 20, 2023 05:50

Approvals have been dismissed because the PR was updated after the send-it label was applied.

@mergify mergify bot merged commit d26e04a into libp2p:master Oct 20, 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.

kademlia: be louder about the kind of mode we are operating in
3 participants