Skip to content

add poke_deposit extrinsic to pallet-bounties #8382

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

UtkarshBhardwaj007
Copy link
Contributor

@UtkarshBhardwaj007 UtkarshBhardwaj007 commented Apr 30, 2025

Description

  • This PR adds a new extrinsic poke_deposit to pallet-bounties. This extrinsic will be used to re-adjust the deposits made in the pallet to create a new bounty.
  • Part of Re-consideration poke for Deposits  #5591

Review Notes

  • Added a new extrinsic poke_deposit in pallet-bounties.
  • This extrinsic checks and adjusts the deposits made for creating a bounty.
  • Added a new event DepositPoked 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 (when no deposit is changed).
  • Added tests to test all scenarios.
  • Added benchmarks

TO-DOs

  • Run CI cmd bot to benchmark

@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 Apr 30, 2025
@UtkarshBhardwaj007 UtkarshBhardwaj007 requested a review from a team as a code owner April 30, 2025 11:05
@UtkarshBhardwaj007
Copy link
Contributor Author

/cmd fmt

@UtkarshBhardwaj007
Copy link
Contributor Author

/cmd prdoc

@UtkarshBhardwaj007
Copy link
Contributor Author

/cmd bench --pallet pallet_bounties

Copy link
Contributor

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

Copy link
Contributor

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

Subweight results:
File Extrinsic Old New Change [%]
substrate/frame/bounties/src/weights.rs poke_deposit 309.04us Added
polkadot/runtime/rococo/src/weights/pallet_bounties.rs poke_deposit 314.57us Added
Command output:

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

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.

Tests can likely be simplified, but otherwise looks good to me!

@UtkarshBhardwaj007
Copy link
Contributor Author

/cmd fmt

@UtkarshBhardwaj007 UtkarshBhardwaj007 moved this to In review in AHM May 11, 2025
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
Status: In review
Development

Successfully merging this pull request may close these issues.

2 participants