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(dcutr): remove ActionBuilder. #3304

Merged
merged 3 commits into from Jan 10, 2023
Merged

Conversation

jxs
Copy link
Member

@jxs jxs commented Jan 2, 2023

Description

addresses #3299

Notes

Links to any relevant issues

Open Questions

We are now getting the observed_addresses at different places, i.e. previously we had PollParameters on poll with what I assume would be the list of updated external_addresses that would be then used to calculate the list of observed_addresses. Now we get the list of observed_addresses from the ExternalAddrs which is updated on NewExternalAddr, but will it make a difference that it might be updated when an Event has already been added to queued_events?

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

@jxs jxs changed the title dcutr: remove ActionBuilder. refactor(dcutr): remove ActionBuilder. Jan 2, 2023
@jxs jxs force-pushed the remove-actionbuilder branch 2 times, most recently from 6e7953f to c84e71c Compare January 2, 2023 23:08
@mxinden
Copy link
Member

mxinden commented Jan 3, 2023

We are now getting the observed_addresses at different places, i.e. previously we had PollParameters on poll with what I assume would be the list of updated external_addresses that would be then used to calculate the list of observed_addresses. Now we get the list of observed_addresses from the ExternalAddrs which is updated on NewExternalAddr, but will it make a difference that it might be updated when an Event has already been added to queued_events?

Sharp thinking!

I would expect NewExternalAddr to be triggered somewhere on the order of magnitude of <100 over the lifetime of a node, with a "burst" at start-up time.

I would expect the time between an on_connection_event (receiving the external address request from the ConnectionHandler) and a poll (returning the external addresses via the Swarm to the ConnectionHandler) to be below the order of ms.

With the above in mind, I would deem the probability that we are missing an external address very low, where missing an address does not even mean a failed direct-connection-upgrade in the first place. Also note that a failed direct-connection-upgrade is retried 2 times.

Does the above reasoning make sense?

@jxs
Copy link
Member Author

jxs commented Jan 3, 2023

We are now getting the observed_addresses at different places, i.e. previously we had PollParameters on poll with what I assume would be the list of updated external_addresses that would be then used to calculate the list of observed_addresses. Now we get the list of observed_addresses from the ExternalAddrs which is updated on NewExternalAddr, but will it make a difference that it might be updated when an Event has already been added to queued_events?

Sharp thinking!

I would expect NewExternalAddr to be triggered somewhere on the order of magnitude of <100 over the lifetime of a node, with a "burst" at start-up time.

I would expect the time between an on_connection_event (receiving the external address request from the ConnectionHandler) and a poll (returning the external addresses via the Swarm to the ConnectionHandler) to be below the order of ms.

With the above in mind, I would deem the probability that we are missing an external address very low, where missing an address does not even mean a failed direct-connection-upgrade in the first place. Also note that a failed direct-connection-upgrade is retried 2 times.

Does the above reasoning make sense?

yes! Thanks for the explanation Max. 👍

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 suggestion. Otherwise this looks good to me.

protocols/dcutr/CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Max Inden <mail@max-inden.de>
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.

Nice to see this simplification, well spotted @mxinden !

Gives me confidence that #3153 was a good call!

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.

Whoops, wrong button :)

@mxinden mxinden added the send-it label Jan 9, 2023
@mergify mergify bot merged commit 20ce07c into libp2p:master Jan 10, 2023
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.

None yet

3 participants