Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeApis not exposed in the parachain template #6659

Open
2 tasks done
th7nder opened this issue Nov 26, 2024 · 0 comments · May be fixed by #6665
Open
2 tasks done

RuntimeApis not exposed in the parachain template #6659

th7nder opened this issue Nov 26, 2024 · 0 comments · May be fixed by #6665
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@th7nder
Copy link

th7nder commented Nov 26, 2024

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

Hey all,

The parachain template is by configured by default in a way, that does not expose the Runtime API calls information.
That's because impl_runtime_apis! macro is used in a separate module (apis) and it breaks the trait visibility.

I found the issue originally when integrating with subxt, more details on the investigation are here: paritytech/subxt#1873.

Steps to reproduce

#3817 -> introduced a refactoring of the parachain template.
It moves the impl_runtime_apis decl into another module called apis.
Effectivly, trait InternalImplRuntimeApis ends up being under crate::apis::InternalImplRuntimeApis, not in the crate::InternalImplRuntimeApis.

When construct_runtime macro is expanded and uses (&rt).runtime_metadata, it's expanded under crate::* and has no visibility into crate::apis::InternalImplRuntimeApis, because:
a) trait is private
b) construct macro is not importing api::*

So in the end, the 'default, backward compatible' implementation is used.

@th7nder th7nder added I10-unconfirmed Issue might be valid, but it's not yet known. I2-bug The node fails to follow expected behavior. labels Nov 26, 2024
@bkchr bkchr linked a pull request Nov 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant