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: Peers into PeerSet #1714

Merged
merged 7 commits into from
Feb 1, 2024
Merged

refactor: Peers into PeerSet #1714

merged 7 commits into from
Feb 1, 2024

Conversation

sistemd
Copy link
Contributor

@sistemd sistemd commented Jan 30, 2024

Refactor the Peers type so it makes more sense. Make it so that Peers is the single source of truth for our peers. Add the new useful and evicted flags needed by #1711.

Base automatically changed from sistemd/refactor-p2p-config to main January 31, 2024 12:00
Comment on lines 33 to 34
// TODO What do we need this for?
pending_dials: HashMap<PeerId, EmptyResultSender>,
Copy link
Contributor Author

@sistemd sistemd Jan 31, 2024

Choose a reason for hiding this comment

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

This currently seems unused. We're keeping track of pending dials, but we use this information for nothing.

@CHr15F0x Do you know what this is about? Can I remove this?

Copy link
Member

Choose a reason for hiding this comment

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

dead code 🔪

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah my bad, it's actually used to match dial responses with commands since dialing is asynchronous 🤦

@sistemd sistemd marked this pull request as ready for review January 31, 2024 14:37
@sistemd sistemd requested a review from a team as a code owner January 31, 2024 14:37
crates/p2p/src/behaviour.rs Outdated Show resolved Hide resolved
Copy link
Member

@CHr15F0x CHr15F0x left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@sistemd sistemd changed the title Refactor Peers into PeerSet refactor: Peers into PeerSet Feb 1, 2024
@sistemd sistemd merged commit 5d7be3f into main Feb 1, 2024
7 checks passed
@sistemd sistemd deleted the sistemd/peers-refactor branch February 1, 2024 15:30
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.

3 participants