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

dAppStakingV3 - Tier Thresolds Derivation #1367

Closed
ipapandinas opened this issue Aug 5, 2024 · 1 comment · Fixed by #1376
Closed

dAppStakingV3 - Tier Thresolds Derivation #1367

ipapandinas opened this issue Aug 5, 2024 · 1 comment · Fixed by #1376
Assignees
Labels
enhancement New feature or request

Comments

@ipapandinas
Copy link

ipapandinas commented Aug 5, 2024

This PR will be merged soon. For additional context, a forum post explains the motivation.

This feature introduces a storage migration from v7 to v8 for pallet dappStaking.

Here are the small breaking changes introduced on types:

TierThreshold enum is updated

  • DynamicTvlAmount & FixedTvlAmount variants were deleted,
  • DynamicPercentage & FixedPercentage were introduced instead.
enum TierThreshold {
    FixedPercentage { required_percentage: Perbill },
    DynamicPercentage {
        percentage: Perbill,
        minimum_required_percentage: Perbill,
    },
}

Note - Example of Perbill to Percent transformation: 35_700_000 = 3.57%

TierConfig storage value: TiersConfiguration type is refactored

  • number_of_slots field is removed,
  • tier_thresholds field type is refactored from a vector of TierThresholds to a vector of Balances (u128).

This simplifies tier threshold amounts parsing as now item 0 of the vector refers to tier 1's threshold, item 1 to tier 2's threshold, and so on. The total number of slots can still be compute summing all items in slots_per_tier vector.

@ipapandinas ipapandinas added the enhancement New feature or request label Aug 5, 2024
@bobo-k2 bobo-k2 self-assigned this Aug 21, 2024
@bobo-k2
Copy link
Contributor

bobo-k2 commented Aug 28, 2024

Resolved in #1376

@bobo-k2 bobo-k2 closed this as completed Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants