Skip to content

address: Add bucketed address store to improve CPU usage #410

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

lexnv
Copy link
Collaborator

@lexnv lexnv commented Jul 3, 2025

This PR adds a new AddressStoreBuckets to hold the addresses of a kademlia peer.

The new structure contains 3 buckets:

  • successfully dialed addresses
  • not yet dialed addresses
  • addresses that failed to dial

This has the main benefit of not sorting addresses by score while returning the peer addresses, which is a frequent operation needed to respond to FIND_NODE queries. The assumption is that the new address store, designed specifically for Kademlia, will improve CPU usage by roughly 5-7%.

Next steps

Before reviewing this PR need to go through:

  • versi net testing
  • deployed on kusama validator to validate perf assumption
  • if performance looks promising consider switching transport manager as well

Closes: #408

lexnv added 8 commits July 3, 2025 16:25
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>
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>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv self-assigned this Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AddressStore: Improve the efficiency of the address store
1 participant