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.

Introduce the notion of multiple chains in substrate-network #3310

@tomaka

Description

@tomaka

I think it's time to introduce the notion of multiple different networks in the substrate-network crate.
We can already connect to multiple networks by creating multiple NetworkWorkers, but that's not a great solution as we duplicate a lot of resources, and is a problem if we ever switch to a single global DHT shared between all chains.

In terms of API, we should:

  • Create a NetworkId struct that is an opaque struct around a u64. They don't have any meaning by themselves. We can decide that 0 means "relay chain", and N means "parachain N", but that's not the concern of substrate-network.
  • Modify the config::Params struct to be able to pass multiple roles, Clients, specializations, etc. and associate them to a NetworkId.
  • The on_block_imported, on_block_finalized, trigger_repropagate, announce_block, gossip_consensus_message, request_justification, and with_spec functions would get a NetworkId parameter to indicate which client we're talking about.

cc @bkchr

Metadata

Metadata

Assignees

No one assigned

    Labels

    J0-enhancementAn additional feature request.U3-nice_to_haveIssue is worth doing eventually.

    Type

    No type

    Projects

    Status

    Backlog 🗒

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions