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

Make polkadot-sdk templates OMNI and GREAT again -- part 2 #5242

Open
13 of 21 tasks
kianenigma opened this issue Aug 5, 2024 · 3 comments
Open
13 of 21 tasks

Make polkadot-sdk templates OMNI and GREAT again -- part 2 #5242

kianenigma opened this issue Aug 5, 2024 · 3 comments
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. I6-meta A specific issue for grouping tasks or bugs of a specific category.

Comments

@kianenigma
Copy link
Contributor

kianenigma commented Aug 5, 2024

Note

The follow-up to #3155, and a huge shoutout to @rzadp so far for his help.

Now we have a new system that syncs our 3 templates into 3 repos, every few weeks, all automatic, guaranteed to work.

The purpose of these 3 templates will be to demonstrate all the latest features of polkadot-sdk, and act as un-opinionated starting points. We expect other teams to build more opinionated templates, and feel free to add these to https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/polkadot_sdk/templates/index.html

I have spread the word of what needs to be done to push the template revamp to full completion in the above issue, but the thread has gotten a bit unorganized by now. In this issue, I will re-iterate the action items.

Tip

All of the work mentioned here is, in my opinion, high impact, and relatively simple. This means: great oppurtunity for both Parity and external contributors!

FRAME / Umbrella Related

Integrate latest features of FRAME and umbrella crates into templates.

Use polkadot-sdk and polkadot-sdk-frame

The entire template should mostly be 3 crates: polkadot-sdk plus, codec and scale-info. For the case of polkadot-sdk-frame, please use prelude::*. If a prelude is missing something, open a PR and add it. If there should be further preludes (e.g. frame::benchmarking_prelude::*?) please add one.

I have logged a few important issues about polkadot-sdk-frame that are not solved yet either, most notably:

Use #[frame::runtime]

Use #[derive_impl]

Note that this also means in the testing code of the template pallet that lives in each template. For production, there is still an ongoing exploration by @gupnik to see if we can use it or not. See #5111 (comment)

  • minimal
  • solochain
  • parachain

Prepare Templates for OMNI Node future

see: #5568

Provide GenesisConfig presets.

The runtime should start exposing at least a development genesis-config, which should be used for testing. Other chain-specs that are currently embedded in the node should also be replicated.

Make node compilation optional - #5940

The node doesn't compile by default when you do cargo build. It should be feature gated behind --features with-node. By default, the template only compiles the runtime and produces a wam. Instead, the user is invited to download polkadot-omni-node/polkadot-parachain.

This makes having ARM binaries quite important: #802

To run this wasm, one is expected to use do either of:

List:

  • 🚨 minimal
  • solochain: Should not happen, as the omni-node cannot support running a solochain
  • 🚨 parachain

Provide chopsticks.yaml

  • minimal
  • solochain
  • 🚨 parachain

Mark templates in substrate-developer-hub as archived.

More ideas? Yes, Sky's the limit!

There is a lot more that can be done to make the polkadot-sdk templates look nice. Be creative and proactive! Look to your favorite tools, repos and templates, and see what elements they have that make enjoy using them, and being them over :)

@kianenigma kianenigma added I6-meta A specific issue for grouping tasks or bugs of a specific category. T17-Templates This PR/Issue is related to templates labels Aug 5, 2024
@michalkucharczyk
Copy link
Contributor

Just for a record: here is a comment with some pending-follow-ups improvements that can be done in the context of Provide GenesisConfig presets task:
#4739 (comment)

@kianenigma kianenigma added C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. and removed T17-Templates This PR/Issue is related to templates labels Sep 18, 2024
github-merge-queue bot pushed a commit that referenced this issue Sep 23, 2024
# Description

* This is part of [issue
5242](#5242),
specifically getting solochain to use `#[frame::runtime]`
* Furthermore, reinforced the convention of `Template` instead of
`TemplateModule`


## Integration

* Should be integrated into the `solochain` template and documentation

## Review Notes

* Refactored `solochain` template from
[construct_runtime!](https://paritytech.github.io/polkadot-sdk/master/frame_support/macro.construct_runtime.html)
to
[#[runtime]](https://paritytech.github.io/polkadot-sdk/master/frame_support/attr.runtime.html).
* AFAIU `Template` is our new convention, and preferred over
`TemplateModule`.

# Out of scope

* The
[#[runtime]](https://paritytech.github.io/polkadot-sdk/master/frame_support/attr.runtime.html)
documentation is still very rudimentary, and should ideally be expanded
to explain the macro, both what it does and the input options.
* Furthermore, suggest update
[#[runtime]](https://paritytech.github.io/polkadot-sdk/master/frame_support/attr.runtime.html)
documentation to replace `#[crate::runtime]` with
`#[frame_support::runtime]`

---------

Co-authored-by: Jan-Jan <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: command-bot <>
@ndkazu
Copy link
Contributor

ndkazu commented Nov 21, 2024

  • About Use #[derive_impl]:
    I might be missing something, but it seems like #[derive_impl] is already being used in the minimal template runtime:
    → check_box update needed?

@Krayt78
Copy link
Contributor

Krayt78 commented Nov 26, 2024

Doesnt #5991 check the umbrela/Frame for the parachain part?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. I6-meta A specific issue for grouping tasks or bugs of a specific category.
Projects
Status: Milestone 0
Development

No branches or pull requests

4 participants