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

dcutr: Remove ActionBuilder #3299

Closed
mxinden opened this issue Jan 2, 2023 · 1 comment
Closed

dcutr: Remove ActionBuilder #3299

mxinden opened this issue Jan 2, 2023 · 1 comment
Assignees
Labels
difficulty:easy getting-started Issues that can be tackled if you don't know the internals of libp2p very well help wanted

Comments

@mxinden
Copy link
Member

mxinden commented Jan 2, 2023

In libp2p-dcutr we introduced ActionBuilder as events from the ConnectionHandler could not be enriched with the local node's external addresses from the on_* event handlers. Instead, one had to wait for the NetworkBehaviour::poll method to access the addresses.

/// A [`NetworkBehaviourAction`], either complete, or still requiring data from [`PollParameters`]
/// before being returned in [`Behaviour::poll`].
enum ActionBuilder {
Done(NetworkBehaviourAction<Event, handler::Prototype>),
Connect {
attempt: u8,
handler: NotifyHandler,
peer_id: PeerId,
},
AcceptInboundConnect {
inbound_connect: Box<protocol::inbound::PendingConnect>,
handler: NotifyHandler,
peer_id: PeerId,
},
}

Now that #3153 is merged, event handlers have access to the external addresses right away, thus the ActionBuilder abstraction is no longer needed. Let's remove it.

@mxinden mxinden added priority:oneday difficulty:easy help wanted getting-started Issues that can be tackled if you don't know the internals of libp2p very well labels Jan 2, 2023
@mxinden mxinden changed the title dcutr: Refactor ActionBuilder dcutr: Remove ActionBuilder Jan 2, 2023
@jxs jxs self-assigned this Jan 2, 2023
mergify bot pushed a commit that referenced this issue Jan 10, 2023
@thomaseizinger
Copy link
Contributor

Done in #3304.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty:easy getting-started Issues that can be tackled if you don't know the internals of libp2p very well help wanted
Projects
None yet
Development

No branches or pull requests

3 participants