-
Notifications
You must be signed in to change notification settings - Fork 987
Migrate pallet-grandpa to use the FRAME umbrella crate #8264
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
Migrate pallet-grandpa to use the FRAME umbrella crate #8264
Conversation
…te. Begin modifying files...
…There is still a strange issue when running tests with runtime-benchmarks regarding a UNIX timestamp
@re-gius Good day! I've decided to write this PR for pallet-grandpa, I'm available for any required changes. One issue I noticed from my PR is that I cannot run tests without adding the runtime-benchmarks feature, if this is ok then it's as intended. Looking forward to the review! |
Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
…rame lib triage. Revert benchmarks to original and fix imports...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please:
- merge the changes from
master
branch - run
taplo format --config .config/taplo.toml
to fix any toml formatting issues
…lla-crate-grandpa
…om/Wolfenheimm/polkadot-sdk into wolfenheimm-umbrella-crate-grandpa
Review required! Latest push from author must always be reviewed |
Co-authored-by: Giuseppe Re <[email protected]>
@re-gius, apologies for the previous issues and thank you for pointing them out - I'm seeing quite a few errors here in the workflow - is there anything else I should focus on? i.e. "You can just apply the patch (git apply PATCH_NAME) that was printed to make this CI check succeed." in check-umbrella. Not quite sure how to approach that one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hope that my comments are enough to solve most of the issues
@@ -122,6 +122,12 @@ pub use sp_runtime::{ | |||
self, print, traits::Printable, ConsensusEngineId, MAX_MODULE_ERROR_ENCODED_SIZE, | |||
}; | |||
|
|||
pub use self::migrations::VersionedMigration; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove all the changes from this file, you shouldn't touch it. It's better to change only the frame umbrella crate.
"pallet-timestamp/std", | ||
"scale-info/std", | ||
"sp-application-crypto/std", | ||
"sp-consensus-grandpa/std", | ||
"sp-core/std", | ||
"sp-io/std", | ||
"sp-runtime/std", | ||
"sp-session/std", | ||
"sp-staking/std", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add "sp-weights/std"
here
VariantCount, VariantCountOf, | ||
Contains, Currency, Defensive, DefensiveSaturating, EitherOf, | ||
EstimateNextSessionRotation, Everything, InsideBoth, InstanceFilter, IsSubType, | ||
KeyOwnerProofSystem, MapSuccess, NoOpPoll, OnFinalize, OnRuntimeUpgrade, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OnFinalize
here creates ambiguous imports in pallet staking-async
, so it's better to avoid it
Description
This PR migrates
pallet-grandpa
to use thepolkadot-sdk-frame
(FRAME umbrella crate), as tracked in #6504. All direct imports fromframe_support
,sp_runtime
, and similar crates have been replaced with imports from the umbrella crate, using the appropriate prelude or domain-specific modules. Where necessary, missing items have been re-exported from the umbrella crate to ensure all functionality is available exclusively viaframe
.Resolves pallet-grandpa in issue #6504
Integration
pallet-grandpa
via theframe
crate and its preludes.frame_support
,sp_runtime
, or other underlying crates should remain in the pallet.Review Notes
pallet-grandpa
now useframe
(umbrella crate) and its preludes.pallet-grandpa
have been added to the appropriate prelude or re-exported inframe
.frame
crate for imports.Checklist
T
required).Thank you for your review!