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

DappsStaking bench improvements #112

Merged
merged 5 commits into from
Nov 9, 2022
Merged

Conversation

shunsukew
Copy link
Member

@shunsukew shunsukew commented Nov 8, 2022

Pull Request Summary
Dapps Staking CurrentEra storage value is accessed by on_initialize hook at every block.
That means current era value is available in overlay cache, thus we can ignore storage access from benchmarking.

New attribute macro #[pallet::whitelist_storage] registers Storage items to whitelists (which will be ignored in benchmarking), see more details paritytech/substrate#12205.

This requires Astar repo updates too, but adding attribute can be done independently.

This PR fixes format issue as well cargo fmt, taplo fmt to pass merge blocking.

@shunsukew shunsukew marked this pull request as ready for review November 8, 2022 07:28
@shunsukew shunsukew changed the title bench improvements DappsStaking bench improvements Nov 8, 2022
@shunsukew shunsukew requested review from Dinonard, 0x7CFE and akru November 8, 2022 07:34
@@ -114,6 +114,7 @@ pub mod pallet {

/// The current era index.
#[pallet::storage]
#[pallet::whitelist_storage]
Copy link
Member

Choose a reason for hiding this comment

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

Since we're doing this, please whitelist all necessary storage:

  • PalletDisabled
  • ForceEra
  • NextEraStartingBlock

Copy link
Member Author

Choose a reason for hiding this comment

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

That's true. I updated. thank you for pointing out

@shunsukew shunsukew requested a review from Dinonard November 9, 2022 07:09
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!

Please also bump the minor version in .toml file before merging.

@shunsukew shunsukew merged commit bdd4d43 into polkadot-v0.9.30 Nov 9, 2022
@shunsukew shunsukew deleted the ds-bench-improvement branch November 9, 2022 16:40
@github-actions
Copy link

github-actions bot commented Nov 9, 2022

Code Coverage

Package Line Rate Branch Rate Health
frame/dapps-staking/src/pallet 90% 0%
precompiles/substrate-ecdsa/src 78% 0%
frame/block-reward/src 85% 0%
precompiles/utils/src 72% 0%
chain-extensions/types/xvm/src 0% 0%
frame/xc-asset-config/src 70% 0%
precompiles/assets-erc20/src 73% 0%
frame/pallet-xcm/src 65% 0%
frame/dapps-staking/src 83% 0%
precompiles/utils/macro/src 0% 0%
precompiles/sr25519/src 79% 0%
precompiles/xvm/src 94% 0%
primitives/xcm/src 68% 0%
chain-extensions/types/rmrk/src 0% 0%
frame/pallet-xvm/src/pallet 34% 0%
frame/pallet-xvm/src 11% 0%
chain-extensions/types/dapps-staking/src 0% 0%
chain-extensions/dapps-staking/src 0% 0%
frame/custom-signatures/src 57% 0%
chain-extensions/rmrk/src 0% 0%
precompiles/utils/macro/tests 0% 0%
frame/collator-selection/src 80% 0%
precompiles/dapps-staking/src 93% 0%
precompiles/xcm/src 84% 0%
precompiles/utils/src/data 72% 0%
chain-extensions/xvm/src 0% 0%
Summary 60% (2577 / 4328) 0% (0 / 0)

Minimum allowed line rate is 50%

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