Skip to content

Runtime restriction of peers #358

@gavofyork

Description

@gavofyork

Right now, managing (reserved) peers is entiely client-side with no input/integration from within the runtime. However there are usecases where we might want to allow the runtime to state which node IDs should be connected to (e.g. with a secure private network).

This could be done in one of two ways:

  • A well-known storage item that dictates to nodes (at least those that do not opt-out) about which other node IDs they are allowed to peer with. This lets the runtime command the participants of the network very easily, but cannot do anything "adaptive" where its logic changes depending on those participants.

  • Two additional OCW APIs, one to get the current set of peers, and another to set the reserved nodes. The chain spec should provide defaults (bootnodes already exists but we probably want a "bootnodes-only" flag). They should persist across restarts for that chain so that at the initial startup (before the OCW runs) the node doesn't try to connect to nodes that it shouldn't. This allows on-chain logic to get exposure to potentially every node's peer connectivity and to manage their peering individually, potentially openning the door to some quite interesting things.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I5-enhancementAn additional feature request.T1-FRAMEThis PR/Issue is related to core FRAME, the framework.

    Type

    No type

    Projects

    Status

    Backlog

    Status

    Backlog 🗒

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions