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

sp-api should not depend on frame-metadata #14296

Closed
JoshOrndorff opened this issue Jun 2, 2023 · 1 comment · Fixed by #14398
Closed

sp-api should not depend on frame-metadata #14296

JoshOrndorff opened this issue Jun 2, 2023 · 1 comment · Fixed by #14398
Labels
I4-annoyance The client behaves within expectations, however this “expected behaviour” itself is at issue. T1-runtime This PR/Issue is related to the topic “runtime”.

Comments

@JoshOrndorff
Copy link
Contributor

Not all Substrate blockchains use frame. However, all Substrate blockchains will use sp-api for the core and blockbuilder apis among others.

Currently sp-api has a hard dependency on metadata-ir which has a hard dependency on frame-metadata. Both metadata-ir and frame-metadata are very frame-specific, and are not used by non-frame chains. They should also not have to be compiled.

@bkchr
Copy link
Member

bkchr commented Jun 2, 2023

The entire requirement of needing to pass some kind of Runtime type into impl_runtimes_apis! comes from being written with FRAME in mind. However, we can probably improve the situation (while technically it will not change anything for you besides not compiling the packages).

We should make the metadata-ir stuff optional behind a feature and then change frame-support to always activate this feature. Thus, you should not be required to pull in any FRAME deps when not building a FRAME based runtime.

@bkchr bkchr added the I4-annoyance The client behaves within expectations, however this “expected behaviour” itself is at issue. label Jun 2, 2023
@juangirini juangirini added the T1-runtime This PR/Issue is related to the topic “runtime”. label Jun 7, 2023
bkchr added a commit that referenced this issue Jun 15, 2023
bkchr added a commit that referenced this issue Jul 3, 2023
* sp-api: Put `frame-metadata` behind some feature

Closes: #14296

* ".git/.scripts/commands/fmt/fmt.sh"

* Review feedback

---------

Co-authored-by: command-bot <>
@github-project-automation github-project-automation bot moved this from Backlog to Done in Runtime / FRAME Jul 3, 2023
nathanwhit pushed a commit to nathanwhit/substrate that referenced this issue Jul 19, 2023
* sp-api: Put `frame-metadata` behind some feature

Closes: paritytech#14296

* ".git/.scripts/commands/fmt/fmt.sh"

* Review feedback

---------

Co-authored-by: command-bot <>
taqtiqa-mark pushed a commit to subversive-upstream/polkadot-sdk-substrate-frame-support that referenced this issue Sep 14, 2023
* sp-api: Put `frame-metadata` behind some feature

Closes: paritytech/substrate#14296

* ".git/.scripts/commands/fmt/fmt.sh"

* Review feedback

---------

Co-authored-by: command-bot <>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I4-annoyance The client behaves within expectations, however this “expected behaviour” itself is at issue. T1-runtime This PR/Issue is related to the topic “runtime”.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants