This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Issue 7143 | Refactor Treasury Pallet into Bounties, Tips, and Proposals #7536
Merged
97 commits merged into
paritytech:master
from
shamb0:issue-7143-pallet-treasury-refactor
Dec 16, 2020
Merged
Changes from 1 commit
Commits
Show all changes
97 commits
Select commit
Hold shift + click to select a range
d3dc12d
wk2046 | D5 | treasury refactor to bounties and tips
shamb0 70472aa
wk2046 | D5 | treasury refactor to bounties and tips | p2
shamb0 a861aec
fix test compilation, ignoring events
shawntabrizi 8718f33
initialize treasury in genesis
shawntabrizi 6b4dba5
wk2046 | D7 | treasury refactor | fix bounties test build issues
shamb0 6c01a91
wk2046 | D7 | treasury refactor | fix bounties test build issues | p2
shamb0 7bad294
wk2047 | D1 | treasury refactor | tips pallet bringup
shamb0 86d62ed
wk2047 | D2 | treasury refactor | bounties pallet | unit test bringup
shamb0 b6ba7f3
wk2047 | D2 | treasury refactor | bounties pallet | unit test bringu…
shamb0 f117afb
wk2047 | D2 | treasury refactor | pallet-tips| test_last_reward_migra…
shamb0 3993955
wk2047 | D3 | treasury refactor | pallet-tips| test_last_reward_migra…
shamb0 9ed2050
wk2047 | D3 | treasury refactor | pallet-bounties | on_initialize() fix
shamb0 90e2fc3
wk2047 | D3 | treasury refactor | pallet-bounties | on_initialize() f…
shamb0 508e35e
wk2047 | D4 | treasury refactor | pallet-bounties + pallet-treasury |…
shamb0 79ddceb
wk2047 | D4 | treasury refactor | pallet-bounties + pallet-treasury |…
shamb0 49eb073
wk2047 | D4 | treasury refactor | pallet-bounties + pallet-treasury |…
shamb0 30d2458
wk2047 | D5 | treasury refactor | pallet-bounties + pallet-treasury |…
shamb0 82d467b
wk2047 | D6 | treasury refactor | review comments fix
shamb0 3420f4f
some fixes
shawntabrizi 3695aaa
fix bounties instantiable
shawntabrizi 0f014c4
remove instantiable from tips and bounties
shawntabrizi 4581de9
fix compile for benchmarks
shawntabrizi a15b390
Merge remote-tracking branch 'origin/master' into shawntabrizi-treasu…
c7ee055
cargo run --release --features=runtime-benchmarks --manifest-path=bin…
da9418e
Update lib.rs
shawntabrizi 40ff8fa
Merge branch 'shawntabrizi-treasury-refactor-weights' of https://gith…
shawntabrizi dcaddeb
Merge remote-tracking branch 'origin/master' into shawntabrizi-treasu…
9524f69
cargo run --release --features=runtime-benchmarks --manifest-path=bin…
c0e3f34
cargo run --release --features=runtime-benchmarks --manifest-path=bin…
03e0eee
add back `on_initialize_bounties`
shawntabrizi b694ef3
patch up bounties benchmarks
shawntabrizi 8c955ac
cargo run --release --features=runtime-benchmarks --manifest-path=bin…
0473842
Remove development TODO from public doc comment (#7500)
c410-f3r d86a662
refactor subtrait/elevated trait as not needed (#7497)
gui1117 66d998c
Fix comments of indices pallet events (#7511)
alecalve e366227
Skip slot lenience on first block in BABE (#7515)
bkchr d35dee6
slots: incrementally backoff claiming slots if finality lags behind (…
octol 30753b4
Export app-crypto specific keystore functions (#7489)
sorpaas edf0b8f
Update doc for the --chain flag (#7520)
pepyakin 9af39e4
contracts: Add missing instruction to the `Schedule` (#7527)
athei 9c2f0e7
Don't log with colors when we are writing to a tty (#7525)
bkchr c9eaf2f
MemoryId -> u32 (#7534)
tomaka 1c12637
Enable local addresses in DHT when chain type == `Local` | `Developme…
bkchr 70ed34c
Update tiny-bip39 to v0.8 (#7539)
a2ad750
make LocalCallExecutor public (#7528)
insipx 2b81c88
Fix some weirdness in `offchain_worker` (#7541)
bkchr 8a99973
Use inbound peerslot slots when a substream is received, rather than …
tomaka e3f9ca8
*: Update to libp2p v0.30.0 (#7508)
mxinden 251ac5a
make ClientConfig public (#7544)
insipx 385476c
sc-basic-authorship: remove useless dependencies (#7550)
koushiro 272077c
Add slashing events to elections-phragmen. (#7543)
kianenigma b552b03
Remove necessity to pass ConsensusEngineId when registering notificat…
tomaka 353fe4e
sc-cli: replace bip39 with tiny-bip39 (#7551)
koushiro a4ff31e
Add extra docs to on_initialize (#7552)
tomusdrw c7ba4cf
More Extensible Multiaddress Format (#7380)
shawntabrizi 09759a0
Fix weight template to remove ugliness in rust doc (#7565)
athei 2b5ebd8
Cargo.lock: Run cargo update (#7553)
mxinden 6ca63ba
.github: Add dependabot config and thus enable dependabot (#7509)
mxinden 2be0efb
Thread-local parameter_types for testing. (#7542)
kianenigma 97ad351
Bump wasm-bindgen-test from 0.3.12 to 0.3.17 (#7567)
dependabot[bot] 6fe7112
Merge pull request #1 from paritytech/shawntabrizi-treasury-refactor-…
shamb0 ffcc899
Merge remote-tracking branch 'upstream/master' into issue-7143-pallet…
shamb0 2a01b6d
Merge branch 'issue-7143-pallet-treasury-refactor' of github.com:sham…
shamb0 b81a858
wk2047 | D6 | treasury refactor | review comments fix | p2
shamb0 18449c1
wk2048 | D1 | treasury refactor | review comments fix | p3
shamb0 a17a4fe
Merge branch 'master' into pr/7536
shawntabrizi 9578fec
Merge remote-tracking branch 'upstream/master' into issue-7143-pallet…
shamb0 716c155
Merge branch 'issue-7143-pallet-treasury-refactor' of github.com:sham…
shamb0 de84b90
Update bin/node/runtime/src/lib.rs
shamb0 7790282
Update bin/node/runtime/src/lib.rs
shamb0 f4efda9
wk2048 | D3 | treasury refactor | review comments fix | p4
shamb0 1bfd2de
wk2048 | D3 | treasury refactor | review comments fix | p5
shamb0 c11bbb0
wk2048 | D4 | treasury refactor | review comments fix | removal of d…
shamb0 2c3b1a7
remove broken link
shawntabrizi c93ad2e
wk2048 | D5 | treasury refactor | review comments fix | bountise doc …
shamb0 14c30ee
wk2048 | D5 | treasury refactor | review comments fix | p8
shamb0 7d5bd6e
docs and formatting
shawntabrizi 86e0f29
Update frame/tips/src/benchmarking.rs
wheresaddie bf95008
formatting nits
shawntabrizi e9ec8c7
Merge branch 'master' into pr/7536
shawntabrizi ccc776a
Trait -> Config
shawntabrizi 7be1c09
trait -> config in benchmarks
shawntabrizi 6732d73
clean up weight docs
shawntabrizi af97502
Trait -> Config in Runtime
shawntabrizi 2484ee0
Merge branch 'master' into pr/7536
shawntabrizi 003af63
Merge branch 'master' into pr/7536
shawntabrizi e718872
Merge branch 'master' into pr/7536
shawntabrizi 9101ab3
fix test build
shawntabrizi 19f708f
try to fix polkadot build check
shawntabrizi 4ea05e1
fix traits
shawntabrizi 1bc341c
Update lib.rs
shawntabrizi fe739f2
Apply suggestions from code review
shawntabrizi c324cda
Apply suggestions from code review
shawntabrizi 41aa951
fix trait location
shawntabrizi 23a903d
nits
shawntabrizi bc582fd
uncomment on_initialize for bounties benchmarks
shawntabrizi f1e6d46
update weights
shawntabrizi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
wk2048 | D3 | treasury refactor | review comments fix | p4
- Loading branch information
commit f4efda9ec0487d73e486a7e3d63500e1a0735972
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,118 +1,28 @@ | ||
| # Treasury Module | ||
| # Tipping Module ( pallet-tips ) | ||
|
|
||
| The Treasury module provides a "pot" of funds that can be managed by stakeholders in the | ||
| system and a structure for making spending proposals from this pot. | ||
| **Note :: This pallet is build on top of pallet-treasury** | ||
|
|
||
| - [`treasury::Trait`](https://docs.rs/pallet-treasury/latest/pallet_treasury/trait.Trait.html) | ||
| - [`Call`](https://docs.rs/pallet-treasury/latest/pallet_treasury/enum.Call.html) | ||
|
|
||
| ## Overview | ||
|
|
||
| The Treasury Module itself provides the pot to store funds, and a means for stakeholders to | ||
| propose, approve, and deny expenditures. The chain will need to provide a method (e.g. | ||
| inflation, fees) for collecting funds. | ||
|
|
||
| By way of example, the Council could vote to fund the Treasury with a portion of the block | ||
| reward and use the funds to pay developers. | ||
|
|
||
| ### Tipping | ||
|
|
||
| A separate subsystem exists to allow for an agile "tipping" process, whereby a reward may be | ||
| given without first having a pre-determined stakeholder group come to consensus on how much | ||
| should be paid. | ||
|
|
||
| A group of `Tippers` is determined through the config `Trait`. After half of these have declared | ||
| some amount that they believe a particular reported reason deserves, then a countdown period is | ||
| entered where any remaining members can declare their tip amounts also. After the close of the | ||
| countdown period, the median of all declared tips is paid to the reported beneficiary, along | ||
| with any finders fee, in case of a public (and bonded) original report. | ||
|
|
||
| ### Bounty | ||
|
|
||
| A Bounty Spending is a reward for a specified body of work - or specified set of objectives - that | ||
| needs to be executed for a predefined Treasury amount to be paid out. A curator is assigned after | ||
| the bounty is approved and funded by Council, to be delegated | ||
| with the responsibility of assigning a payout address once the specified set of objectives is completed. | ||
|
|
||
| After the Council has activated a bounty, it delegates the work that requires expertise to a curator | ||
| in exchange of a deposit. Once the curator accepts the bounty, they | ||
| get to close the Active bounty. Closing the Active bounty enacts a delayed payout to the payout | ||
| address, the curator fee and the return of the curator deposit. The | ||
| delay allows for intervention through regular democracy. The Council gets to unassign the curator, | ||
| resulting in a new curator election. The Council also gets to cancel | ||
| the bounty if deemed necessary before assigning a curator or once the bounty is active or payout | ||
| is pending, resulting in the slash of the curator's deposit. | ||
| A subsystem to allow for an agile "tipping" process, whereby a reward may be given without first having a pre-determined stakeholder group come to consensus on how much should be paid. | ||
|
|
||
| A group of `Tippers` is determined through the config `Trait`. After half of these have declared some amount that they believe a particular reported reason deserves, then a countdown period is entered where any remaining members can declare their tip amounts also. After the close of the countdown period, the median of all declared tips is paid to the reported beneficiary, along with any finders fee, in case of a public (and bonded) original report. | ||
|
|
||
| ### Terminology | ||
|
|
||
| - **Proposal:** A suggestion to allocate funds from the pot to a beneficiary. | ||
| - **Beneficiary:** An account who will receive the funds from a proposal iff | ||
| the proposal is approved. | ||
| - **Deposit:** Funds that a proposer must lock when making a proposal. The | ||
| deposit will be returned or slashed if the proposal is approved or rejected | ||
| respectively. | ||
| - **Pot:** Unspent funds accumulated by the treasury module. | ||
|
|
||
| Tipping protocol: | ||
| - **Tipping:** The process of gathering declarations of amounts to tip and taking the median | ||
| amount to be transferred from the treasury to a beneficiary account. | ||
| - **Tip Reason:** The reason for a tip; generally a URL which embodies or explains why a | ||
| particular individual (identified by an account ID) is worthy of a recognition by the | ||
| treasury. | ||
| - **Tipping:** The process of gathering declarations of amounts to tip and taking the median amount to be transferred from the treasury to a beneficiary account. | ||
| - **Tip Reason:** The reason for a tip; generally a URL which embodies or explains why a particular individual (identified by an account ID) is worthy of a recognition by the treasury. | ||
| - **Finder:** The original public reporter of some reason for tipping. | ||
| - **Finders Fee:** Some proportion of the tip amount that is paid to the reporter of the tip, | ||
| rather than the main beneficiary. | ||
|
|
||
| Bounty: | ||
| - **Bounty spending proposal:** A proposal to reward a predefined body of work upon completion by | ||
| the Treasury. | ||
| - **Proposer:** An account proposing a bounty spending. | ||
| - **Curator:** An account managing the bounty and assigning a payout address receiving the reward | ||
| for the completion of work. | ||
| - **Deposit:** The amount held on deposit for placing a bounty proposal plus the amount held on | ||
| deposit per byte within the bounty description. | ||
| - **Curator deposit:** The payment from a candidate willing to curate an approved bounty. The deposit | ||
| is returned when/if the bounty is completed. | ||
| - **Bounty value:** The total amount that should be paid to the Payout Address if the bounty is | ||
| rewarded. | ||
| - **Payout address:** The account to which the total or part of the bounty is assigned to. | ||
| - **Payout Delay:** The delay period for which a bounty beneficiary needs to wait before claiming. | ||
| - **Curator fee:** The reserved upfront payment for a curator for work related to the bounty. | ||
| - **Finders Fee:** Some proportion of the tip amount that is paid to the reporter of the tip, rather than the main beneficiary. | ||
|
|
||
| ## Interface | ||
|
|
||
| ### Dispatchable Functions | ||
|
|
||
| General spending/proposal protocol: | ||
| - `propose_spend` - Make a spending proposal and stake the required deposit. | ||
| - `set_pot` - Set the spendable balance of funds. | ||
| - `configure` - Configure the module's proposal requirements. | ||
| - `reject_proposal` - Reject a proposal, slashing the deposit. | ||
| - `approve_proposal` - Accept the proposal, returning the deposit. | ||
|
|
||
| Tipping protocol: | ||
| - `report_awesome` - Report something worthy of a tip and register for a finders fee. | ||
| - `retract_tip` - Retract a previous (finders fee registered) report. | ||
| - `tip_new` - Report an item worthy of a tip and declare a specific amount to tip. | ||
| - `tip` - Declare or redeclare an amount to tip for a particular reason. | ||
| - `close_tip` - Close and pay out a tip. | ||
|
|
||
| Bounty protocol: | ||
| - `propose_bounty` - Propose a specific treasury amount to be earmarked for a predefined set of | ||
| tasks and stake the required deposit. | ||
| - `approve_bounty` - Accept a specific treasury amount to be earmarked for a predefined body of work. | ||
| - `propose_curator` - Assign an account to a bounty as candidate curator. | ||
| - `accept_curator` - Accept a bounty assignment from the Council, setting a curator deposit. | ||
| - `extend_bounty_expiry` - Extend the expiry block number of the bounty and stay active. | ||
| - `award_bounty` - Close and pay out the specified amount for the completed work. | ||
| - `claim_bounty` - Claim a specific bounty amount from the Payout Address. | ||
| - `unassign_curator` - Unassign an accepted curator from a specific earmark. | ||
| - `close_bounty` - Cancel the earmark for a specific treasury amount and close the bounty. | ||
|
|
||
|
|
||
| ## GenesisConfig | ||
|
|
||
| The Treasury module depends on the [`GenesisConfig`](https://docs.rs/pallet-treasury/latest/pallet_treasury/struct.GenesisConfig.html). | ||
|
|
||
| License: Apache-2.0 | ||
| None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.