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

[Frame Core] Construct Runtime V2 follow-ups #3688

Open
1 of 3 tasks
gupnik opened this issue Mar 14, 2024 · 3 comments
Open
1 of 3 tasks

[Frame Core] Construct Runtime V2 follow-ups #3688

gupnik opened this issue Mar 14, 2024 · 3 comments
Assignees
Labels
I6-meta A specific issue for grouping tasks or bugs of a specific category. T1-FRAME This PR/Issue is related to core FRAME, the framework.

Comments

@gupnik
Copy link
Contributor

gupnik commented Mar 14, 2024

#1378 introduced the new runtime macro. This issue tracks the follow-up items:

@gupnik gupnik added I6-meta A specific issue for grouping tasks or bugs of a specific category. T1-FRAME This PR/Issue is related to core FRAME, the framework. labels Mar 14, 2024
@gupnik gupnik self-assigned this Mar 14, 2024
This was referenced Mar 14, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 21, 2024
dharjeezy pushed a commit to dharjeezy/polkadot-sdk that referenced this issue Mar 24, 2024
github-merge-queue bot pushed a commit that referenced this issue May 29, 2024
Step in #3688

Now that the `runtime` macro (Construct Runtime V2) has been
successfully deployed on Westend, this PR moves it out of the
experimental feature flag and makes it generally available for runtime
devs.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
hitchhooker pushed a commit to ibp-network/polkadot-sdk that referenced this issue Jun 5, 2024
Step in paritytech#3688

Now that the `runtime` macro (Construct Runtime V2) has been
successfully deployed on Westend, this PR moves it out of the
experimental feature flag and makes it generally available for runtime
devs.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
@kianenigma
Copy link
Contributor

Abstract away the executive similar to paritytech/substrate#14742

I am not sure about this. but it is a good candidate.

Alternatively, what I see missing rn is mostly that AllPallets is used in Type Executive but is never declared. Bringing it in scope might help.

I have also pointed out before that this macro seems to do some automatic use * that makes it not intuitive to use, and not in par with frame::pallet macro. Would be great if you can log this as well.

Here's my mentality:

You import polkadot-sdk-frame. This docs for this crate should be informative.

#[frame::pallet] 
pub mod pallet1 {
    use frame::pallet_prelude::*;
} 

#[frame::pallet] 
pub mod pallet2 {
    use frame::pallet_prelude::*;
}

#[cfg(test)]
pub mod tests {
    pub use frame::testing_prelude::*; 

    #[frame::runtime]
    pub mod runtime {
        use frame::runtime_prelude::*;
    }
}

So the experience and behavior you would get from all of these should be as similar as possible.

@gupnik
Copy link
Contributor Author

gupnik commented Jul 17, 2024

I have also pointed out before that this macro seems to do some automatic use * that makes it not intuitive to use, and not in par with frame::pallet macro. Would be great if you can log this as well.

It actually maintains the same scope as with the previous CRV1. I can scope those under a mod and expose all of the generated types such as RuntimeEvent by default, but I am not sure if that adds a lot of value?

use frame::runtime_prelude::*;

What does this runtime_prelude provide?

@kianenigma
Copy link
Contributor

kianenigma commented Jul 26, 2024

What does this runtime_prelude provide?

Types that are needed for a typical runtime, the existing code should to some extent describe this

/// All of the types and tools needed to build FRAME-based runtimes.
#[cfg(any(feature = "runtime", feature = "std"))]
pub mod runtime {
/// The main prelude of `FRAME` for building runtimes.
///
/// A runtime typically starts with:
///
/// ```
/// use polkadot_sdk_frame::{prelude::*, runtime::prelude::*};
/// ```
pub mod prelude {

TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this issue Aug 2, 2024
Step in paritytech#3688

Now that the `runtime` macro (Construct Runtime V2) has been
successfully deployed on Westend, this PR moves it out of the
experimental feature flag and makes it generally available for runtime
devs.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I6-meta A specific issue for grouping tasks or bugs of a specific category. T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
Status: Draft
Development

No branches or pull requests

2 participants