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

Subnet service #115

Merged
merged 4 commits into from
Feb 5, 2025
Merged

Subnet service #115

merged 4 commits into from
Feb 5, 2025

Conversation

dknopik
Copy link
Member

@dknopik dknopik commented Jan 23, 2025

Proposed Changes

Small service that gets notified when a validator gets added or removed and passes on instructions to subscribe/unsubscribe/look for peers

@dknopik dknopik changed the base branch from stable to unstable January 23, 2025 16:13
Copy link

@diegomrsantos diegomrsantos left a comment

Choose a reason for hiding this comment

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

Thank you for starting this! I added some comments.

{
error!(?err, subnet = *subnet, "can't subscribe");
}
self.swarm
Copy link

@diegomrsantos diegomrsantos Jan 23, 2025

Choose a reason for hiding this comment

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

Interestingly, Lighthouse doesn't do that. There could be a check somewhere else (PeerManager?) that keeps the target number of peers for each subnet.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I think we should check the peer_store before trying to discover. Will add this in my simplified peer manager PR.

@dknopik
Copy link
Member Author

dknopik commented Jan 28, 2025

Pushed a new design based on #117.

Also pulled out the logic from network into its own crate, but kept the full logic (mapping updates to subnets) in one place. The reasoning behind that is that I think we should avoid bothering the network create with events as much as possible to avoid computation in the network service if possible.

@dknopik dknopik marked this pull request as ready for review February 5, 2025 10:45
@dknopik dknopik added ready-for-review This PR is ready to be reviewed network labels Feb 5, 2025
@dknopik dknopik requested a review from diegomrsantos February 5, 2025 10:46
diegomrsantos
diegomrsantos previously approved these changes Feb 5, 2025
Copy link

@diegomrsantos diegomrsantos left a comment

Choose a reason for hiding this comment

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

Looks amazing!

@dknopik dknopik merged commit 2c220a4 into sigp:unstable Feb 5, 2025
10 checks passed
@dknopik dknopik deleted the subnet_service branch February 5, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
network ready-for-review This PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants