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

Move dialing to the Peer manager #3495

Conversation

divagant-martian
Copy link
Collaborator

@divagant-martian divagant-martian commented Aug 23, 2022

Issue Addressed

libp2p's latest release forces a quite big refactor on our lighthouse network crate mainly because of the deprecation of the NetworkBehaviourEventProcess. While doing this, I'll need to remove InternalBehaviourMessage. This PR removes one of the variants: DialPeer moving dialing from the main Behaviour to the PeerManager.

Proposed Changes

This change should maintain essentially the same over-all behaviour:
Before we would tell the peer manager to set a peer as dialing and queue an internal behaviour event to emit the Dial NBAction. The way the derive macro for NetworkBehaviour works is by polling each sub-behaviour in the order they are defined and then calling the custom poll function. Since the peer manager is the last behaviour, having the dial at the beginning of the custom poll function and at the end of the poll for the peer manager should be equivalent.

Additional Info

na

@divagant-martian divagant-martian marked this pull request as ready for review August 23, 2022 16:53
@divagant-martian divagant-martian changed the title move dialing to the pm Move dialing to the Peer manager Aug 23, 2022
@divagant-martian divagant-martian changed the base branch from unstable to libp2p-v0.47.0-upgrade August 26, 2022 16:54
Copy link
Member

@AgeManning AgeManning left a comment

Choose a reason for hiding this comment

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

Yeah cool. We push the dialing down a layer in the PM. Seems equivalent to me.

@AgeManning AgeManning merged commit bae5b36 into sigp:libp2p-v0.47.0-upgrade Aug 30, 2022
bors bot pushed a commit that referenced this pull request Sep 12, 2022
## Issue Addressed

Upgrades libp2p to v.0.47.0. This is the compilation of
- [x] #3495 
- [x] #3497 
- [x] #3491 
- [x] #3546 
- [x] #3553 

Co-authored-by: Age Manning <Age@AgeManning.com>
bors bot pushed a commit that referenced this pull request Sep 29, 2022
## Issue Addressed

Upgrades libp2p to v.0.47.0. This is the compilation of
- [x] #3495 
- [x] #3497 
- [x] #3491 
- [x] #3546 
- [x] #3553 

Co-authored-by: Age Manning <Age@AgeManning.com>
Woodpile37 pushed a commit to Woodpile37/lighthouse that referenced this pull request Jan 6, 2024
## Issue Addressed

Upgrades libp2p to v.0.47.0. This is the compilation of
- [x] sigp#3495 
- [x] sigp#3497 
- [x] sigp#3491 
- [x] sigp#3546 
- [x] sigp#3553 

Co-authored-by: Age Manning <Age@AgeManning.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants