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

Allow integrated relay chain light client #2270

Merged
merged 57 commits into from
Aug 22, 2023

Conversation

skunert
Copy link
Contributor

@skunert skunert commented Mar 3, 2023

In this PR, I added a command line flag --relay-chain-rpc-client to enable experimental support for an embedded light client.

This leaves us with three execution modes for the relay chain:

  1. Embedded polkadot full node
  2. External polkadot node (using embedded mini-node for collation and pov-recovery)
  3. Embedded light-client (using embedded mini-node for collation and pov-recovery)

Implementation Overview

  • I reused the existing RPC infrastructure as much as possible. Only the worker is switched out
  • The light client is run in-process and gets the chain spec that is passed via relay chain args to the collator
  • We communicate with the help of the jsonrpsee library and let it handle subscription and request management
  • The example light-client implementation in the smoldot repo uses an implementation of the platform trait based on async-std. Since we use tokio here, I converted the implementation 1:1 using tokio structures.

Remaining issues

This issue is impacting us, I will take a look at what needs to be done on the substrate side:

@skunert skunert added A0-please_review Pull request needs code review. B1-note_worthy Changes should be noted in the release notes D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Mar 3, 2023
@skunert skunert requested a review from a team March 3, 2023 11:55
@skunert skunert added the C1-low PR touches the given topic and has a low impact on builders. label Mar 3, 2023
Copy link
Contributor

@dmitry-markin dmitry-markin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as far as I understood the underlying logic from the code of PR.

client/cli/src/lib.rs Show resolved Hide resolved
client/relay-chain-rpc-interface/src/rpc_client.rs Outdated Show resolved Hide resolved
client/relay-chain-rpc-interface/src/tokio_platform.rs Outdated Show resolved Hide resolved
@dmitry-markin dmitry-markin requested a review from a team March 3, 2023 16:07
Cargo.lock Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
zombienet/tests/0002-pov_recovery.toml Outdated Show resolved Hide resolved
zombienet/tests/0007-full_node_warp_sync.toml Show resolved Hide resolved
client/relay-chain-rpc-interface/src/rpc_client.rs Outdated Show resolved Hide resolved
client/relay-chain-rpc-interface/src/tokio_platform.rs Outdated Show resolved Hide resolved
client/relay-chain-rpc-interface/src/tokio_platform.rs Outdated Show resolved Hide resolved
@davxy
Copy link
Member

davxy commented Jun 21, 2023

LGTM mostly nitpicks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B1-note_worthy Changes should be noted in the release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit T0-node This PR/Issue is related to the topic “node”.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants