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(swarm): don't report NewExternalAddrCandidate if already confirmed #5582

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

stormshield-frb
Copy link
Contributor

@stormshield-frb stormshield-frb commented Aug 30, 2024

Description

Currently, NewExternalAddrCandidate events are emitted for every connections. However, we continue to get this event even when autonat has already confirmed that this address is external. So we should not continue to advertise the "candidate" event.

Notes & open questions

We have made the changes in the swarm instead of identify because it does not make it necessary to duplicate the ConfirmedExternalAddr vector in the identify Behaviour. Moreover, if any future Behaviour emit NewExternalAddrCandidate, the same rule will also be applied.

I had to edit the autonat_v2 tests which were always expecting a NewExternalAddrCandidate but the address was already confirmed.

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

Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

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

Hi François, this LGTM! CC @umgefahren wdyt?

@drHuangMHT
Copy link
Contributor

This PR is not marked send-it but ready to merge(branch out-of-date aside), any problem here? @jxs

@drHuangMHT
Copy link
Contributor

drHuangMHT commented Sep 19, 2024

cargo deny failed due to #5596; clippy(beta) failed due to too_long_first_doc_paragraph here:

/// [`Codec`] implements [`Encoder`] and [`Decoder`], uses [`unsigned_varint`]
/// to prefix messages with their length and uses [`quick_protobuf`] and a provided
/// `struct` implementing [`MessageRead`] and [`MessageWrite`] to do the encoding.

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

Successfully merging this pull request may close these issues.

4 participants