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 #6603 #6669

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Commits on Nov 27, 2024

  1. litep2p/req-resp: Always provide main protocol name in responses (#6603)

    Request responses are initialized with a main protocol name, and
    optional protocol names as a fallback.
    
    Running litep2p in kusama as a validator has surfaced a `debug_asserts`
    coming from the sync component:
    
    https://github.com/paritytech/polkadot-sdk/blob/3906c578c96d97a8a099a4bdac4685acbe375a7c/substrate/client/network/sync/src/strategy/chain_sync.rs#L640-L646
    
    The issue is that we initiate a request-response over the main protocol
    name `/genesis/sync/2` but receive a response over the legacy procotol
    `ksm/sync/2`. This behavior is correct because litep2p propagates to the
    higher levels the protocol that responded.
    
    In contrast, libp2p provides the main protocol name regardless of
    negotiating a legacy protocol.
    
    Because of this, higher level components assume that only the main
    protocol name will respond.
    To not break this assumption, this PR alings litep2p shim layer with the
    libp2p behavior.
    
    Closes: #6581
    
    ---------
    
    Signed-off-by: Alexandru Vasile <[email protected]>
    Co-authored-by: Dmitry Markin <[email protected]>
    (cherry picked from commit 2a0b268)
    lexnv authored and github-actions[bot] committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    0046227 View commit details
    Browse the repository at this point in the history