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

add MaxPeerNumber() option to p2p #3412

Closed
dustinxie opened this issue May 26, 2022 · 0 comments · Fixed by #3409
Closed

add MaxPeerNumber() option to p2p #3412

dustinxie opened this issue May 26, 2022 · 0 comments · Fixed by #3409
Assignees
Labels
enhancement New feature or request

Comments

@dustinxie
Copy link
Member

What would you like to be added:
when p2p creates a Host instance, it passed down couple of options:

func (p *agent) Start(ctx context.Context) error {
	ready := make(chan interface{})
	p2p.SetLogger(log.L())
	opts := []p2p.Option{
		p2p.HostName(p.cfg.Host),
		p2p.Port(p.cfg.Port),
		p2p.Gossip(),
		p2p.SecureIO(),
		p2p.MasterKey(p.cfg.MasterKey),
		p2p.PrivateNetworkPSK(p.cfg.PrivateNetworkPSK),
		p2p.DHTProtocolID(p.chainID),
		p2p.DHTGroupID(p.chainID),
	}

add another option MaxPeerNumber(). A node is expected to maintain connection to (80% of this number) many peers to be considered healthy

Why is this needed:
to work with ongoing p2p improvement

@dustinxie dustinxie added the enhancement New feature or request label May 26, 2022
@dustinxie dustinxie linked a pull request Jun 24, 2022 that will close this issue
1 task
@Liuhaai Liuhaai mentioned this issue Jul 1, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@dustinxie @Liuhaai and others