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

Bounties #5715

Merged
116 commits merged into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from 104 commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
1f31ad9
add some compact annotation
xlc Apr 21, 2020
f3e7230
implement bounties for treasury
xlc Apr 21, 2020
8c16d4f
fix test build
xlc Apr 22, 2020
3efc22a
remove some duplicated code
xlc Apr 22, 2020
817770d
fix build
xlc Apr 22, 2020
a1b30c1
add tests
xlc Apr 22, 2020
5fce0d8
Merge remote-tracking branch 'origin/master' into bounty
xlc Apr 22, 2020
d143080
fix build
xlc Apr 22, 2020
3f5d446
Merge remote-tracking branch 'origin/master' into bounty
xlc Apr 23, 2020
829dc20
fix tests
xlc Apr 23, 2020
b4f86f1
Merge branch 'master' into bounty
xlc May 20, 2020
45b7717
rename
xlc May 20, 2020
d079500
merge deposit byte fee
xlc May 20, 2020
ce0bc02
add comments
xlc May 20, 2020
19f3bc3
Merge branch 'master' into bounty
xlc May 28, 2020
2e9697e
refactor storage
xlc May 28, 2020
92e8050
Merge remote-tracking branch 'origin/master' into bounty
xlc Jun 6, 2020
a5c26bb
support sub bounty
xlc Jun 6, 2020
18c9bab
emit BountyBecameActive when sub bounty is created
xlc Jun 6, 2020
e7fa5e3
able to contribute bounty
xlc Jun 6, 2020
4968e3b
allow curator to cancel bounty
xlc Jun 7, 2020
ee57848
remove bounty contribution
xlc Jun 8, 2020
0fb4ff2
implement bounty expiry
xlc Jun 8, 2020
f9901a0
Able to extend bounty
xlc Jun 8, 2020
8129646
Merge remote-tracking branch 'origin/master' into bounty
xlc Jun 21, 2020
d58794c
fix build and update tests
xlc Jun 21, 2020
d432a7a
create sub bounty test
xlc Jun 21, 2020
8141f62
add more tests
xlc Jun 21, 2020
4b1ea01
Merge remote-tracking branch 'origin/master' into bounty
xlc Jun 25, 2020
a63680c
add benchmarks for bounties
xlc Jun 28, 2020
ecb3893
Merge remote-tracking branch 'origin/master' into bounty
xlc Jun 28, 2020
b1d8d2f
fix build
xlc Jun 28, 2020
749c66b
Merge branch 'master' into bounty
xlc Jun 29, 2020
b6786e8
line width
xlc Jul 1, 2020
88c2046
fix benchmarking test
xlc Jul 1, 2020
fbc12f0
Merge remote-tracking branch 'origin/master' into bounty
xlc Jul 1, 2020
e174c98
update trait
xlc Jul 1, 2020
697c1e3
fix typo
xlc Jul 5, 2020
1bd7fc0
Merge remote-tracking branch 'origin/master' into bounty
xlc Jul 5, 2020
e1e01ee
Update lib.rs
Jul 6, 2020
afe301b
Merge remote-tracking branch 'origin/master' into bounty
xlc Jul 7, 2020
24f58bf
Merge pull request #1 from rrtti/patch-1
xlc Jul 8, 2020
dd7739b
update docs
xlc Jul 8, 2020
e8ffa3b
Merge remote-tracking branch 'origin/master' into bounty
xlc Jul 9, 2020
08065ac
add MaximumSubBountyDepth
xlc Jul 9, 2020
aacd9af
put BountyValueMinimum into storage
xlc Jul 10, 2020
c1f9900
rework bount depth
xlc Jul 11, 2020
705775d
Merge remote-tracking branch 'origin/master' into bounty
xlc Jul 14, 2020
2b8ecaa
Merge remote-tracking branch 'origin/master' into bounty
xlc Jul 21, 2020
bfae64b
split on_initialize benchmarks
shawntabrizi Jul 21, 2020
d605cb0
remove components from constant functions
shawntabrizi Jul 21, 2020
e175bc0
Update weight integration into treasury
shawntabrizi Jul 21, 2020
2ff28ee
Update reject proposal read/writes
shawntabrizi Jul 21, 2020
6a0cc13
fix weight calculation
xlc Jul 21, 2020
c222128
Ignore weights with 0 factor
shawntabrizi Jul 21, 2020
a5c897e
Remove 0 multipliers
shawntabrizi Jul 21, 2020
be92d1f
Merge remote-tracking branch 'origin/master' into bounty
xlc Jul 27, 2020
4441cdc
add some docs
xlc Jul 27, 2020
5927720
allow unused for generated code
xlc Jul 27, 2020
4b6f6e7
line width
xlc Jul 27, 2020
8a73200
allow RejectOrigin to cancel a pending payout bounty
xlc Jul 29, 2020
2ecd9f3
require BountyValueMinimum > ED
xlc Jul 29, 2020
06a305e
make BountyValueMinimum configurable by chain spec
xlc Jul 29, 2020
e86b63d
Merge remote-tracking branch 'origin/master' into bounty
xlc Aug 3, 2020
72a7a4c
remove sub-bounty features
xlc Aug 4, 2020
3c1a020
update curator
xlc Aug 4, 2020
dc8b295
accept curator
xlc Aug 7, 2020
e9b34be
unassign and cancel
xlc Aug 9, 2020
14b758a
fix tests
xlc Aug 9, 2020
ef05e56
new tests
xlc Aug 10, 2020
c32c3ca
Merge remote-tracking branch 'origin/master' into bounty
xlc Aug 10, 2020
9f87045
Update lib.rs
Aug 10, 2020
901b915
fix test
xlc Aug 10, 2020
af3931a
Merge remote-tracking branch 'origin/master' into bounty
xlc Aug 10, 2020
e3798eb
Merge pull request #4 from rrtti/patch-2
xlc Aug 10, 2020
6f40541
update extend_bounty_expiry
xlc Aug 11, 2020
6a14ec0
fix benchmarking
xlc Aug 11, 2020
3012300
add new benchmarking code
xlc Aug 11, 2020
343eb1c
add docs
xlc Aug 11, 2020
f724898
fix tests
xlc Aug 11, 2020
1f0c809
Update benchmarking.rs
shawntabrizi Aug 11, 2020
664f6e8
Make BountyValueMinimum a trait config instead of stroage value
xlc Aug 11, 2020
571059a
fix runtime build
xlc Aug 11, 2020
858a838
Update weights
shawntabrizi Aug 11, 2020
be0967e
Merge branch 'bounty' of https://github.com/laminar-protocol/substrat…
shawntabrizi Aug 12, 2020
e4dd5ff
Update default_weights.rs
shawntabrizi Aug 12, 2020
c2ee191
update weights
shawntabrizi Aug 12, 2020
a2e6306
update
xlc Aug 12, 2020
c49981c
update comments
xlc Aug 16, 2020
465aaf3
unreserve curator fee
xlc Aug 16, 2020
2d2b1a4
update tests
xlc Aug 16, 2020
363bdec
update benchmarks
xlc Aug 18, 2020
7482e59
fix curator deposit handling
xlc Aug 18, 2020
ca54bfc
Merge remote-tracking branch 'origin/master' into bounty
xlc Aug 18, 2020
58ce671
trigger CI
xlc Aug 18, 2020
31491d3
fix benchmarking
xlc Aug 19, 2020
a81e017
use append instead of mutate push
xlc Aug 19, 2020
e0d0daf
additional noop tests
shawntabrizi Aug 19, 2020
1dec474
improve fee hanlding. update event docs
xlc Aug 19, 2020
27cd80c
RejectOrigin to unassign
xlc Aug 19, 2020
85baba7
update bounty cancel logic
xlc Aug 19, 2020
05478ba
use Zero::zero() over 0.into()
xlc Aug 23, 2020
8033517
Merge remote-tracking branch 'origin/master' into bounty
xlc Aug 23, 2020
c70d864
fix tests
xlc Aug 23, 2020
76657c7
Merge remote-tracking branch 'origin/master' into bounty
xlc Sep 9, 2020
0db424e
Merge branch 'master' into bounty
xlc Sep 16, 2020
54d0bbc
fix benchmarks
xlc Sep 16, 2020
3795109
proposed fixes to bounties
shawntabrizi Sep 17, 2020
e833a53
fix tests
shawntabrizi Sep 17, 2020
e6f95c6
fix benchmarks
shawntabrizi Sep 17, 2020
0982f46
update weightinfo
shawntabrizi Sep 17, 2020
784a69a
use closure
shawntabrizi Sep 17, 2020
f645aca
Merge pull request #5 from paritytech/shawntabrizi-bounty-fixes
xlc Sep 17, 2020
7372444
fix compile
shawntabrizi Sep 18, 2020
8015965
update weights
shawntabrizi Sep 18, 2020
bb2a86f
Merge branch 'master' into pr/5715
shawntabrizi Sep 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,14 @@ parameter_types! {
pub const TipCountdown: BlockNumber = 1 * DAYS;
pub const TipFindersFee: Percent = Percent::from_percent(20);
pub const TipReportDepositBase: Balance = 1 * DOLLARS;
pub const TipReportDepositPerByte: Balance = 1 * CENTS;
pub const DataDepositPerByte: Balance = 1 * CENTS;
pub const BountyDepositBase: Balance = 1 * DOLLARS;
pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS;
pub const TreasuryModuleId: ModuleId = ModuleId(*b"py/trsry");
pub const BountyDuration: BlockNumber = 14 * DAYS;
pub const MaximumReasonLength: u32 = 16384;
pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);
pub const BountyValueMinimum: Balance = 5 * DOLLARS;
}

impl pallet_treasury::Trait for Runtime {
Expand All @@ -606,15 +612,21 @@ impl pallet_treasury::Trait for Runtime {
type TipCountdown = TipCountdown;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = TipReportDepositBase;
type TipReportDepositPerByte = TipReportDepositPerByte;
type DataDepositPerByte = DataDepositPerByte;
type Event = Event;
type ProposalRejection = ();
type OnSlash = ();
type ProposalBond = ProposalBond;
type ProposalBondMinimum = ProposalBondMinimum;
type SpendPeriod = SpendPeriod;
type Burn = Burn;
type BountyDepositBase = BountyDepositBase;
type BountyDepositPayoutDelay = BountyDepositPayoutDelay;
type BountyDuration = BountyDuration;
type BountyCuratorDeposit = BountyCuratorDeposit;
type BountyValueMinimum = BountyValueMinimum;
type MaximumReasonLength = MaximumReasonLength;
type BurnDestination = ();
type WeightInfo = ();
type WeightInfo = weights::pallet_treasury::WeightInfo;
}

parameter_types! {
Expand Down
1 change: 1 addition & 0 deletions bin/node/runtime/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

pub mod frame_system;
pub mod pallet_balances;
pub mod pallet_treasury;
pub mod pallet_democracy;
pub mod pallet_timestamp;
pub mod pallet_utility;
135 changes: 135 additions & 0 deletions bin/node/runtime/src/weights/pallet_treasury.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
// Copyright (C) 2020 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc5

use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};

pub struct WeightInfo;
impl pallet_treasury::WeightInfo for WeightInfo {
fn propose_spend() -> Weight {
(43830000 as Weight)
.saturating_add(DbWeight::get().reads(1 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
fn reject_proposal() -> Weight {
(36949000 as Weight)
.saturating_add(DbWeight::get().reads(2 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
fn approve_proposal() -> Weight {
(12744000 as Weight)
.saturating_add(DbWeight::get().reads(2 as Weight))
.saturating_add(DbWeight::get().writes(1 as Weight))
}
fn report_awesome(r: u32, ) -> Weight {
(54300000 as Weight)
.saturating_add((2000 as Weight).saturating_mul(r as Weight))
.saturating_add(DbWeight::get().reads(2 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
// WARNING! Some components were not used: ["r"]
fn retract_tip() -> Weight {
(46567000 as Weight)
.saturating_add(DbWeight::get().reads(1 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
fn tip_new(r: u32, t: u32, ) -> Weight {
(35215000 as Weight)
.saturating_add((2000 as Weight).saturating_mul(r as Weight))
.saturating_add((151000 as Weight).saturating_mul(t as Weight))
.saturating_add(DbWeight::get().reads(2 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
fn tip(t: u32, ) -> Weight {
(26499000 as Weight)
.saturating_add((675000 as Weight).saturating_mul(t as Weight))
.saturating_add(DbWeight::get().reads(2 as Weight))
.saturating_add(DbWeight::get().writes(1 as Weight))
}
fn close_tip(t: u32, ) -> Weight {
(85712000 as Weight)
.saturating_add((344000 as Weight).saturating_mul(t as Weight))
.saturating_add(DbWeight::get().reads(3 as Weight))
.saturating_add(DbWeight::get().writes(3 as Weight))
}
fn propose_bounty(d: u32, ) -> Weight {
(47117000 as Weight)
.saturating_add((1000 as Weight).saturating_mul(d as Weight))
.saturating_add(DbWeight::get().reads(1 as Weight))
.saturating_add(DbWeight::get().writes(3 as Weight))
}
fn reject_bounty() -> Weight {
(47109000 as Weight)
.saturating_add(DbWeight::get().reads(1 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
fn approve_bounty() -> Weight {
(14829000 as Weight)
.saturating_add(DbWeight::get().reads(2 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
fn assign_curator() -> Weight {
(11392000 as Weight)
.saturating_add(DbWeight::get().reads(1 as Weight))
.saturating_add(DbWeight::get().writes(1 as Weight))
}
fn unassign_curator() -> Weight {
(10941000 as Weight)
.saturating_add(DbWeight::get().reads(1 as Weight))
.saturating_add(DbWeight::get().writes(1 as Weight))
}
fn accept_curator() -> Weight {
(39884000 as Weight)
.saturating_add(DbWeight::get().reads(2 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
fn award_bounty() -> Weight {
(29035000 as Weight)
.saturating_add(DbWeight::get().reads(1 as Weight))
.saturating_add(DbWeight::get().writes(1 as Weight))
}
fn claim_bounty() -> Weight {
(111260000 as Weight)
.saturating_add(DbWeight::get().reads(4 as Weight))
.saturating_add(DbWeight::get().writes(5 as Weight))
}
fn cancel_bounty() -> Weight {
(70335000 as Weight)
.saturating_add(DbWeight::get().reads(2 as Weight))
.saturating_add(DbWeight::get().writes(3 as Weight))
}
fn extend_bounty_expiry() -> Weight {
(28002000 as Weight)
.saturating_add(DbWeight::get().reads(1 as Weight))
.saturating_add(DbWeight::get().writes(1 as Weight))
}
fn on_initialize_proposals(p: u32, ) -> Weight {
(88896000 as Weight)
.saturating_add((33093000 as Weight).saturating_mul(p as Weight))
.saturating_add(DbWeight::get().reads(3 as Weight))
.saturating_add(DbWeight::get().reads((1 as Weight).saturating_mul(p as Weight)))
.saturating_add(DbWeight::get().writes(3 as Weight))
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
}
fn on_initialize_bounties(b: u32, ) -> Weight {
(73564000 as Weight)
.saturating_add((49912000 as Weight).saturating_mul(b as Weight))
.saturating_add(DbWeight::get().reads(2 as Weight))
.saturating_add(DbWeight::get().reads((2 as Weight).saturating_mul(b as Weight)))
.saturating_add(DbWeight::get().writes(2 as Weight))
.saturating_add(DbWeight::get().writes((2 as Weight).saturating_mul(b as Weight)))
}
}
1 change: 1 addition & 0 deletions frame/treasury/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ std = [
runtime-benchmarks = [
"frame-benchmarking",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
Loading