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

Add Child Bounties to Polkadot and Kusama #4863

Merged
merged 11 commits into from
Mar 16, 2022

Conversation

shawntabrizi
Copy link
Member

No description provided.

@github-actions github-actions bot added the A0-please_review Pull request needs code review. label Feb 7, 2022
@shawntabrizi
Copy link
Member Author

/benchmark runtime kusama pallet_child_bounties

@parity-benchapp
Copy link

parity-benchapp bot commented Feb 7, 2022

Benchmark Runtime Kusama Pallet for branch "shawntabrizi-add-child-bounties" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_child_bounties --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/

Toolchain: stable-x86_64-unknown-linux-gnu (default)
rustc 1.57.0 (f1edd0429 2021-11-29)

Results
Pallet: "pallet_child_bounties", Extrinsic: "add_child_bounty", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ChildBounties ParentChildBounties (r:1 w:1)
Storage: Bounties Bounties (r:1 w:0)
Storage: System Account (r:2 w:2)
Storage: ChildBounties ChildBountyCount (r:1 w:1)
Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)
Storage: ChildBounties ChildBounties (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    39.95
    + d        0
              µs

Reads = 5 + (0 * d)
Writes = 6 + (0 * d)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    d   mean µs  sigma µs       %
    0     39.95     0.167    0.4%
  327     40.59     0.274    0.6%
  654     40.94     0.112    0.2%
  981     40.64      0.23    0.5%
 1308     39.97      0.31    0.7%
 1635     40.92     0.169    0.4%
 1962     41.31     0.188    0.4%
 2289     41.43      0.28    0.6%
 2616     41.25      0.09    0.2%
 2943     41.81     0.243    0.5%
 3270     41.65     0.308    0.7%
 3597     42.46      0.26    0.6%
 3924     42.41     0.143    0.3%
 4251     42.54      0.41    0.9%
 4578     43.48     0.226    0.5%
 4905     43.54     0.206    0.4%
 5232     43.47     0.359    0.8%
 5559     43.77     0.151    0.3%
 5886     43.97     0.147    0.3%
 6213     43.47     0.428    0.9%
 6540     44.91     0.104    0.2%
 6867     44.66     0.218    0.4%
 7194     44.79     0.223    0.4%
 7521     45.02     0.409    0.9%
 7848     45.75     0.208    0.4%
 8175     45.54     0.124    0.2%
 8502     46.08     0.231    0.5%
 8829     45.48     0.149    0.3%
 9156     46.23     0.131    0.2%
 9483      46.9      0.22    0.4%
 9810     45.97     0.218    0.4%
10137     46.68     0.304    0.6%
10464     47.14     0.132    0.2%
10791      47.6     0.145    0.3%
11118     47.73     0.176    0.3%
11445     47.89     0.208    0.4%
11772     47.39     0.284    0.5%
12099     50.47     1.176    2.3%
12426     48.94     0.173    0.3%
12753        49      0.19    0.3%
13080     48.29     0.214    0.4%
13407     48.73     0.556    1.1%
13734     48.21     0.154    0.3%
14061     48.59     0.236    0.4%
14388     50.19     0.173    0.3%
14715     50.14     0.116    0.2%
15042     50.62     0.142    0.2%
15369     49.28     0.083    0.1%
15696     51.92     0.846    1.6%
16023     51.31     0.202    0.3%
16350     51.14     0.133    0.2%

Quality and confidence:
param     error
d             0

Model:
Time ~=    39.87
    + d    0.001
              µs

Reads = 5 + (0 * d)
Writes = 6 + (0 * d)

Pallet: "pallet_child_bounties", Extrinsic: "propose_curator", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Bounties Bounties (r:1 w:0)
Storage: ChildBounties ChildBounties (r:1 w:1)
Storage: ChildBounties ChildrenCuratorFees (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    10.42
              µs

Reads = 3
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    10.42
              µs

Reads = 3
Writes = 2

Pallet: "pallet_child_bounties", Extrinsic: "accept_curator", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Bounties Bounties (r:1 w:0)
Storage: ChildBounties ChildBounties (r:1 w:1)
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    21.24
              µs

Reads = 3
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    21.24
              µs

Reads = 3
Writes = 2

Pallet: "pallet_child_bounties", Extrinsic: "unassign_curator", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ChildBounties ChildBounties (r:1 w:1)
Storage: Bounties Bounties (r:1 w:0)
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    31.41
              µs

Reads = 3
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    31.41
              µs

Reads = 3
Writes = 2

Pallet: "pallet_child_bounties", Extrinsic: "award_child_bounty", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Bounties Bounties (r:1 w:0)
Storage: ChildBounties ChildBounties (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    16.21
              µs

Reads = 2
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    16.21
              µs

Reads = 2
Writes = 1

Pallet: "pallet_child_bounties", Extrinsic: "claim_child_bounty", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ChildBounties ChildBounties (r:1 w:1)
Storage: System Account (r:3 w:3)
Storage: ChildBounties ParentChildBounties (r:1 w:1)
Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    53.24
              µs

Reads = 5
Writes = 6

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    53.24
              µs

Reads = 5
Writes = 6

Pallet: "pallet_child_bounties", Extrinsic: "close_child_bounty_added", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Bounties Bounties (r:1 w:0)
Storage: ChildBounties ChildBounties (r:1 w:1)
Storage: ChildBounties ChildrenCuratorFees (r:1 w:1)
Storage: ChildBounties ParentChildBounties (r:1 w:1)
Storage: System Account (r:2 w:2)
Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    38.17
              µs

Reads = 6
Writes = 6

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    38.17
              µs

Reads = 6
Writes = 6

Pallet: "pallet_child_bounties", Extrinsic: "close_child_bounty_active", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Bounties Bounties (r:1 w:0)
Storage: ChildBounties ChildBounties (r:1 w:1)
Storage: System Account (r:3 w:3)
Storage: ChildBounties ChildrenCuratorFees (r:1 w:1)
Storage: ChildBounties ParentChildBounties (r:1 w:1)
Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    45.92
              µs

Reads = 7
Writes = 7

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    45.92
              µs

Reads = 7
Writes = 7


@shawntabrizi shawntabrizi added B7-runtimenoteworthy C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit. labels Feb 7, 2022
@shawntabrizi
Copy link
Member Author

/benchmark runtime polkadot pallet_child_bounties

type DataDepositPerByte = DataDepositPerByte;
type Event = Event;
type MaximumReasonLength = MaximumReasonLength;
type WeightInfo = weights::pallet_bounties::WeightInfo<Runtime>;
}

parameter_types! {
pub const MaxActiveChildBountyCount: u32 = 100;
pub const ChildBountyValueMinimum: Balance = BountyValueMinimum::get() / 10;
Copy link

@michalisFr michalisFr Feb 7, 2022

Choose a reason for hiding this comment

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

This is too high IMO. There may be use cases where the child bounty rewards need to be quite low (example) or at least disproportionally low to the total bounty.

I propose a fixed min of 10 * DOLLARS (which I believe is half the min of the main bounty).

Copy link
Member Author

Choose a reason for hiding this comment

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

will be addressed in follow up PR

type DataDepositPerByte = DataDepositPerByte;
type MaximumReasonLength = MaximumReasonLength;
type WeightInfo = weights::pallet_bounties::WeightInfo<Runtime>;
}

parameter_types! {
pub const MaxActiveChildBountyCount: u32 = 100;
pub const ChildBountyValueMinimum: Balance = BountyValueMinimum::get() / 10;

Choose a reason for hiding this comment

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

Same as for Kusama

This is too high IMO. There may be use cases where the child bounty rewards need to be quite low (example) or at least disproportionally low to the total bounty.

I propose a fixed min of 5 * DOLLARS (which I believe is half the min of the main bounty).

Copy link
Member Author

Choose a reason for hiding this comment

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

will be addressed in follow up PR

…-- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_child_bounties --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/
@parity-benchapp
Copy link

parity-benchapp bot commented Feb 7, 2022

Benchmark Runtime Polkadot Pallet for branch "shawntabrizi-add-child-bounties" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=pallet_child_bounties --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/

Toolchain: stable-x86_64-unknown-linux-gnu (default)
rustc 1.57.0 (f1edd0429 2021-11-29)

Results
Pallet: "pallet_child_bounties", Extrinsic: "add_child_bounty", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ChildBounties ParentChildBounties (r:1 w:1)
Storage: Bounties Bounties (r:1 w:0)
Storage: System Account (r:2 w:2)
Storage: ChildBounties ChildBountyCount (r:1 w:1)
Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)
Storage: ChildBounties ChildBounties (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    39.64
    + d        0
              µs

Reads = 5 + (0 * d)
Writes = 6 + (0 * d)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    d   mean µs  sigma µs       %
    0     38.46     0.317    0.8%
  327     39.29     0.161    0.4%
  654     39.66     0.173    0.4%
  981     40.69     0.164    0.4%
 1308     40.71     0.146    0.3%
 1635     41.16     0.161    0.3%
 1962     40.53     0.238    0.5%
 2289     41.37     0.198    0.4%
 2616     41.63     0.394    0.9%
 2943     41.42     0.296    0.7%
 3270     42.41     0.201    0.4%
 3597      42.6     0.252    0.5%
 3924     42.95     0.251    0.5%
 4251     42.27     0.241    0.5%
 4578     43.19     0.159    0.3%
 4905     43.28     0.402    0.9%
 5232     43.99      0.26    0.5%
 5559      44.1     0.145    0.3%
 5886     44.47     0.239    0.5%
 6213     44.76     0.172    0.3%
 6540      44.5     0.443    0.9%
 6867     44.86     0.182    0.4%
 7194     45.27     0.146    0.3%
 7521     45.31     0.305    0.6%
 7848     44.59     0.197    0.4%
 8175     45.35     0.343    0.7%
 8502     46.35     0.252    0.5%
 8829     46.88     0.182    0.3%
 9156     45.49     0.185    0.4%
 9483     47.11      0.15    0.3%
 9810     47.29     0.203    0.4%
10137     46.29     0.159    0.3%
10464     47.61     0.225    0.4%
10791      48.4     0.222    0.4%
11118     46.99     0.226    0.4%
11445     48.39     0.155    0.3%
11772     48.55     0.261    0.5%
12099      49.2     0.217    0.4%
12426     48.59     0.478    0.9%
12753     48.31     0.253    0.5%
13080     49.76     0.169    0.3%
13407     49.03     0.357    0.7%
13734     50.18     0.283    0.5%
14061     50.42     0.153    0.3%
14388     50.81     0.258    0.5%
14715     50.32     0.426    0.8%
15042     51.25     0.465    0.9%
15369     51.77     0.192    0.3%
15696     51.81     0.199    0.3%
16023      50.9     0.272    0.5%
16350     52.38     0.389    0.7%

Quality and confidence:
param     error
d             0

Model:
Time ~=    39.51
    + d    0.001
              µs

Reads = 5 + (0 * d)
Writes = 6 + (0 * d)

Pallet: "pallet_child_bounties", Extrinsic: "propose_curator", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Bounties Bounties (r:1 w:0)
Storage: ChildBounties ChildBounties (r:1 w:1)
Storage: ChildBounties ChildrenCuratorFees (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    10.56
              µs

Reads = 3
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    10.56
              µs

Reads = 3
Writes = 2

Pallet: "pallet_child_bounties", Extrinsic: "accept_curator", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Bounties Bounties (r:1 w:0)
Storage: ChildBounties ChildBounties (r:1 w:1)
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=     21.3
              µs

Reads = 3
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=     21.3
              µs

Reads = 3
Writes = 2

Pallet: "pallet_child_bounties", Extrinsic: "unassign_curator", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ChildBounties ChildBounties (r:1 w:1)
Storage: Bounties Bounties (r:1 w:0)
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=       32
              µs

Reads = 3
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=       32
              µs

Reads = 3
Writes = 2

Pallet: "pallet_child_bounties", Extrinsic: "award_child_bounty", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Bounties Bounties (r:1 w:0)
Storage: ChildBounties ChildBounties (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    16.21
              µs

Reads = 2
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    16.21
              µs

Reads = 2
Writes = 1

Pallet: "pallet_child_bounties", Extrinsic: "claim_child_bounty", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ChildBounties ChildBounties (r:1 w:1)
Storage: System Account (r:3 w:3)
Storage: ChildBounties ParentChildBounties (r:1 w:1)
Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    53.67
              µs

Reads = 5
Writes = 6

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    53.67
              µs

Reads = 5
Writes = 6

Pallet: "pallet_child_bounties", Extrinsic: "close_child_bounty_added", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Bounties Bounties (r:1 w:0)
Storage: ChildBounties ChildBounties (r:1 w:1)
Storage: ChildBounties ChildrenCuratorFees (r:1 w:1)
Storage: ChildBounties ParentChildBounties (r:1 w:1)
Storage: System Account (r:2 w:2)
Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    38.48
              µs

Reads = 6
Writes = 6

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    38.48
              µs

Reads = 6
Writes = 6

Pallet: "pallet_child_bounties", Extrinsic: "close_child_bounty_active", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Bounties Bounties (r:1 w:0)
Storage: ChildBounties ChildBounties (r:1 w:1)
Storage: System Account (r:3 w:3)
Storage: ChildBounties ChildrenCuratorFees (r:1 w:1)
Storage: ChildBounties ParentChildBounties (r:1 w:1)
Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    46.61
              µs

Reads = 7
Writes = 7

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    46.61
              µs

Reads = 7
Writes = 7


Parity Bot added 2 commits February 7, 2022 22:08
…-- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=pallet_child_bounties --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/
runtime/kusama/src/lib.rs Show resolved Hide resolved
runtime/kusama/src/lib.rs Outdated Show resolved Hide resolved
runtime/kusama/src/lib.rs Show resolved Hide resolved
Copy link
Contributor

@emostov emostov left a comment

Choose a reason for hiding this comment

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

Configuration looks reasonable, although I am not that familiar with the child bounties pallet

@shawntabrizi
Copy link
Member Author

bot merge

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants