Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Emit generic PeerConnected/PeerDisconnected event from sc-network #13405

Closed
altonen opened this issue Feb 17, 2023 · 3 comments
Closed

Emit generic PeerConnected/PeerDisconnected event from sc-network #13405

altonen opened this issue Feb 17, 2023 · 3 comments
Labels
I7-refactor Code needs refactoring. S0-design Issue is in the design stage. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder

Comments

@altonen
Copy link
Contributor

altonen commented Feb 17, 2023

Emit generic PeerConnected/PeerDisconnected event from sc-network, carrying the protocol name of the connection

#12828 (comment)

@altonen altonen added I7-refactor Code needs refactoring. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder S0-design Issue is in the design stage. labels Feb 17, 2023
@bkchr
Copy link
Member

bkchr commented Feb 17, 2023

I would not do this on the networking level. Because that would still mean that you need filter based on the protocol somewhere. Yeah okay, I mean this is discussable. We could have this stream from the network and then filter_map before we pass it somewhere else. However, we don't really need this functionality of following other protocols. So still not sure we need this on the network crate level.

@altonen
Copy link
Contributor Author

altonen commented Feb 17, 2023

I would like to rework the event stream system either way. Now we send every event of every protocol to every other protocol and have these if protocol != self.protocol { continue } checks in every event stream handler. What we could instead do is create a subscription-based mechanisms whereby protocols could subscribe to each other's events if they so desire and each protocol would obviously automatically subscribe to its own events. This would reduce unnecessary message passing in the system and would also achieve what I think you're referring to.

@altonen
Copy link
Contributor Author

altonen commented Mar 15, 2023

Superseded by paritytech/polkadot-sdk#518, #13531, and paritytech/polkadot-sdk#515

@altonen altonen closed this as completed Mar 15, 2023
@github-project-automation github-project-automation bot moved this to Blocked ⛔️ in Networking Mar 15, 2023
@altonen altonen moved this from Blocked ⛔️ to Done ✅ in Networking Mar 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I7-refactor Code needs refactoring. S0-design Issue is in the design stage. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder
Projects
Status: Done
Development

No branches or pull requests

2 participants