Skip to content

Conversation

@ipapandinas
Copy link
Contributor

@ipapandinas ipapandinas commented Apr 22, 2025

Pull Request Summary

Closes #1458

Maximum percentages are derived from an Astar token price of $0.05 (base values from dAppStaking v3 launch).
The maximum_possible_percentage value is optional. If is not specified, the default value used is 100% which reflects the entire total supply.

Check list

@ipapandinas ipapandinas added shiden related to shiden runtime dapps-staking Dapps Staking astar Related to Astar shibuya related to shibuya runtime This PR/Issue is related to the topic “runtime”. labels Apr 22, 2025
@ipapandinas ipapandinas requested a review from Dinonard April 23, 2025 18:43
Copy link
Contributor

@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.

Looks good, I just have two requests:

  • remove Option from the config
  • for migration, just specify the new max values, since you're not re-defining percentage nor minimum required percentage

Copy link
Contributor

@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.

Please update the is_valid check and let's merge it!

required_percentage: Perbill::from_parts(1_400), // 0.00014%
},
];
pub const MaxPercentages: [Option<Perbill>; 4] = [None, None, None, None];
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be good to use Some values for Shibuya, just for the sake of the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, I suggest:

pub const MaxPercentages: [Option<Perbill>; 4] = [
    Some(Perbill::from_parts(30_000)), // 0.0030%
    Some(Perbill::from_parts(20_000)), // 0.0020%
    Some(Perbill::from_parts(10_000)), // 0.0010%
    None
];

Copy link
Contributor

Choose a reason for hiding this comment

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

If it works, sure.
I don't know what the min values on Shibuya are.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

[0.0017%, 0.0010%, 0.00034%]

@github-actions
Copy link

Code Coverage

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

Minimum allowed line rate is 50%

Copy link
Contributor

@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.

LGTM

Copy link
Contributor

@PierreOssun PierreOssun left a comment

Choose a reason for hiding this comment

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

LGTM

@ipapandinas ipapandinas merged commit ef5b262 into master Apr 30, 2025
7 of 8 checks passed
@ipapandinas ipapandinas deleted the feat/max-tier-thresholds branch April 30, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astar Related to Astar dapps-staking Dapps Staking 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.

[dAppStaking] Max Tier Threshold

4 participants