Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Change sc_network::protocol::generic_proto::behaviour to occupy inbound peerset slots for substreams and not connections #7074

@tomaka

Description

@tomaka

At the moment, receiving an incoming connection results in behaviour.rs requesting an inbound slot from the peerset.
If the peerset refuses the node, any incoming substream is immediately shut down.
If the peerset accepts the node, incoming notification substreams are expected. If no such substream arrives, the connection is killed after a 60 seconds timeout. During these 60 seconds, the peerset slot is reserved.

The problem with that scheme is that if a node connects for example only for Kademlia-related purposes and has a no intention of opening notification substreams, a peerset slot will also get reserved.

Instead, a slot should be queried from the peerset only after the remote has attempt to open notification substreams.

This change requires a lot of tweaking in group.rs as well in order for the NotifsHandler struct to signal that the remote desires the substreams to be open.
As such, this issue is blocked upon some parts of #5670. See #5670 for details about how this issue integrates with the rest of the changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    J0-enhancementAn additional feature request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions