Skip to content

add poke_deposit extrinsic to pallet-bounties#8382

Merged
UtkarshBhardwaj007 merged 11 commits intoparitytech:masterfrom
UtkarshBhardwaj007:poke-bounties
May 26, 2025
Merged

add poke_deposit extrinsic to pallet-bounties#8382
UtkarshBhardwaj007 merged 11 commits intoparitytech:masterfrom
UtkarshBhardwaj007:poke-bounties

Conversation

@UtkarshBhardwaj007
Copy link
Copy Markdown
Member

@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
Copy Markdown
Member Author

/cmd fmt

@UtkarshBhardwaj007
Copy link
Copy Markdown
Member Author

/cmd prdoc

@UtkarshBhardwaj007
Copy link
Copy Markdown
Member Author

/cmd bench --pallet pallet_bounties

@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
Contributor

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

Details

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']

@UtkarshBhardwaj007
Copy link
Copy Markdown
Member Author

/cmd fmt

@UtkarshBhardwaj007 UtkarshBhardwaj007 moved this to In review in Plaza: AHM May 11, 2025
Copy link
Copy Markdown
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.

% the math

Copy link
Copy Markdown
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, just a couple of notes:

  • safe math for computing deposits
  • make testing code shorter

You can address my comments and resolve the comments before merging.

assert_eq!(pallet_bounties::BountyDescriptions::<Test>::get(0).unwrap(), description);
assert_eq!(pallet_bounties::BountyCount::<Test>::get(), 1);

// Change status to approved
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it's better to put all the status checks here in a for loop - it's more compact

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not sure I understand. What are we looping on?

@UtkarshBhardwaj007
Copy link
Copy Markdown
Member Author

/cmd fmt

@UtkarshBhardwaj007 UtkarshBhardwaj007 added this pull request to the merge queue May 26, 2025
Merged via the queue into paritytech:master with commit 7b224d3 May 26, 2025
182 checks passed
@UtkarshBhardwaj007 UtkarshBhardwaj007 deleted the poke-bounties branch May 26, 2025 19:50
@github-project-automation github-project-automation bot moved this from In review to Done in Plaza: AHM May 26, 2025
ordian added a commit that referenced this pull request May 27, 2025
* master: (99 commits)
  Snowbridge: Remove asset location check for compatibility (#8473)
  add poke_deposit extrinsic to pallet-bounties (#8382)
  litep2p/peerset: Reject non-reserved peers in the reserved-only mode (#8650)
  Charge deposit based on key length (#8648)
  [pallet-revive] make subscription task panic on error (#8587)
  tx/metrics: Add metrics for the RPC v2 `transactionWatch_v1_submitAndWatch` (#8345)
  Bridges: Fix - Improve try-state for pallet-xcm-bridge-hub (#8615)
  Introduce CreateBare, deprecated CreateInherent (#7597)
  Use hashbrown hashmap/hashset in validation context (#8606)
  ci: rm gitlab config (#8622)
  🔪 flaky and Zombienet tests (#8600)
  cumulus: adjust unincluded segment size metric buckets (#8617)
  Benchmark storage access on block validation (#8069)
  Revert 7934 es/remove tj changes (#8611)
  collator-protocol: add more collation observability (#8230)
  `fatxpool`: add fallback for ready at light (#8533)
  txpool: fix tx removal from unlocks set (#8500)
  XCMP weight metering: account for the MQ page position (#8344)
  fix epmb solution duplicate issue + add remote mining apparatus to epm (#8585)
  Fix generated address returned by Substrate RPC runtime call (#8504)
  ...
pgherveou pushed a commit that referenced this pull request Jun 11, 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 #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
* [x] Run CI cmd bot to benchmark

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
fellowship-merge-bot bot pushed a commit to polkadot-fellows/runtimes that referenced this pull request Aug 7, 2025
This brings in `stable2506` Polkadot SDK, and integrates many new
features.

Integrated breaking changes to be verified by the original authors:

- [x] ~paritytech/polkadot-sdk#8127 @kianenigma
@Ank4n~
     This will come in with AHM, and not before.
- [x] paritytech/polkadot-sdk#7597 @gui1117 
- [x] paritytech/polkadot-sdk#8254 @bkchr 
- [x] paritytech/polkadot-sdk#7592 @bkontur 
- [x] paritytech/polkadot-sdk#8382
@UtkarshBhardwaj007
- [x] paritytech/polkadot-sdk#8021 @serban300 
- [x] paritytech/polkadot-sdk#8344 @serban300 
- [x] paritytech/polkadot-sdk#8262 @athei 
- [x] paritytech/polkadot-sdk#8584 @athei 
- [x] paritytech/polkadot-sdk#8299 @skunert
- [x] paritytech/polkadot-sdk#8652 @pgherveou 
- [x] paritytech/polkadot-sdk#8554 @pgherveou 
- [x] paritytech/polkadot-sdk#8281 @mrshiposha 
- [x] paritytech/polkadot-sdk#7730
@franciscoaguirre
- [x] paritytech/polkadot-sdk#8599 @yrong
@claravanstaden
- [x] paritytech/polkadot-sdk#8531 @bkontur 
- [x] paritytech/polkadot-sdk#8409 @kianenigma 
- [x] paritytech/polkadot-sdk#9137
@franciscoaguirre
- [x] paritytech/polkadot-sdk#7944 @bkontur 
- [x] paritytech/polkadot-sdk#8179 @bkontur 
- [x] paritytech/polkadot-sdk#8037 @yrong

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: claravanstaden <claravanstaden64@gmail.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Alain Brenzikofer <alain@integritee.network>
Co-authored-by: kianenigma <kian@parity.io>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: ron <yrong1997@gmail.com>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Overkillus <maciej.zyszkiewicz@parity.io>
alvicsam pushed a commit that referenced this pull request Oct 17, 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 #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
* [x] Run CI cmd bot to benchmark

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants