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

[stable2409] Backport #5998 #6084

Closed

Commits on Oct 16, 2024

  1. litep2p/discovery: Fix memory leak in litep2p.public_addresses() (#…

    …5998)
    
    This PR ensures that the `litep2p.public_addresses()` never grows
    indefinitely.
    - effectively fixes subtle memory leaks
    - fixes authority DHT records being dropped due to size limits being
    exceeded
    - provides a healthier subset of public addresses to the `/identify`
    protocol
    
    This 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 of `address_confirmations` LRU).
    
    cc @paritytech/networking @alexggh
    
    ---------
    
    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    Co-authored-by: Bastian Köcher <git@kchr.de>
    Co-authored-by: Dmitry Markin <dmitry@markin.tech>
    (cherry picked from commit 38aa4b7)
    lexnv authored and github-actions[bot] committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    4f987f2 View commit details
    Browse the repository at this point in the history
  2. litep2p: PubAddr where introduced in 0.7, remove addr as is

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    05341a2 View commit details
    Browse the repository at this point in the history