-
Notifications
You must be signed in to change notification settings - Fork 666
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
litep2p/discovery: Fix memory leak in litep2p.public_addresses()
#5998
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
…exnv/bound-dht-addreses
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Why do we have so many (>32) external addresses confirmed? Is there a linked issue in polkadot-sdk? |
This issue was reproduced in Rococo on litep2p validators, don't believe we have an gitissue for it. It looks like over time peers report via identify protocol connections on different ports. |
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This PR ensures that the
litep2p.public_addresses()
never grows indefinitely./identify
protocolThis PR adds a new
ExternalAddressExpired
event to the litep2p/discovery process.Substrate uses an LRU
address_confirmations
bounded to 32 address entries.The oldest entry is propagated via the
ExternalAddressExpired
event when a new address is added to the list (if capacity is exceeded).The expired address is then removed from the
litep2p.public_addresses()
, effectively limiting its size to 32 entries (the size ofaddress_confirmations
LRU).cc @paritytech/networking @alexggh