Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Migrate pallet-session to the new pallet macro #9796

Merged
5 commits merged into from
Sep 28, 2021
Merged

Migrate pallet-session to the new pallet macro #9796

5 commits merged into from
Sep 28, 2021

Conversation

koushiro
Copy link
Contributor

Part of #7882

Migrate pallet-session (excluding historical) to the new pallet attribute macro.

⚠️ Breaking Change ⚠️

From https://crates.parity.io/frame_support/attr.pallet.html#checking-upgrade-guidelines

storages now use PalletInfo for module_prefix instead of the one given to decl_storage: Thus any use of this pallet in construct_runtime! should be careful to update name in order not to break storage or to upgrade storage (moreover for instantiable pallet). If pallet is published, make sure to warn about this breaking change.

So users of the pallet must be careful about the name they used in construct_runtime!. Hence the runtime-migration label, which might not be needed depending on the configuration of the pallet.

polkadot and kusama use Session as pallet name, thus no need for migration

Signed-off-by: koushiro <[email protected]>
@gui1117 gui1117 added A0-please_review Pull request needs code review. B3-apinoteworthy C1-low PR touches the given topic and has a low impact on builders. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. labels Sep 16, 2021
Copy link
Contributor

@emostov emostov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

use sp_std::prelude::*;

use super::{shared, Config, IdentificationTuple, ProvingTrie};
use crate::{Pallet as SessionModule, SessionIndex};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for clearing these up, super::super is super confusing (pun intended).

Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@koushiro
Copy link
Contributor Author

/cc @thiolliere @shawntabrizi

@KiChjang
Copy link
Contributor

I wonder if it's okay to just leave pallet-session-historical to be using declarative macros instead of the attribute macros?

@koushiro
Copy link
Contributor Author

I wonder if it's okay to just leave pallet-session-historical to be using declarative macros instead of the attribute macros?

why use declarative macro?I will do it in another PR

@KiChjang
Copy link
Contributor

I meant whether it's okay to not change it in this PR and wait for the next one. But I suppose there isn't any harm in merging this as-is...

@KiChjang
Copy link
Contributor

bot merge

@ghost
Copy link

ghost commented Sep 28, 2021

Trying merge.

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants