-
Notifications
You must be signed in to change notification settings - Fork 77
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
Change maxPrunePeers and maxPeersPerPruneMessage usage #336
Conversation
…unt of peers processed in PX
@Nashatyrev please review if it makes sense. |
Hm, it's actually weird that:
I would ideally left just one param to both
But the potential problem is that nodes based on earlier version and sending the unlimited list would be banned by nodes based on latter jvm-Libp2p versions. In other words I would try to avoid the particular situation when newer Teku nodes would ban older Teku nodes. Because of that I would propose the following:
2 phase (for the future PR when the first fix is adopted by the majority):
@diegomrsantos what do you think on this? |
I think it's a good plan.
How about those names
We could also set a default value for What do you think? |
Sounds good to me 👍
Yeah, great idea! |
Additionally, how would you test it? |
You may want to check |
I added a test for |
Thanks for the test 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Just check and maybe merge another test I've suggested
@@ -349,7 +349,7 @@ open class GossipRouter( | |||
} | |||
|
|||
private fun processPrunePeers(peersList: List<Rpc.PeerInfo>) { | |||
peersList.shuffled(random).take(params.maxPrunePeers) | |||
peersList.shuffled(random).take(params.maxPeersAcceptedInPruneMsg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: that take()
call seems to have no effect (as a message exceeding the limit should be dropped before), but I would probably leave it just to be safe in case of future modifications
Add testMaxPeersAcceptedInPruneMsg test
@Nashatyrev Thanks for merging it. I would like to create a PR to set the new parameters on Teku. How should I proceed about updating the jvm-libp2p version there? |
Seems maxPeersPerPruneMessage should be used to limit the amount of peers allowed in a Prune message received and maxPrunePeers should be used to limit the amount of peers sent.