Skip to content
Snippets Groups Projects
  • Dmitry Markin's avatar
    Replace `Multiaddr` & related types with substrate-specific types (#4198) · d05786ff
    Dmitry Markin authored
    This PR introduces custom types / substrate wrappers for `Multiaddr`,
    `multiaddr::Protocol`, `Multihash`, `ed25519::*` and supplementary types
    like errors and iterators.
    
    This is needed to unblock `libp2p` upgrade PR
    https://github.com/paritytech/polkadot-sdk/pull/1631 after
    https://github.com/paritytech/polkadot-sdk/pull/2944 was merged.
    `libp2p` and `litep2p` currently depend on different versions of
    `multiaddr` crate, and introduction of this "common ground" types is
    needed to support independent version upgrades of `multiaddr` and
    dependent crates in `libp2p` & `litep2p`.
    
    While being just convenient to not tie versions of `libp2p` & `litep2p`
    dependencies together, it's currently not even possible to keep `libp2p`
    & `litep2p` dependencies updated to the same versions as `multiaddr` in
    `libp2p` depends on `libp2p-identity` that we can't include as a
    dependency of `litep2p`, which has it's own `PeerId` type. In the
    future, to keep things updated on `litep2p` side, we will likely need to
    fork `multiaddr` and make it use `litep2p` `PeerId` as a payload of
    `/p2p/...` protocol.
    
    With these changes, common code in substrate uses these custom types,
    and `litep2p` & `libp2p` backends use corresponding libraries types.
    Unverified
    d05786ff
Code owners
Assign users and groups as approvers for specific file changes. Learn more.