Skip to content

Conversation

@UtkarshBhardwaj007
Copy link
Member

@UtkarshBhardwaj007 UtkarshBhardwaj007 commented Feb 16, 2025

Description

Review Notes

  • Added a new extrinsic reconsider in pallet-indices.
  • Added a new event DepositReconsidered to be emitted upon a successful call of the extrinsic.
  • Although the immediate use of the extrinsic will be to give back some of the deposit after the AH-migration, the extrinsic is written such that it can work if the deposit decreases or increases (both).
  • The call to the extrinsic would be free if an actual adjustment is made to the deposit and paid otherwise.
  • Added tests to test all scenarios.
  • Added a benchmark to test the "worst case" (maximum compute) flow of the extrinsic which is when the deposit amount is updated to a new value.

TO-DOs

  • Run CI cmd bot to benchmark

@UtkarshBhardwaj007 UtkarshBhardwaj007 requested a review from a team as a code owner February 16, 2025 23:47
@UtkarshBhardwaj007 UtkarshBhardwaj007 added T1-FRAME This PR/Issue is related to core FRAME, the framework. T2-pallets This PR/Issue is related to a particular pallet. labels Feb 16, 2025
@kianenigma kianenigma changed the title Poke deposits [AHM] Poke deposits: Indices pallet Feb 17, 2025
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.

Mainly unsure about Permanent, otherwise looks good.

@UtkarshBhardwaj007
Copy link
Member Author

UtkarshBhardwaj007 commented Feb 17, 2025

Mainly unsure about Permanent, otherwise looks good.

From what I understand from the code, the freeze extrinsic slashes the deposit here before marking an index as permanent meaning there is no deposit left to reconsider. @kianenigma

@github-actions github-actions bot deleted a comment from UtkarshBhardwaj007 Feb 17, 2025
@github-actions github-actions bot deleted a comment from UtkarshBhardwaj007 Feb 17, 2025
@github-actions github-actions bot deleted a comment from UtkarshBhardwaj007 Feb 17, 2025
@github-actions github-actions bot deleted a comment from UtkarshBhardwaj007 Feb 17, 2025
@paritytech paritytech deleted a comment from github-actions bot Feb 17, 2025
@paritytech paritytech deleted a comment from github-actions bot Feb 17, 2025
@github-actions github-actions bot deleted a comment from UtkarshBhardwaj007 Feb 18, 2025
@github-actions github-actions bot deleted a comment from UtkarshBhardwaj007 Feb 18, 2025
@github-actions github-actions bot deleted a comment from UtkarshBhardwaj007 Feb 18, 2025
Copy link
Member

@ggwpez ggwpez left a comment

Choose a reason for hiding this comment

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

LGTM

@paritytech paritytech deleted a comment from github-actions bot Feb 19, 2025
@paritytech paritytech deleted a comment from github-actions bot Feb 19, 2025
@UtkarshBhardwaj007
Copy link
Member Author

/cmd fmt

@UtkarshBhardwaj007
Copy link
Member Author

/cmd fmt

@UtkarshBhardwaj007
Copy link
Member Author

/cmd bench --pallet pallet_indices

@github-actions
Copy link
Contributor

Command "bench --pallet pallet_indices" has started 🚀 See logs here

@github-actions
Copy link
Contributor

Command "bench --pallet pallet_indices" has finished ✅ See logs here

Subweight results:
File Extrinsic Old New Change [%]
cumulus/pallets/collator-selection/src/weights.rs leave_intent - - ERROR
cumulus/pallets/collator-selection/src/weights.rs new_session - - ERROR
cumulus/pallets/collator-selection/src/weights.rs register_as_candidate - - ERROR
cumulus/pallets/collator-selection/src/weights.rs set_invulnerables - - ERROR
cumulus/pallets/collator-selection/src/weights.rs take_candidate_slot - - ERROR
cumulus/pallets/collator-selection/src/weights.rs update_bond - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_preimage.rs ensure_updated - - ERROR
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
polkadot/runtime/westend/src/weights/pallet_preimage.rs ensure_updated - - ERROR
substrate/frame/election-provider-support/src/weights.rs phragmen - - ERROR
substrate/frame/election-provider-support/src/weights.rs phragmms - - ERROR
substrate/frame/utility/src/weights.rs dispatch_as_fallible - - ERROR
substrate/frame/indices/src/weights.rs free 153.54us 145.37us -5.32
substrate/frame/indices/src/weights.rs poke_deposit 145.46us Added
polkadot/runtime/westend/src/weights/pallet_indices.rs poke_deposit 153.18us Added
polkadot/runtime/rococo/src/weights/pallet_indices.rs poke_deposit 149.23us Added
Command output:

✅ Successful benchmarks of runtimes/pallets:
-- dev: ['pallet_indices']
-- westend: ['pallet_indices']
-- rococo: ['pallet_indices']

Copy link
Contributor

@re-gius re-gius left a comment

Choose a reason for hiding this comment

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

LGTM

@UtkarshBhardwaj007 UtkarshBhardwaj007 added this pull request to the merge queue Feb 20, 2025
Merged via the queue into paritytech:master with commit b9b73eb Feb 20, 2025
248 of 255 checks passed
@UtkarshBhardwaj007 UtkarshBhardwaj007 deleted the poke-deposits branch February 20, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T1-FRAME This PR/Issue is related to core FRAME, the framework. T2-pallets This PR/Issue is related to a particular pallet.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants