Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: thanks and much gratitude! #282

Merged
merged 49 commits into from
Oct 28, 2021
Merged

feat: thanks and much gratitude! #282

merged 49 commits into from
Oct 28, 2021

Conversation

weichweich
Copy link
Contributor

@weichweich weichweich commented Oct 26, 2021

fixes KILTprotocol/ticket/issues/1586

M

Checklist:

  • I have verified that the code works
    • No panics! (checked arithmetic ops, no indexing array[3] use get(3), ...)
  • I have verified that the code is easy to understand
    • If not, I have left a well-balanced amount of inline comments
  • This PR does not introduce new custom types
  • I have left the code in a better state
  • I have documented the changes (where applicable)

@weichweich
Copy link
Contributor Author

/bench runtime spiritnet-runtime crowdloan

@kilt-command-bot
Copy link

kilt-command-bot bot commented Oct 26, 2021

Benchmark Runtime Pallet for branch "aw-thanks" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=spiritnet-dev --steps=50 --repeat=20 --pallet=crowdloan --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/spiritnet/src/weights/crowdloan.rs --template=.maintain/runtime-weight-template.hbs

Results
error: failed to select a version for `crowdloan`.
    ... required by package `peregrine-runtime v1.0.0 (/home/benchbot/bench-bot/git/mashnet-node/runtimes/peregrine)`
    ... which is depended on by `kilt-parachain v1.0.0 (/home/benchbot/bench-bot/git/mashnet-node/nodes/parachain)`
versions that meet the requirements `=0.26.2` are: 0.26.2

the package `peregrine-runtime` depends on `crowdloan`, with features: `kilt-primitives` but `crowdloan` does not have these features.


failed to select a version for `crowdloan` which could resolve this conflict

ERROR: Unable to commit file ./runtimes/spiritnet/src/weights/crowdloan.rs

@weichweich
Copy link
Contributor Author

/bench runtime spiritnet-runtime crowdloan

@kilt-command-bot
Copy link

kilt-command-bot bot commented Oct 26, 2021

Benchmark Runtime Pallet for branch "aw-thanks" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=spiritnet-dev --steps=50 --repeat=20 --pallet=crowdloan --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/spiritnet/src/weights/crowdloan.rs --template=.maintain/runtime-weight-template.hbs

Results
Error: Input("InsufficientBalance")

ERROR: Unable to commit file ./runtimes/spiritnet/src/weights/crowdloan.rs

@weichweich
Copy link
Contributor Author

/bench runtime spiritnet-runtime crowdloan

@kilt-command-bot
Copy link

kilt-command-bot bot commented Oct 27, 2021

Benchmark Runtime Pallet for branch "aw-thanks" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=spiritnet-dev --steps=50 --repeat=20 --pallet=crowdloan --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/spiritnet/src/weights/crowdloan.rs --template=.maintain/runtime-weight-template.hbs

Results
Pallet: "crowdloan", Extrinsic: "set_registrar_account", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:1)

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

Model:
Time ~=    20.48
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=    20.48
              µs

Reads = 1
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_contribution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Contributions (r:1 w:1)

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

Model:
Time ~=    23.33
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    23.33
              µs

Reads = 2
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_config", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Configuration (r:0 w:1)

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

Model:
Time ~=    20.29
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=    20.29
              µs

Reads = 1
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_reserve_accounts", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Reserve (r:1 w:1)

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

Model:
Time ~=    24.21
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    24.21
              µs

Reads = 2
Writes = 1

Pallet: "crowdloan", Extrinsic: "receive_gratitude", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors Contributions (r:1 w:1)
Storage: CrowdloanContributors Configuration (r:1 w:0)
Storage: CrowdloanContributors Reserve (r:1 w:0)
Storage: System Account (r:3 w:3)
Storage: Vesting Vesting (r:1 w:1)
Storage: Balances Locks (r:1 w:1)

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

Model:
Time ~=      164
              µs

Reads = 8
Writes = 6

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

Model:
Time ~=      164
              µs

Reads = 8
Writes = 6

Pallet: "crowdloan", Extrinsic: "remove_contribution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Contributions (r:1 w:1)

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

Model:
Time ~=    24.83
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    24.83
              µs

Reads = 2
Writes = 1


…hmarks -- benchmark --chain=spiritnet-dev --steps=50 --repeat=20 --pallet=crowdloan --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/spiritnet/src/weights/crowdloan.rs --template=.maintain/runtime-weight-template.hbs
@weichweich
Copy link
Contributor Author

/bench runtime peregrine-runtime crowdloan

@kilt-command-bot
Copy link

kilt-command-bot bot commented Oct 27, 2021

Error running benchmark: aw-thanks

stdoutCaught exception in benchmarkRuntime: TypeError: Cannot read properties of undefined (reading 'benchCommand')

@weichweich
Copy link
Contributor Author

/bench runtime peregrine crowdloan

@kilt-command-bot
Copy link

kilt-command-bot bot commented Oct 27, 2021

Benchmark Runtime Substrate Pallet for branch "aw-thanks" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=crowdloan --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/peregrine/src/weights/crowdloan.rs --template=.maintain/runtime-weight-template.hbs

Results
Pallet: "crowdloan", Extrinsic: "set_registrar_account", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:1)

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

Model:
Time ~=    20.72
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=    20.72
              µs

Reads = 1
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_contribution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Contributions (r:1 w:1)

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

Model:
Time ~=    23.33
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    23.33
              µs

Reads = 2
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_config", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Configuration (r:0 w:1)

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

Model:
Time ~=     20.5
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=     20.5
              µs

Reads = 1
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_reserve_accounts", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Reserve (r:1 w:1)

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

Model:
Time ~=    24.08
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    24.08
              µs

Reads = 2
Writes = 1

Pallet: "crowdloan", Extrinsic: "receive_gratitude", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors Contributions (r:1 w:1)
Storage: CrowdloanContributors Configuration (r:1 w:0)
Storage: CrowdloanContributors Reserve (r:1 w:0)
Storage: System Account (r:3 w:3)
Storage: Vesting Vesting (r:1 w:1)
Storage: Balances Locks (r:1 w:1)

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

Model:
Time ~=    170.3
              µs

Reads = 8
Writes = 6

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

Model:
Time ~=    170.3
              µs

Reads = 8
Writes = 6

Pallet: "crowdloan", Extrinsic: "remove_contribution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Contributions (r:1 w:1)

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

Model:
Time ~=    25.15
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    25.15
              µs

Reads = 2
Writes = 1


…hmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=crowdloan --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/peregrine/src/weights/crowdloan.rs --template=.maintain/runtime-weight-template.hbs
@weichweich
Copy link
Contributor Author

/bench runtime pallet crowdloan

@kilt-command-bot
Copy link

kilt-command-bot bot commented Oct 27, 2021

Benchmark Runtime Pallet for branch "aw-thanks" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=crowdloan --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=pallets/crowdloan/src/default_weights.rs --template=.maintain/weight-template.hbs

Results
Pallet: "crowdloan", Extrinsic: "set_registrar_account", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:1)

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

Model:
Time ~=    21.64
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=    21.64
              µs

Reads = 1
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_contribution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Contributions (r:1 w:1)

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

Model:
Time ~=    23.81
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    23.81
              µs

Reads = 2
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_config", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Configuration (r:0 w:1)

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

Model:
Time ~=    21.24
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=    21.24
              µs

Reads = 1
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_reserve_accounts", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Reserve (r:1 w:1)

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

Model:
Time ~=    24.33
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    24.33
              µs

Reads = 2
Writes = 1

Pallet: "crowdloan", Extrinsic: "receive_gratitude", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors Contributions (r:1 w:1)
Storage: CrowdloanContributors Configuration (r:1 w:0)
Storage: CrowdloanContributors Reserve (r:1 w:0)
Storage: System Account (r:3 w:3)
Storage: Vesting Vesting (r:1 w:1)
Storage: Balances Locks (r:1 w:1)

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

Model:
Time ~=    178.2
              µs

Reads = 8
Writes = 6

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

Model:
Time ~=    178.2
              µs

Reads = 8
Writes = 6

Pallet: "crowdloan", Extrinsic: "remove_contribution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Contributions (r:1 w:1)

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

Model:
Time ~=    25.45
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    25.45
              µs

Reads = 2
Writes = 1


kiltbot and others added 8 commits October 27, 2021 08:16
…hmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=crowdloan --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=pallets/crowdloan/src/default_weights.rs --template=.maintain/weight-template.hbs
@weichweich weichweich marked this pull request as ready for review October 27, 2021 07:07
@weichweich
Copy link
Contributor Author

/bench runtime spiritnet-runtime crowdloan

let gratitude = Self::split_gratitude_for(&receiver)?;
Self::ensure_can_send_gratitude(&gratitude)?;

// *** No failure beyond this call! The contributor was removed. ***
Copy link
Contributor

Choose a reason for hiding this comment

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

You cant just write no failure and then have a bunch of ? after this.

You should write an expect statement with a proof of why a call will not fail.

Otherwise, you should capture the result, saying that if something does fail, better to do nothing than to modify storage and then return error.


// Transfer the free amount. Should not fail since checked we
// ensure_can_withdraw.
CurrencyOf::<T>::transfer(&reserve.free, &receiver, free, ExistenceRequirement::AllowDeath)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

no ? allowed

Copy link
Contributor

@shawntabrizi shawntabrizi Oct 27, 2021

Choose a reason for hiding this comment

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

Suggested change
CurrencyOf::<T>::transfer(&reserve.free, &receiver, free, ExistenceRequirement::AllowDeath)?;
CurrencyOf::<T>::transfer(&reserve.free, &receiver, free, ExistenceRequirement::AllowDeath)
.expect("cannot fail since we checked ensure_can_withdraw");

This is one way you can approach it.

Copy link
Contributor

@shawntabrizi shawntabrizi Oct 27, 2021

Choose a reason for hiding this comment

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

Suggested change
CurrencyOf::<T>::transfer(&reserve.free, &receiver, free, ExistenceRequirement::AllowDeath)?;
let result = CurrencyOf::<T>::transfer(&reserve.free, &receiver, free, ExistenceRequirement::AllowDeath);
debug_assert!(result.is_ok(), "free transfer failed after we checked in ensure_can_withdraw");

I would suggest this method if the worst case scenario is that someone doesn't get all of their funds, and that can be resolved after the fact.

Copy link
Contributor

@shawntabrizi shawntabrizi Oct 27, 2021

Choose a reason for hiding this comment

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

Could also use #[transactional] on this extrinsic if you are really worried that maybe some underlying assumption could be wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went for trying the transfers and vesting and if there is any error we dispatch a specific error event. It feels the safest option. If there is a problem we get notified and can handle that manually. But that should not be possible after the checks.
a83a697


// Transfer the vested amount and set the vesting schedule. Should not fail
// since checked we ensure_can_withdraw.
CurrencyOf::<T>::transfer(&reserve.vested, &receiver, vested, ExistenceRequirement::AllowDeath)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

no ? allowed

.checked_div(&BalanceOf::<T>::from(config.vesting_length))
.unwrap_or(vested);
// vesting should not fail since we have transferred enough free balance.
VestingOf::<T>::add_vesting_schedule(&receiver, vested, per_block, config.start_block)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

no ? allowed

Copy link
Contributor

@shawntabrizi shawntabrizi Oct 27, 2021

Choose a reason for hiding this comment

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

https://github.com/paritytech/substrate/blob/master/frame/vesting/src/lib.rs#L739

can_add_vesting_schedule should be called before add_vesting_schedule

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought the can_add_vesting_schedule would check that there is enough balance that can get vested. But that's not the case. So i added it to the checks. 👍🏻

@weichweich
Copy link
Contributor Author

/bench runtime spiritnet-runtime crowdloan

@kilt-command-bot
Copy link

kilt-command-bot bot commented Oct 28, 2021

Benchmark Runtime Pallet for branch "aw-thanks" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=spiritnet-dev --steps=50 --repeat=20 --pallet=crowdloan --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/spiritnet/src/weights/crowdloan.rs --template=.maintain/runtime-weight-template.hbs

Results
Pallet: "crowdloan", Extrinsic: "set_registrar_account", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:1)

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

Model:
Time ~=    20.81
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=    20.81
              µs

Reads = 1
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_contribution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Contributions (r:1 w:1)

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

Model:
Time ~=    23.33
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    23.33
              µs

Reads = 2
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_config", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Configuration (r:0 w:1)

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

Model:
Time ~=    20.83
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=    20.83
              µs

Reads = 1
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_reserve_accounts", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Reserve (r:1 w:1)

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

Model:
Time ~=    24.08
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    24.08
              µs

Reads = 2
Writes = 1

Pallet: "crowdloan", Extrinsic: "receive_gratitude", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors Contributions (r:1 w:1)
Storage: CrowdloanContributors Configuration (r:1 w:0)
Storage: CrowdloanContributors Reserve (r:1 w:0)
Storage: System Account (r:3 w:3)
Storage: Vesting Vesting (r:1 w:1)
Storage: Balances Locks (r:1 w:1)

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

Model:
Time ~=    193.7
              µs

Reads = 8
Writes = 6

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

Model:
Time ~=    193.7
              µs

Reads = 8
Writes = 6

Pallet: "crowdloan", Extrinsic: "remove_contribution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Contributions (r:1 w:1)

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

Model:
Time ~=    24.97
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    24.97
              µs

Reads = 2
Writes = 1


kiltbot and others added 4 commits October 28, 2021 09:39
…hmarks -- benchmark --chain=spiritnet-dev --steps=50 --repeat=20 --pallet=crowdloan --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/spiritnet/src/weights/crowdloan.rs --template=.maintain/runtime-weight-template.hbs
@weichweich
Copy link
Contributor Author

/bench runtime peregrine crowdloan

@kilt-command-bot
Copy link

kilt-command-bot bot commented Oct 28, 2021

Benchmark Runtime Substrate Pallet for branch "aw-thanks" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=crowdloan --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/peregrine/src/weights/crowdloan.rs --template=.maintain/runtime-weight-template.hbs

Results
Pallet: "crowdloan", Extrinsic: "set_registrar_account", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:1)

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

Model:
Time ~=    21.02
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=    21.02
              µs

Reads = 1
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_contribution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Contributions (r:1 w:1)

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

Model:
Time ~=    23.36
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    23.36
              µs

Reads = 2
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_config", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Configuration (r:0 w:1)

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

Model:
Time ~=    20.77
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=    20.77
              µs

Reads = 1
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_reserve_accounts", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Reserve (r:1 w:1)

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

Model:
Time ~=    24.49
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    24.49
              µs

Reads = 2
Writes = 1

Pallet: "crowdloan", Extrinsic: "receive_gratitude", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors Contributions (r:1 w:1)
Storage: CrowdloanContributors Configuration (r:1 w:0)
Storage: CrowdloanContributors Reserve (r:1 w:0)
Storage: System Account (r:3 w:3)
Storage: Vesting Vesting (r:1 w:1)
Storage: Balances Locks (r:1 w:1)

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

Model:
Time ~=    198.6
              µs

Reads = 8
Writes = 6

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

Model:
Time ~=    198.6
              µs

Reads = 8
Writes = 6

Pallet: "crowdloan", Extrinsic: "remove_contribution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Contributions (r:1 w:1)

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

Model:
Time ~=    25.01
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    25.01
              µs

Reads = 2
Writes = 1


…hmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=crowdloan --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/peregrine/src/weights/crowdloan.rs --template=.maintain/runtime-weight-template.hbs
@weichweich
Copy link
Contributor Author

/bench runtime pallet crowdloan

@kilt-command-bot
Copy link

kilt-command-bot bot commented Oct 28, 2021

Benchmark Runtime Pallet for branch "aw-thanks" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=crowdloan --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=pallets/crowdloan/src/default_weights.rs --template=.maintain/weight-template.hbs

Results
Pallet: "crowdloan", Extrinsic: "set_registrar_account", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:1)

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

Model:
Time ~=    20.16
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=    20.16
              µs

Reads = 1
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_contribution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Contributions (r:1 w:1)

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

Model:
Time ~=    22.72
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    22.72
              µs

Reads = 2
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_config", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Configuration (r:0 w:1)

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

Model:
Time ~=     20.5
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=     20.5
              µs

Reads = 1
Writes = 1

Pallet: "crowdloan", Extrinsic: "set_reserve_accounts", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Reserve (r:1 w:1)

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

Model:
Time ~=    23.93
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    23.93
              µs

Reads = 2
Writes = 1

Pallet: "crowdloan", Extrinsic: "receive_gratitude", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors Contributions (r:1 w:1)
Storage: CrowdloanContributors Configuration (r:1 w:0)
Storage: CrowdloanContributors Reserve (r:1 w:0)
Storage: System Account (r:3 w:3)
Storage: Vesting Vesting (r:1 w:1)
Storage: Balances Locks (r:1 w:1)

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

Model:
Time ~=    194.1
              µs

Reads = 8
Writes = 6

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

Model:
Time ~=    194.1
              µs

Reads = 8
Writes = 6

Pallet: "crowdloan", Extrinsic: "remove_contribution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: CrowdloanContributors RegistrarAccount (r:1 w:0)
Storage: CrowdloanContributors Contributions (r:1 w:1)

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

Model:
Time ~=    24.97
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    24.97
              µs

Reads = 2
Writes = 1


…hmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=crowdloan --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=pallets/crowdloan/src/default_weights.rs --template=.maintain/weight-template.hbs
weichweich and others added 3 commits October 28, 2021 10:54
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
@weichweich weichweich enabled auto-merge (squash) October 28, 2021 09:19
@weichweich weichweich merged commit 4ed56d1 into develop Oct 28, 2021
@weichweich weichweich deleted the aw-thanks branch October 28, 2021 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants