Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add child-bounties pallet. #10309

Merged
merged 49 commits into from
Dec 7, 2021
Merged

Add child-bounties pallet. #10309

merged 49 commits into from
Dec 7, 2021

Conversation

gautamdhameja
Copy link
Contributor

@gautamdhameja gautamdhameja commented Nov 18, 2021

This PR is a work in continuation of an earlier PR #7965 which introduced the sub-bounties logic. As per the feedback, that logic is now extracted into a new pallet as per the following proposal:

  • Extract the sub-bounties logic in a separate pallet. Call it child-bounties pallet to avoid confusion (sub prefix is being used for substrate in some communications).
  • In the bounties pallet, add a trait and config type for child-bounty manager. This trait will have the linking logic for checking child-bounties before closing a parent bounty - child-bounties count and child curator fee.
  • Add a public getter for bounty status to access it in the child-bounties pallet.
  • Remove duplicate code.
  • In the runtime, we can assign the child-bounty pallet as the ChildBountyManager for bounties pallet, or just () when not using child bounties. This has been included in the Substrate node runtime.

Screenshot 2021-11-18 at 18 27 45

polkadot companion: paritytech/polkadot#4341

skip check-dependent-cumulus

@github-actions github-actions bot added the A0-please_review Pull request needs code review. label Nov 18, 2021
@gautamdhameja gautamdhameja changed the title Added child-bounties pallet. Add child-bounties pallet. Nov 18, 2021
frame/bounties/src/lib.rs Outdated Show resolved Hide resolved
@gautamdhameja gautamdhameja added C1-low PR touches the given topic and has a low impact on builders. D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited labels Nov 19, 2021
@viniul viniul added D1-audited 👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited and removed D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited labels Dec 7, 2021
@gautamdhameja
Copy link
Contributor Author

bot merge

@paritytech-processbot
Copy link

Error:
Error: When trying to meet the "Project Owners" approval requirements: this pull request does not belong to a project defined in Process.json.

Approval by "Project Owners" is only attempted if other means defined in the criteria for merge are not satisfied first.

The following errors might have affected the outcome of this attempt:

  • 'Batch: Availability and Validity' does not match any projects in polkadot's Process.json
  • 'Batch: Codebase Restructure' does not match any projects in polkadot's Process.json

Merge failed. Check out the criteria for merge. If you're not meeting the approval count, check if the approvers are members of substrateteamleads or core-devs.

@gautamdhameja
Copy link
Contributor Author

bot merge

@paritytech-processbot
Copy link

Error: It's not possible to meet the minimal approval count of 1 in paritytech/polkadot#4341

@shawntabrizi
Copy link
Member

bot merge

@paritytech-processbot
Copy link

Error: Github API says paritytech/polkadot#4341 is not mergeable

@shawntabrizi
Copy link
Member

bot merge

@paritytech-processbot
Copy link

Error: It's not possible to meet the minimal approval count of 1 in paritytech/polkadot#4341

@shawntabrizi shawntabrizi merged commit 4abd91c into master Dec 7, 2021
@shawntabrizi shawntabrizi deleted the gd-child-bounties branch December 7, 2021 22:40
seunlanlege pushed a commit to seunlanlege/substrate that referenced this pull request Dec 17, 2021
* Extract child-bounties as a separate pallet.

* Initial tests added.

* More tests.

* Tests complete. Fixed curator fee issue.

* Fixed comments.

* Added benchmarks for child-bounties pallet.

* Added weights.

* Fixed formatting.

* Fixed comments.

* Re-run benchmarks for bounties pallet.

* Make cargo fmt happy again

* add max encoded len

* use event structs

* fmt

* fix compile

* Addressed review comments.

* Use config type instead of const in benchmarking.

* Addressed more review comments.

* Use ensure_can_withdraw instead of just checking min balance.

* fmt.

* Introduce ChildBountyCuratorDepositBase to avoid zero curator deposits for child bounties.

* Fix unassign curator logic for child-bounties.

* Added more tests for unassign curator.

* Reduce bounty description max length in node runtime.

* Updated weights for child bounties pallet.

* reduce indentation of unassign_curator

* more indentation reduction

* deduplicate slashing arms

* reintroduce ensure check

* add assertion to check that bad unassign origin fails

* formatting

* Updated comments.

Co-authored-by: Ricardo Rius <ricardo@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
grishasobol pushed a commit to gear-tech/substrate that referenced this pull request Mar 28, 2022
* Extract child-bounties as a separate pallet.

* Initial tests added.

* More tests.

* Tests complete. Fixed curator fee issue.

* Fixed comments.

* Added benchmarks for child-bounties pallet.

* Added weights.

* Fixed formatting.

* Fixed comments.

* Re-run benchmarks for bounties pallet.

* Make cargo fmt happy again

* add max encoded len

* use event structs

* fmt

* fix compile

* Addressed review comments.

* Use config type instead of const in benchmarking.

* Addressed more review comments.

* Use ensure_can_withdraw instead of just checking min balance.

* fmt.

* Introduce ChildBountyCuratorDepositBase to avoid zero curator deposits for child bounties.

* Fix unassign curator logic for child-bounties.

* Added more tests for unassign curator.

* Reduce bounty description max length in node runtime.

* Updated weights for child bounties pallet.

* reduce indentation of unassign_curator

* more indentation reduction

* deduplicate slashing arms

* reintroduce ensure check

* add assertion to check that bad unassign origin fails

* formatting

* Updated comments.

Co-authored-by: Ricardo Rius <ricardo@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
AurevoirXavier added a commit to darwinia-network/darwinia-common that referenced this pull request Sep 21, 2022
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* Extract child-bounties as a separate pallet.

* Initial tests added.

* More tests.

* Tests complete. Fixed curator fee issue.

* Fixed comments.

* Added benchmarks for child-bounties pallet.

* Added weights.

* Fixed formatting.

* Fixed comments.

* Re-run benchmarks for bounties pallet.

* Make cargo fmt happy again

* add max encoded len

* use event structs

* fmt

* fix compile

* Addressed review comments.

* Use config type instead of const in benchmarking.

* Addressed more review comments.

* Use ensure_can_withdraw instead of just checking min balance.

* fmt.

* Introduce ChildBountyCuratorDepositBase to avoid zero curator deposits for child bounties.

* Fix unassign curator logic for child-bounties.

* Added more tests for unassign curator.

* Reduce bounty description max length in node runtime.

* Updated weights for child bounties pallet.

* reduce indentation of unassign_curator

* more indentation reduction

* deduplicate slashing arms

* reintroduce ensure check

* add assertion to check that bad unassign origin fails

* formatting

* Updated comments.

Co-authored-by: Ricardo Rius <ricardo@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C1-low PR touches the given topic and has a low impact on builders. D1-audited 👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants