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

dApp Staking - Threshold Issue Reimbursement #1253

Closed
3 tasks done
Dinonard opened this issue May 31, 2024 · 0 comments
Closed
3 tasks done

dApp Staking - Threshold Issue Reimbursement #1253

Dinonard opened this issue May 31, 2024 · 0 comments
Assignees
Labels
project Issue is part of an ongoing project

Comments

@Dinonard
Copy link
Member

Dinonard commented May 31, 2024

Description

After the Astar runtime upgrade which introduced oracle feed for price, thresholds for tier entry have been increased much more than it was expected. The core issue was with the formula used to calculate the difference between number of slots, and the issue was fixed here #1252.

As a result of this issue, projects have been incorrectly pushed into the lower tiers, losing rewards they would have otherwise earned.

As part of this task, a script should be written that will identify how much projects earned, how much projects should have earned, and will prepare a call to reimburse the difference.

Approach

To minimize off-chain calculation, we should use chopsticks to replay old blocks using the new fixed runtime, part of v5.39.1 release (link).

  • Runtime upgrade after which oracle values were taken into account happened here
  • The fix was deployed here, but came into effect only from the next era, after this block
  1. Identify blocks at which era change occurred after the oracle runtime upgrade (Subscan can help).
  2. From that era change to the era change after the runtime upgrade with the fix, fetch the tier assignment & calculate how much dApp earned.
  3. Spin-up chopsticks tool, and override WASM binary with the one from the v5.39.1 release, replay the block transition that triggers new era, and calculate how much each dApp earned.
  4. Using the values from 2nd and 3rd step, calculate the delta for each dAPp.
  5. Prepare a sudo batch call to reimburse the delta to reward beneficiary accounts. Funds should be fetched from the old dApp staking rewards account (link).

Required Tasks

@Dinonard Dinonard added the project Issue is part of an ongoing project label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project Issue is part of an ongoing project
Projects
None yet
Development

No branches or pull requests

2 participants