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

Runtime restriction of peers #358

Open
gavofyork opened this issue Apr 8, 2020 · 5 comments
Open

Runtime restriction of peers #358

gavofyork opened this issue Apr 8, 2020 · 5 comments
Labels
I5-enhancement An additional feature request. T1-FRAME This PR/Issue is related to core FRAME, the framework.

Comments

@gavofyork
Copy link
Member

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.

@gavofyork gavofyork changed the title Runtime restriction of peer IDs Runtime restriction of peers Apr 8, 2020
@g2udevelopment
Copy link

@gavofyork I was thinking about this issues but with the tools already available this should already be possible. it is a bit cumbersome but using OCW http calls to rpc endpoints peers / addReservedPeer , it is already possible to use the OCW infrastructure to make this kind of calls.

@kaichaosun
Copy link
Contributor

kaichaosun commented Sep 10, 2020

TODOs:

@g2udevelopment
Copy link

TODOs:

  • Persist the reserved nodes configure properly
  • Tutorial / guidance on how to use this feature

Thanks was really waiting on this feature. Hope to use it soon.

@kaichaosun
Copy link
Contributor

The tutorial is ready. I'd like hear how you feel about this feature. @g2udevelopment @mattdean-digicatapult

@g2udevelopment
Copy link

@kaichaosun very nice I will follow the tutorial this will certainly help permissioned chain usecases. Combining this with this like rbac and on-chain governance opens up alot of possibilities thank you.

@juangirini juangirini transferred this issue from paritytech/substrate Aug 24, 2023
@the-right-joyce the-right-joyce added I5-enhancement An additional feature request. T1-FRAME This PR/Issue is related to core FRAME, the framework. and removed J0-enhancement labels Aug 25, 2023
claravanstaden pushed a commit to Snowfork/polkadot-sdk that referenced this issue Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request. T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
Status: Backlog 🗒
Status: Backlog
Development

No branches or pull requests

6 participants