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

Tier param setting call #1421

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

Dinonard
Copy link
Member

@Dinonard Dinonard commented Feb 5, 2025

Pull Request Summary

Adds set_static_tier_params extrinsic to modify tier related dApp staking parameters dynamically.
Requires root level privileges.

Additionally expands the TierParameters struct to allow changing of the weight values of the linear equation used to determine number of slots.

TODO

  • benchmarks (or delegate to move PR)

@Dinonard Dinonard added shiden related to shiden runtime astar Related to Astar runtime This PR/Issue is related to the topic “runtime”. shibuya related to shibuya labels Feb 5, 2025
@Dinonard Dinonard marked this pull request as ready for review February 5, 2025 14:09
pallets/dapp-staking/src/test/tests_types.rs Outdated Show resolved Hide resolved
TypeInfo,
)]
#[scale_info(skip_type_params(NT))]
pub struct TierParametersV8<NT: Get<u32>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion - Move this type to the v8 module

Copy link
Member Author

Choose a reason for hiding this comment

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

I've placed it here on purpose, to have everything related to v9 migration in one place.

That way we can already now remove the entire v8 migration sub module.

impl<T: Config, InitArgs: Get<(u64, u64)>> UncheckedOnRuntimeUpgrade
for VersionMigrateV8ToV9<T, InitArgs>
{
fn on_runtime_upgrade() -> Weight {
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: Is maintenance mode needed here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not needed since we do the migration in a single block.
And this won't have immediate effect (unless it's the very same block at which tier reconfig should be done).

@@ -411,15 +411,6 @@ impl DappStakingAccountCheck<AccountId> for AccountCheck {
}
}

pub struct ShidenTierSlots;
impl TierSlotsFunc for ShidenTierSlots {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice cleanup!

Copy link

Code Coverage

Package Line Rate Branch Rate Health
pallets/astar-xcm-benchmarks/src/fungible 100% 0%
precompiles/dapp-staking/src/test 0% 0%
pallets/dapp-staking/src 79% 0%
pallets/dapp-staking/rpc/runtime-api/src 0% 0%
precompiles/xcm/src 69% 0%
pallets/price-aggregator/src 75% 0%
precompiles/substrate-ecdsa/src 67% 0%
chain-extensions/pallet-assets/src 54% 0%
chain-extensions/types/unified-accounts/src 0% 0%
pallets/dapp-staking/src/test 0% 0%
precompiles/sr25519/src 56% 0%
pallets/collective-proxy/src 94% 0%
pallets/ethereum-checked/src 76% 0%
pallets/vesting-mbm/src 87% 0%
primitives/src/xcm 62% 0%
precompiles/assets-erc20/src 78% 0%
precompiles/unified-accounts/src 100% 0%
pallets/collator-selection/src 87% 0%
pallets/inflation/src 90% 0%
chain-extensions/types/assets/src 0% 0%
chain-extensions/unified-accounts/src 0% 0%
precompiles/dapp-staking/src 89% 0%
pallets/dapp-staking/src/benchmarking 95% 0%
primitives/src 54% 0%
pallets/xc-asset-config/src 48% 0%
pallets/astar-xcm-benchmarks/src/generic 100% 0%
precompiles/dispatch-lockdrop/src 83% 0%
pallets/static-price-provider/src 91% 0%
pallets/astar-xcm-benchmarks/src 86% 0%
pallets/dynamic-evm-base-fee/src 85% 0%
pallets/unified-accounts/src 81% 0%
Summary 75% (3501 / 4642) 0% (0 / 0)

Minimum allowed line rate is 50%

@Dinonard
Copy link
Member Author

I will merge this after move_stake is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astar Related to Astar runtime This PR/Issue is related to the topic “runtime”. shibuya related to shibuya shiden related to shiden runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants