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

[tracking] Migrate pallets to FRAME umbrella crate #6504

Open
10 of 92 tasks
re-gius opened this issue Nov 15, 2024 · 52 comments
Open
10 of 92 tasks

[tracking] Migrate pallets to FRAME umbrella crate #6504

re-gius opened this issue Nov 15, 2024 · 52 comments
Labels
C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. I4-refactor Code needs refactoring. R0-silent Changes should not be mentioned in any release notes T1-FRAME This PR/Issue is related to core FRAME, the framework.

Comments

@re-gius
Copy link
Contributor

re-gius commented Nov 15, 2024

Migrate all pallets to polkadot-sdk-frame by adding types and preludes to it when necessary. As a reference, you can look into #5995.

The guidelines of the umbrella crate are as follows:

//! ## Maintenance Note
//!
//! > Notes for the maintainers of this crate, describing how the re-exports and preludes should
//! > work.
//!
//! * Preludes should be extensive. The goal of this pallet is to be ONLY used with the preludes.
//! The domain-specific modules are just a backup, aiming to keep things organized. Don't hesitate
//! in adding more items to the main prelude.
//! * The only non-module, non-prelude items exported from the top level crate is the `pallet`
//! macro, such that we can have the `#[frame::pallet] mod pallet { .. }` syntax working.
//! * In most cases, you might want to create a domain-specific module, but also add it to the
//! preludes, such as `hashing`.
//! * The only items that should NOT be in preludes are those that have been placed in
//! `frame-support`/`sp-runtime`, but in truth are related to just one pallet.
//! * The currency related traits are kept out of the preludes to encourage a deliberate choice of
//! one over the other.
//! * `runtime::apis` should expose all common runtime APIs that all FRAME-based runtimes need.

✅ Checklist:

  • Add polkadot-sdk-frame to the Cargo.toml
  • Remove all imports from frame_support, sp_runtime and similar, and replace with the appropriate prelude::*
  • For items that are now not in scope, use the above guideline to decide if you should add them to prelude, or reside to using deps
  • Update Cargo.toml to remove all unneeded dependencies.

👉 If you want to work on this: Please check that there is not already a merge request for the pallet that you want to work on (here or in the comments below). Please pick only one or a small set of pallets - not all at once. This keeps review times low. Add a comment below to announce the pallets you're working on.

Pallet list

@re-gius re-gius added R0-silent Changes should not be mentioned in any release notes I4-refactor Code needs refactoring. T1-FRAME This PR/Issue is related to core FRAME, the framework. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. labels Nov 15, 2024
@bennethxyz
Copy link

bennethxyz commented Nov 15, 2024

Can I pick this up @re-gius

Thinking this should be a tracking issue as it involves more than one crate but happy to do it!

@re-gius
Copy link
Contributor Author

re-gius commented Nov 15, 2024

Can I pick this up @re-gius

Thinking this should be a tracking issue as it involves more than one crate but happy to do it!

Yes, it's going to be a tracking issue. You are more than welcome to start working at some pallets/crates, ideally one or two per PR.

@Krayt78
Copy link
Contributor

Krayt78 commented Nov 27, 2024

Are there still some pallets to work on or are you doing all of them?

@bennethxyz
Copy link

please review all open PRs @re-gius, experimental flag removed.

github-merge-queue bot pushed a commit that referenced this issue Jan 20, 2025
github-merge-queue bot pushed a commit that referenced this issue Jan 20, 2025
Part of #6504

### Added modules

- `utility`: Traits not tied to any direct operation in the runtime.

polkadot address: 14SRqZTC1d8rfxL8W1tBTnfUBPU23ACFVPzp61FyGf4ftUFg

---------

Co-authored-by: Giuseppe Re <[email protected]>
Nathy-bajo pushed a commit to Nathy-bajo/polkadot-sdk that referenced this issue Jan 21, 2025
Nathy-bajo pushed a commit to Nathy-bajo/polkadot-sdk that referenced this issue Jan 21, 2025
Part of paritytech#6504

- `utility`: Traits not tied to any direct operation in the runtime.

polkadot address: 14SRqZTC1d8rfxL8W1tBTnfUBPU23ACFVPzp61FyGf4ftUFg

---------

Co-authored-by: Giuseppe Re <[email protected]>
Nathy-bajo pushed a commit to Nathy-bajo/polkadot-sdk that referenced this issue Jan 21, 2025
Nathy-bajo pushed a commit to Nathy-bajo/polkadot-sdk that referenced this issue Jan 21, 2025
Part of paritytech#6504

- `utility`: Traits not tied to any direct operation in the runtime.

polkadot address: 14SRqZTC1d8rfxL8W1tBTnfUBPU23ACFVPzp61FyGf4ftUFg

---------

Co-authored-by: Giuseppe Re <[email protected]>
github-merge-queue bot pushed a commit that referenced this issue Jan 21, 2025
Part of  #6504

---------

Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Giuseppe Re <[email protected]>
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this issue Jan 21, 2025
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this issue Jan 21, 2025
Part of paritytech#6504

### Added modules

- `utility`: Traits not tied to any direct operation in the runtime.

polkadot address: 14SRqZTC1d8rfxL8W1tBTnfUBPU23ACFVPzp61FyGf4ftUFg

---------

Co-authored-by: Giuseppe Re <[email protected]>
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this issue Jan 21, 2025
Part of  paritytech#6504

---------

Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Giuseppe Re <[email protected]>
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this issue Jan 22, 2025
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this issue Jan 22, 2025
Part of paritytech#6504

### Added modules

- `utility`: Traits not tied to any direct operation in the runtime.

polkadot address: 14SRqZTC1d8rfxL8W1tBTnfUBPU23ACFVPzp61FyGf4ftUFg

---------

Co-authored-by: Giuseppe Re <[email protected]>
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this issue Jan 22, 2025
Part of  paritytech#6504

---------

Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Giuseppe Re <[email protected]>
github-merge-queue bot pushed a commit that referenced this issue Jan 22, 2025
#6738)

Part of #6504

---------

Co-authored-by: command-bot <>
Co-authored-by: Bastian Köcher <[email protected]>
@acatangiu
Copy link
Contributor

@kianenigma @bkchr what is the reasoning for "internal" pallets to have to depend on the "external"-facing umbrella crate, instead of only the subset of internal primitives they actually need?

Umbrella crate brings UX/DX value to external projects/crates that themselves depend on many crates within polkadot-sdk, I agree, but I don't see a strong reason for polkadot-sdk internal crates to also depend on it.

It is kinda annoying that if I need to compile or test just one pallet, I would need to compile everything under the umbrella. In practice, this only happens once, so it's not a big deal, but I still don't see the benefit to outweigh this annoyance.

@acatangiu
Copy link
Contributor

And even a larger issue is that a major bump in any crate under the umbrella, major bumps the umbrella, which leads to major bumping ALL pallets depending on the umbrella.

E.g. making some pub trait change to something niche like mmr-primitives could in practice lead to only having to bump pallet-mmr and just that. With the umbrella thing, now all pallets get major bumped for no good reason.

See also #6987 (comment)

I now strongly disagree with this issue/initiative. We want to decouple our SDK as much as possible to be able to do better DevX, this issue works against that.

@kianenigma kianenigma changed the title [tracking] Migrate pallets to umbrella crate [tracking] Migrate pallets to FRAME umbrella crate Jan 30, 2025
@re-gius
Copy link
Contributor Author

re-gius commented Jan 30, 2025

And even a larger issue is that a major bump in any crate under the umbrella, major bumps the umbrella, which leads to major bumping ALL pallets depending on the umbrella.
See also #6987 (comment)

This issue is specifically about the FRAME umbrella crate, so some of the issues you have raised should not apply.

E.g. making some pub trait change to something niche like mmr-primitives could in practice lead to only having to bump pallet-mmr and just that. With the umbrella thing, now all pallets get major bumped for no good reason.

This is a good point, that is why we don't add everything to the FRAME umbrella crate, but just items that appear in three or more pallets, so that the crate is not affected by niche changes to one or two pallets.

I now strongly disagree with this issue/initiative. We want to decouple our SDK as much as possible to be able to do better DevX, this issue works against that.

The main goal of the initiative was to migrate some pallets to the FRAME umbrella crate, so that it would become stable and ready to be used for an average pallet. To achieve this goal, we could also restrict ourselves to only migrate a smaller pre-defined list of most important pallets before we can consider the umbrella crate stable and then leave it as it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. I4-refactor Code needs refactoring. R0-silent Changes should not be mentioned in any release notes T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
None yet
Development

No branches or pull requests