-
Notifications
You must be signed in to change notification settings - Fork 496
Feat: Inflation decay factor #1536
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
Conversation
/bench astar-dev,shibuya-dev,shiden-dev pallet_inflation |
Benchmarks job is scheduled at https://github.com/AstarNetwork/Astar/actions/runs/17468312364. |
Benchmark job failed. |
/bench astar,shibuya,shiden pallet_inflation |
Benchmarks job is scheduled at https://github.com/AstarNetwork/Astar/actions/runs/17469034746. |
Benchmarks have been finished. |
/bench astar,shibuya,shiden pallet_inflation |
Benchmarks job is scheduled at https://github.com/AstarNetwork/Astar/actions/runs/17737782722. |
Benchmarks have been finished. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates.
I'm only looking at the core inflation pallet logic for now.
Right now to me it seems there are still plenty of unnecessary changes.
And we should strive to keep them to the bare minimum.
I've left some comments, and feel free to correct me if I'm wrong somewhere.
The solution described in the Github issue should need minimal changes with only:
- decay factor update in
on_initialize
- decay factor application when paying out rewards
(+ the extra extrinsic & types update)
Benchmarks job is scheduled at https://github.com/AstarNetwork/Astar/actions/runs/17771149640. |
Benchmarks have been finished. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, some suggestions & questions.
About the benchmarking part though - this now impacts the dApp staking benchmarks as well since it relies on the inflation pallet for reward numbers. I'd suggest to run benchmarks for it as well - with decay factor < 1.
/bench astar,shibuya,shiden pallet_inflation,pallet_dapp_staking |
Benchmarks job is scheduled at https://github.com/AstarNetwork/Astar/actions/runs/17805829771. |
Benchmarks have been finished. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thing came up (sorry) - did you test how it works when factor is zero?
All reward payout & calculation is still possible?
(for pallet inflation logic & dApp staking)
@Dinonard Yes, I tested this before with Chopsticks, storage migration as well. However to ensure it works as expected in the long run, I added the following e2e test AstarNetwork/e2e-tests#150 |
Great to hear. |
/bench astar,shibuya,shiden pallet_inflation,pallet_dapp_staking |
Benchmarks job is scheduled at https://github.com/AstarNetwork/Astar/actions/runs/17834841280. |
Benchmarks have been finished. |
@Dinonard I completely forgot about the integration tests, so I added one that also check for bonus rewards payouts. Weights are updated again. |
Minimum allowed line rate is |
Pull Request Summary
Closes #1520
This PR introduces a configurable per-block decay factor to Astar's inflation system.
Key changes:
decay_rate
anddecay_factor
fields (Perquintill) to InflationParameters and InflationConfiguration structs,decay_factor
is updated in on_initialize,decay_factor
,decay_rate
is updated like the other inflation paramsIt also migrates storages for all runtimes with no decay (decay_rate = Perquintill::one() & decay_factor = Perquintill::one()) and includes extra tests + weights update.
Check list**