Skip to content

[tracking] Migrate pallets to FRAME umbrella crate #6504

Closed
@re-gius

Description

@re-gius

The goal is to stabilize the FRAME umbrella crate, so that its use within an average pallet is relatively straightforward.

We intend to achieve this goal by migrating some pallets to polkadot-sdk-frame, 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C2-good-first-issueA task for a first time contributor to become familiar with the Polkadot-SDK.D0-easyCan be fixed primarily by duplicating and adapting code by an intermediate coder.I4-refactorCode needs refactoring.R0-silentThe change does not warrant a re-release of the modified crates.T1-FRAMEThis PR/Issue is related to core FRAME, the framework.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions