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

Introduce async runtime calling trait for runtime-api subsystem #5782

Merged

Conversation

skunert
Copy link
Contributor

@skunert skunert commented Jul 14, 2022

This is the first PR for paritytech/cumulus#989 (split for more manageable reviews).

As explained in paritytech/cumulus#989, we want to run an overseer with only a few subsystems in the collator node. All communication to the relay chain happens via our RPC.

In this PR, I introduce a new trait, RuntimeApiSubsystemClient. This trait exposes all the runtime methods we need in the subsystem and can be implemented by an RPC-Client (Provided by a future PR). Currently, implementation is provided for the local runtime.

cumulus companion: paritytech/cumulus#1447

@skunert skunert requested a review from a team July 14, 2022 15:26
@skunert skunert added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any 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. labels Jul 14, 2022
@skunert skunert marked this pull request as ready for review July 14, 2022 15:30
@ordian
Copy link
Member

ordian commented Jul 14, 2022

Any reason why RuntimeApiSubsystemClient lives in overseer? It's weird that runtime-api subsystem adds dependency on overseer.

@skunert
Copy link
Contributor Author

skunert commented Jul 15, 2022

Good point. I was initially under the impression that this would not be a big problem since runtime-api subsystem already depends on polkadot-node-subsystem which reexports everything from polkadot-overseer anyway.

But still polkadot-overseer seems not to be the right place, so I moved it to polkadot-node-subsystem-types which is a better fit.

Copy link
Member

@davxy davxy left a comment

Choose a reason for hiding this comment

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

LGTM.

I've just added a bunch of comments to logically divide the RuntimeApiSubsystemClient

node/subsystem-types/src/runtime_client.rs Outdated Show resolved Hide resolved
node/subsystem-types/src/runtime_client.rs Show resolved Hide resolved
node/subsystem-types/src/runtime_client.rs Show resolved Hide resolved
node/subsystem-types/src/runtime_client.rs Outdated Show resolved Hide resolved
node/subsystem-types/src/runtime_client.rs Outdated Show resolved Hide resolved
@davxy davxy requested a review from a team July 15, 2022 12:47
skunert and others added 2 commits July 15, 2022 15:43
Co-authored-by: Davide Galassi <davxy@datawok.net>
node/core/runtime-api/Cargo.toml Outdated Show resolved Hide resolved
node/core/runtime-api/Cargo.toml Outdated Show resolved Hide resolved
node/subsystem-types/src/runtime_client.rs Outdated Show resolved Hide resolved
// === AuthorityDiscovery API ===

/// Retrieve authority identifiers of the current and next authority set.
async fn authorities(
Copy link
Member

Choose a reason for hiding this comment

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

Maybe rename it to authority_discovery_authorities or something else? Otherwise the name is really generic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think here I would prefer to keep it this way. I mirrored the naming of the runtime methods exactly, same for methods like validators. I think in the context of this runtime client, it should be pretty clear were they are coming from.

skunert and others added 2 commits July 18, 2022 10:14
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
@skunert
Copy link
Contributor Author

skunert commented Jul 20, 2022

bot merge

@paritytech-processbot paritytech-processbot bot merged commit bb1bf69 into paritytech:master Jul 20, 2022
ordian added a commit that referenced this pull request Jul 22, 2022
* master:
  westend xcm: collectives parachain is trusted teleporter (#5798)
  Cleanup light client leftovers (#5794)
  Fix benchmarking tests (#5791)
  allow re-use and avoid compiling kusama parachain code (#5792)
  Introduce async runtime calling trait for runtime-api subsystem (#5782)
  add `Extrinsic Ordering` check that runs against a local reference node (#5790)
  Co #11456: Expose `benchmark extrinsic` command (#5620)
  `staking-miner`:  Add handling of `SIGTERM`, `SIGKILL`, `SIGQUIT` and `SIGINT` (#5780)
  Zombienet: paritydb test (#5310)
  Fix Typo (#5766)
  Fix Core Version display in the release notes (#5781)
  companion for new pools reward scheme (#5757)
  fix disable-runtime-api feature flag (#5773)
  split NetworkBridge into two subsystems (#5616)
  Implement prune only stagnant check mode (#5761)
ordian added a commit that referenced this pull request Jul 28, 2022
* master: (37 commits)
  Backport crate version bumps to 0.9.27 (#5826)
  Fix GHA (#5825)
  [ci] Add timeout to benchmark jobs (#5822)
  Parachains db column "migration" (#5797)
  Companion for #11831 (#5784)
  [ci] Return production image (#5818)
  add migration for staking v10 (#5817)
  Prepare for rust 1.62.1 (#5811)
  Bump strum to 0.24.1 (#5816)
  Bump substrate (#5814)
  Add missing trigger wildcards for some CI workflows (#5812)
  malus: add `finality_delay` cli flag (#5770)
  [ci] publish parachain-implementers-guide (#5806)
  westend xcm: collectives parachain is trusted teleporter (#5798)
  Cleanup light client leftovers (#5794)
  Fix benchmarking tests (#5791)
  allow re-use and avoid compiling kusama parachain code (#5792)
  Introduce async runtime calling trait for runtime-api subsystem (#5782)
  add `Extrinsic Ordering` check that runs against a local reference node (#5790)
  Co #11456: Expose `benchmark extrinsic` command (#5620)
  ...
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. B0-silent Changes should not be mentioned in any 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants