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

update dapps staking weights #122

Merged
merged 1 commit into from
Dec 20, 2022

Conversation

shunsukew
Copy link
Member

@shunsukew shunsukew commented Dec 19, 2022

Pull Request Summary
Optimized dapps staking weights by

  1. excluding cached storage item access costs. related: DappsStaking bench improvements #112

  2. executing benchmarking on a baremetal machine whose spec is closest to the substrate reference machine. https://github.com/paritytech/substrate/blob/8a3b2f2e0d4bcf9614dbf174ad2b24da6f9b0b44/frame/balances/src/weights.rs#L20.

Machine spec used

Hardware
CPU
Intel Xeon-E 2136 - 6c/12t - 3.3 GHz/4.5 GHz
RAM
32 GB ECC 2666 MHz

Data disks
2×500 GB SSD NVMe

Expansion cards
Soft RAID

machine bench result

2022-12-19 07:35:38 Running machine benchmarks...    
2022-12-19 07:36:04 
+----------+----------------+--------------+--------------+-------------------+
| Category | Function       | Score        | Minimum      | Result            |
+=============================================================================+
| CPU      | BLAKE2-256     | 1.01 GiB/s   | 1.00 GiB/s   | ✅ Pass (100.1 %) |
|----------+----------------+--------------+--------------+-------------------|
| CPU      | SR25519-Verify | 658.82 KiB/s | 666.00 KiB/s | ✅ Pass ( 98.9 %) |
|----------+----------------+--------------+--------------+-------------------|
| Memory   | Copy           | 14.51 GiB/s  | 14.32 GiB/s  | ✅ Pass (101.3 %) |
|----------+----------------+--------------+--------------+-------------------|
| Disk     | Seq Write      | 1.36 GiB/s   | 450.00 MiB/s | ✅ Pass (310.4 %) |
|----------+----------------+--------------+--------------+-------------------|
| Disk     | Rnd Write      | 497.77 MiB/s | 200.00 MiB/s | ✅ Pass (248.9 %) |
+----------+----------------+--------------+--------------+-------------------+
From 5 benchmarks in total, 5 passed and 0 failed (10% fault tolerance).    
2022-12-19 07:36:04 The hardware meets the requirements

In addition to machine benchmarks to see if machine requirement is met, I did pallet bench for pallet-balances and compare calculated weights with ones in the official substrate repo. This one (Intel(R) Xeon(R) E-2136 CPU @ 3.30GHz) is the most closest to it, others are more performant than this one.

For more info,
pallet-balances weights
actual in substrate vs tested on Intel(R) Xeon(R) E-2136 CPU @ 3.30GHz

@shunsukew shunsukew marked this pull request as ready for review December 20, 2022 03:56
@shunsukew shunsukew requested review from akru, bLd75 and Dinonard December 20, 2022 03:56
@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Health
precompiles/dapps-staking/src 93% 0%
chain-extensions/types/rmrk/src 0% 0%
precompiles/sr25519/src 79% 0%
precompiles/utils/src 72% 0%
frame/pallet-xvm/src 11% 0%
frame/custom-signatures/src 54% 0%
frame/dapps-staking/src 90% 0%
chain-extensions/types/xvm/src 0% 0%
frame/pallet-xcm/src 64% 0%
chain-extensions/types/dapps-staking/src 0% 0%
precompiles/substrate-ecdsa/src 78% 0%
frame/collator-selection/src 80% 0%
frame/xc-asset-config/src 67% 0%
precompiles/assets-erc20/src 73% 0%
precompiles/utils/macro/src 0% 0%
precompiles/utils/macro/tests 0% 0%
precompiles/utils/src/data 72% 0%
precompiles/xcm/src 84% 0%
frame/block-reward/src 85% 0%
frame/dapps-staking/src/pallet 88% 0%
primitives/xcm/src 66% 0%
precompiles/xvm/src 94% 0%
frame/pallet-xvm/src/pallet 33% 0%
chain-extensions/dapps-staking/src 0% 0%
chain-extensions/xvm/src 0% 0%
chain-extensions/rmrk/src 0% 0%
Summary 60% (2559 / 4279) 0% (0 / 0)

Minimum allowed line rate is 50%

Copy link
Member

@Dinonard Dinonard left a comment

Choose a reason for hiding this comment

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

Great!

Might I suggest doing this for ALL our pallets?

@shunsukew
Copy link
Member Author

shunsukew commented Dec 20, 2022

@Dinonard
Yes, that's I was also thinking. but In a different task PR since not included in original planning.

@shunsukew shunsukew merged commit ce772cc into polkadot-v0.9.33 Dec 20, 2022
@shunsukew shunsukew deleted the update-dapps-staking-weights branch December 20, 2022 14:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants