Skip to content
Snippets Groups Projects
  • Alexandru Vasile's avatar
    litep2p: Provide partial results to speedup GetRecord queries (#7099) · 77c78e15
    Alexandru Vasile authored
    
    This PR provides the partial results of the `GetRecord` kademlia query.
    
    This significantly improves the authority discovery records, from ~37
    minutes to ~2/3 minutes.
    In contrast, libp2p discovers authority records in around ~10 minutes. 
    
    The authority discovery was slow because litep2p provided the records
    only after the Kademlia query was completed. A normal Kademlia query
    completes in around 40 seconds to a few minutes.
    In this PR, partial records are provided as soon as they are discovered
    from the network.
    
    ### Testing Done
    
    Started a node in Kusama with `--validator` and litep2p backend.
    The node discovered 996/1000 authority records in ~ 1 minute 45 seconds.
    
    ![Screenshot 2025-01-09 at 12 26
    08](https://github.com/user-attachments/assets/b618bf7c-2bba-43a0-a021-4047e854c075)
    
    
    ### Before & After
    
    In this image, on the left side is libp2p, in the middle litep2p without
    this PR, on the right litep2p with this PR
    
    ![Screenshot 2025-01-07 at 17 57
    56](https://github.com/user-attachments/assets/a8d467f7-8dc7-461c-bcff-163b94d01ae8)
    
    
    
    Closes: https://github.com/paritytech/polkadot-sdk/issues/7077
    
    cc @paritytech/networking
    
    ---------
    
    Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>
    Unverified
    77c78e15
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
This project manages its dependencies using Cargo. Learn more