-
Notifications
You must be signed in to change notification settings - Fork 665
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
Pallet AURA: remove pallet::getter macro and write the corresponding code #3350
Pallet AURA: remove pallet::getter macro and write the corresponding code #3350
Conversation
substrate/frame/aura/src/lib.rs
Outdated
/// | ||
/// This function will be deprecated in future releases. It is recommended not to use it in new | ||
/// developments. | ||
pub fn authorities() -> BoundedVec<T::AuthorityId, T::MaxAuthorities> { |
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.
where are these functions used? do they even need to exist?
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.
Thank you for your review and the points raised. I appreciate the opportunity to clarify the usage and implications of the proposed changes.
I've noted that the this function is utilized not only within this pallet like here but also across other crates within the SDK like here. This widespread use underscores its current necessity and potential impact on existing implementations.
In my understanding, the primary aim of this PR is to streamline the codebase by removing unnecessary macro complexity, thereby improving readability and maintainability without altering the existing functionality or interfaces. Given this scope, maintaining these function calls as-is ensures compatibility and stability across the SDK during this transitional phase. Please suggest .
If recommended I can go ahead and replace the uses here with Authorities::<T>::get()
in a future iteration.
Let me know if you recommend proceeding with these adjustments now, or if we should consider them as part of a subsequent phase of optimization.
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.
If recommended I can go ahead and replace the uses here with Authorities::::get() in a future iteration.
In my opinion we should do this. No need for another function.
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.
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.
@k-gunjan I think Oliver meant that you should not introduce these new methods in this PR.
Instead, you should go around the other crates that call the getter functions you removed, and replace them with pallet_aura::Authorities::<T>::get()
.
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.
Thanks Muraca ! I'll remove definition from here and replace uses in other pallets.
substrate/frame/aura/src/lib.rs
Outdated
/// | ||
/// This function will be deprecated in future releases. It is recommended not to use it in new | ||
/// developments. | ||
pub fn authorities() -> BoundedVec<T::AuthorityId, T::MaxAuthorities> { |
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.
@k-gunjan I think Oliver meant that you should not introduce these new methods in this PR.
Instead, you should go around the other crates that call the getter functions you removed, and replace them with pallet_aura::Authorities::<T>::get()
.
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.
LGTM! 👍
005d91f
to
05ab1ae
Compare
9c1a94c
to
9b59665
Compare
As a breaking change, this requires the removal of the R0 label and a prdoc |
816c072
…code (paritytech#3350) Removed the `pallet::getter` macro call from storage type definitions and added the corresponding implementations directly. fixes paritytech#3330 polkadot address: 14JzTPPUd8x8phKi8qLxHgNTnTMg6DUukCLXoWprejkaHXPz --------- Co-authored-by: Bastian Köcher <git@kchr.de>
tip? |
- Update weights to reflect the new version. Notable Changes: - [System Callbacks](paritytech/polkadot-sdk#1781) - [Remove experimental flag](https://github.com/paritytech/polkadot-sdk/pull/3654/files) - [Remove pallet::getter macr](paritytech/polkadot-sdk#3350) - [Refactor APIs](https://github.com/paritytech/polkadot-sdk/pull/3817/files#diff-b02373af4015a8ebdf3a3f5be9ea0ce555b6e45331872e0465fd2f488177d383) For more details, please refer to: [Release Notes](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.10.0) issue-1922
- Update weights to reflect the new version. Notable Changes: - [Remove experimental flag](https://github.com/paritytech/polkadot-sdk/pull/3654/files) - [Remove pallet::getter macr](paritytech/polkadot-sdk#3350) - [Refactor APIs](https://github.com/paritytech/polkadot-sdk/pull/3817/files#diff-b02373af4015a8ebdf3a3f5be9ea0ce555b6e45331872e0465fd2f488177d383) For more details, please refer to: [Release Notes](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.10.0) issue-1922
- Update weights to reflect the new version. Notable Changes: - [Remove experimental flag](https://github.com/paritytech/polkadot-sdk/pull/3654/files) - [Remove pallet::getter macr](paritytech/polkadot-sdk#3350) - [Refactor APIs](https://github.com/paritytech/polkadot-sdk/pull/3817/files#diff-b02373af4015a8ebdf3a3f5be9ea0ce555b6e45331872e0465fd2f488177d383) For more details, please refer to: [Release Notes](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.10.0) issue-1928
- Update weights to reflect the new version. Notable Changes: - [Remove experimental flag](https://github.com/paritytech/polkadot-sdk/pull/3654/files) - [Remove pallet::getter macr](paritytech/polkadot-sdk#3350) - [Refactor APIs](https://github.com/paritytech/polkadot-sdk/pull/3817/files#diff-b02373af4015a8ebdf3a3f5be9ea0ce555b6e45331872e0465fd2f488177d383) For more details, please refer to: [Release Notes](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.10.0) issue-1928
- Upgrade Polkadot-sdk to v.1.10.0. - Update weights to reflect the new version. Notable Changes: - [Remove experimental flag](https://github.com/paritytech/polkadot-sdk/pull/3654/files) - [Remove pallet::getter macr](paritytech/polkadot-sdk#3350) - [Refactor APIs](https://github.com/paritytech/polkadot-sdk/pull/3817/files#diff-b02373af4015a8ebdf3a3f5be9ea0ce555b6e45331872e0465fd2f488177d383) For more details, please refer to: [Release Notes](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.10.0) issue-1928
- Upgrade Polkadot-sdk to v.1.10.0. - Update weights to reflect the new version. Notable Changes: - [Remove experimental flag](https://github.com/paritytech/polkadot-sdk/pull/3654/files) - [Remove pallet::getter macr](paritytech/polkadot-sdk#3350) - [Refactor APIs](https://github.com/paritytech/polkadot-sdk/pull/3817/files#diff-b02373af4015a8ebdf3a3f5be9ea0ce555b6e45331872e0465fd2f488177d383) For more details, please refer to: [Release Notes](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.10.0) issue-1928
- Upgrade Polkadot-sdk to v.1.10.0. - Update weights to reflect the new version. Notable Changes: - [Remove experimental flag](https://github.com/paritytech/polkadot-sdk/pull/3654/files) - [Remove pallet::getter macr](paritytech/polkadot-sdk#3350) - [Refactor APIs](https://github.com/paritytech/polkadot-sdk/pull/3817/files#diff-b02373af4015a8ebdf3a3f5be9ea0ce555b6e45331872e0465fd2f488177d383) For more details, please refer to: [Release Notes](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.10.0) issue-1928
- Upgrade Polkadot-sdk to v.1.10.0. - Update weights to reflect the new version. Notable Changes: - [Remove experimental flag](https://github.com/paritytech/polkadot-sdk/pull/3654/files) - [Remove pallet::getter macr](paritytech/polkadot-sdk#3350) - [Refactor APIs](https://github.com/paritytech/polkadot-sdk/pull/3817/files#diff-b02373af4015a8ebdf3a3f5be9ea0ce555b6e45331872e0465fd2f488177d383) For more details, please refer to: [Release Notes](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.10.0) issue-1928
- Upgrade Polkadot-sdk to v.1.10.0. - Update weights to reflect the new version. Notable Changes: - [Remove experimental flag](https://github.com/paritytech/polkadot-sdk/pull/3654/files) - [Remove pallet::getter macr](paritytech/polkadot-sdk#3350) - [Refactor APIs](https://github.com/paritytech/polkadot-sdk/pull/3817/files#diff-b02373af4015a8ebdf3a3f5be9ea0ce555b6e45331872e0465fd2f488177d383) For more details, please refer to: [Release Notes](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.10.0) issue-1928
- Upgrade Polkadot-sdk 1.9.0 to 1.10.0 - Update weights to reflect the new version. Notable Changes: - [Remove experimental flag](https://github.com/paritytech/polkadot-sdk/pull/3654/files) - [Remove pallet::getter macro](paritytech/polkadot-sdk#3350) - [Refactor APIs](https://github.com/paritytech/polkadot-sdk/pull/3817/files#diff-b02373af4015a8ebdf3a3f5be9ea0ce555b6e45331872e0465fd2f488177d383) - [Refactor Unified Host Functions](paritytech/polkadot-sdk#3854) - [StorageWeightReclaim SignedExtension](https://github.com/paritytech/polkadot-sdk/pull/3002/files) For more details, please refer to: [Release Notes](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.10.0)
- Upgrade Polkadot-sdk 1.9.0 to 1.10.0 - Update weights to reflect the new version. Notable Changes: - [Remove experimental flag](https://github.com/paritytech/polkadot-sdk/pull/3654/files) - [Remove pallet::getter macro](paritytech/polkadot-sdk#3350) - [Refactor APIs](https://github.com/paritytech/polkadot-sdk/pull/3817/files#diff-b02373af4015a8ebdf3a3f5be9ea0ce555b6e45331872e0465fd2f488177d383) - [Refactor Unified Host Functions](paritytech/polkadot-sdk#3854) - [StorageWeightReclaim SignedExtension](https://github.com/paritytech/polkadot-sdk/pull/3002/files) For more details, please refer to: [Release Notes](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.10.0) #1928 --------- Co-authored-by: enddynayn <enddynayn@users.noreply.github.com>
- Upgrade Polkadot-sdk 1.9.0 to 1.10.0 - Update weights to reflect the new version. Notable Changes: - [Remove experimental flag](https://github.com/paritytech/polkadot-sdk/pull/3654/files) - [Remove pallet::getter macro](paritytech/polkadot-sdk#3350) - [Refactor APIs](https://github.com/paritytech/polkadot-sdk/pull/3817/files#diff-b02373af4015a8ebdf3a3f5be9ea0ce555b6e45331872e0465fd2f488177d383) - [Refactor Unified Host Functions](paritytech/polkadot-sdk#3854) - [StorageWeightReclaim SignedExtension](https://github.com/paritytech/polkadot-sdk/pull/3002/files) For more details, please refer to: [Release Notes](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.10.0) #1928 --------- Co-authored-by: enddynayn <enddynayn@users.noreply.github.com>
Removed the
pallet::getter
macro call from storage type definitions and added the corresponding implementations directly.fixes #3330
polkadot address: 14JzTPPUd8x8phKi8qLxHgNTnTMg6DUukCLXoWprejkaHXPz