polkadot-sdk icon indicating copy to clipboard operation
polkadot-sdk copied to clipboard

[Deprecation] remove `pallet::getter` usage from all pallets

Open muraca opened this issue 1 year ago • 4 comments

This issue tracks the removal of pallet::getter in all pallets, as per #223. The preferred syntax is Key::<T>::get(). This approach avoids a huge PR and lots of merge conflicts, a mistake I already made when I tried to perform this task last year.

As these PRs introduce breaking changes, a prdoc file is required. An example is this one I wrote for #3371 I suggest to use the prdoc cli tool.

Bridges:

  • [ ] pallet-bridge-grandpa
  • [ ] pallet-bridge-messages
  • [ ] pallet-bridge-relayers
  • [ ] pallet-xcm-bridge-hub-router
  • [ ] snowbridge-pallet-ethereum-client
  • [ ] snowbridge-pallet-inbound-queue
  • [ ] snowbridge-pallet-outbound-queue
  • [ ] snowbridge-pallet-system

Cumulus:

  • [x] cumulus-pallet-aura-ext #3471
  • [x] pallet-collator-selection #3471
  • [x] cumulus-pallet-parachain-system #3471
  • [x] pallet-parachain-template #3371
  • [x] staging-parachain-info #3471

Polkadot:

  • [x] polkadot-runtime-common #3660
  • [x] polkadot-runtime-parachains #3660
  • [ ] pallet-xcm
  • [ ] xcm-simulator-example
  • [ ] xcm-simulator-fuzzer

FRAME:

  • [x] pallet-template #3371
  • [x] pallet-alliance #3738
  • [x] pallet-aura #3350
  • [x] pallet-authority-discovery #4091
  • [ ] pallet-babe
  • [ ] pallet-balances
  • [x] pallet-beefy #3740
  • [x] pallet-beefy-mmr #3740
  • [x] pallet-bounties #4392
  • [x] pallet-child-bounties #4392
  • [x] pallet-collective #3456
  • [x] pallet-contracts-mock-network #4417
  • [x] pallet-democracy#4472
  • [ ] pallet-election-provider-multi-phase #4487
  • [ ] pallet-elections-phragmen
  • [x] pallet-example-basic #3371
  • [x] pallet-example-kitchensink #3371
  • [x] pallet-example-offchain-worker #3371
  • [ ] pallet-fast-unstake
  • [ ] pallet-grandpa
  • [ ] pallet-identity
  • [x] pallet-im-online #3589
  • [ ] pallet-insecure-randomness-collective-flip
  • [ ] pallet-membership
  • [x] pallet-mmr #3740
  • [ ] pallet-nft-fractionalization
  • [ ] pallet-node-authorization
  • [ ] pallet-offences
  • [ ] pallet-proxy
  • [ ] pallet-recovery
  • [ ] pallet-sassafras
  • [ ] pallet-scored-pool
  • [ ] pallet-session
  • [ ] pallet-staking
  • [ ] pallet-state-trie-migration
  • [x] pallet-sudo #3370
  • [ ] frame-support
  • [ ] frame-system
  • [ ] pallet-timestamp #3374
  • [ ] pallet-tips
  • [ ] pallet-transaction-payment
  • [ ] pallet-transaction-storage
  • [ ] pallet-treasury
  • [ ] pallet-vesting
  • [ ] substrate-test-runtime

cc @kianenigma @shawntabrizi

muraca avatar Feb 14 '24 14:02 muraca

I want to work on pallet-aura

k-gunjan avatar Feb 15 '24 06:02 k-gunjan

@muraca Did we come to consensus on what to do about storage values that lose visibility due to being pub(super), etc? Are we standing behind value::<T, I>::get() usage so staunchly that we should just mark them pub? Or should we implement getters such that they remain read-only?

PolkadotDom avatar May 08 '24 14:05 PolkadotDom

In the past PRs I have done I have marked all the storage items as pub, however take my words with a grain of salt as I'm just a mere open source contributor, I don't want any responsibility on this 😄

muraca avatar May 08 '24 14:05 muraca

Hahah sounds good! I'm going to try the 'implement a replacement getter' approach and we'll see if I get yelled at. I feel data authority is important enough for this to be the route.

PolkadotDom avatar May 08 '24 14:05 PolkadotDom

I want to work on Pallet-tips

Aideepakchaudhary avatar Jun 24 '24 07:06 Aideepakchaudhary

I want to work on Pallet-tips

Go for it! And to catch you up, basically all storage values are to be changed to pub (from pub(super) lets say) and all removed getters are to be reimplemented explicitly such that the public API remains the same. This is according to #223 and an example PR is #4840

In addition - we've been converting syntax over to turbo fish as well

PolkadotDom avatar Jun 28 '24 22:06 PolkadotDom

I'm taking on pallet-offences

Zebedeusz avatar Oct 10 '24 12:10 Zebedeusz

I'm starting to work on pallet-staking

Zebedeusz avatar Oct 18 '24 07:10 Zebedeusz