-
Notifications
You must be signed in to change notification settings - Fork 47
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
chore: add config to limit peerstore capacity #770
chore: add config to limit peerstore capacity #770
Conversation
Jenkins BuildsClick to see older builds (18)
|
Thinking more about this PR, something that i find concerning is that peerID are ephemeral (just logout and login in desktop and you get a new peerID). Wouldn't this be problematic? I wonder you'd end up filling slots in the peerstore with peers that might no longer exist, and reach a limit in the peerstore |
Good point. At some point during this I was thinking if there is a TTL for not connected peers in the peerstore. That should take care of it. If not, another approach we could take is remove peers from the store once they are disconnected, anyways now we have discv5 running constantly doing discovery which would help find peers as and when peers are less. |
For now, I have set address expiry of discovered peers. Looks like we need to handle this in Waku layer in a different way. I looked at Prysm and noticed that they don't use the libp2p peerStore at all and have their own peerStore. Probably we may have to take #579 up to handle such scenarios. |
* feat: connect/disconnect to peers based on node topic sub/unsub * feat: maintain healty relay connections per pubSubTopic Co-authored-by: richΛrd <info@richardramos.me> * chore: add config to limit peerstore capacity (#770)
Description
go-libp2p doesn't provide an option to limit peer-store capacity which may cause it to grow unbounded.
This PR includes a config flag which is already there in nwaku to set peerStore capacity. If not set, set it to 5*maxConnections flag.
Ref waku-org/nwaku#1525
Changes
Tests
Ran all unit tests.
Ran service-node with and without setting peer-store-capacity flag to confirm values are set appropriately.
Did not add any new unit tests as changes seem trivial.