-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
…nt and NominationPoolsApi_pointsToBalance runtime APIs
Co-authored-by: Anton <[email protected]>
Co-authored-by: Anton <[email protected]>
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.
@gpestana I've left comments where I've added the inflation API.
Also a part of #13069 |
bot rebase |
Rebased |
bot rebase |
Rebased |
The CI pipeline was cancelled due to failure one of the required jobs. |
@@ -974,6 +974,46 @@ impl<T: Config> Pallet<T> { | |||
} | |||
|
|||
impl<T: Config> Pallet<T> { | |||
/// Returns the current staking reward rate. | |||
pub fn api_reward_rate( |
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.
Staking is currently unaware of the reward rate, this implementation makes assumption on the implementation of Config
trait.
The payout is abstracted through associated type Config::EraPayout
which bounds the trait EraPayout
Either some assumption should be enforced on the implementation of EraPayout
on the rate can be retrieved by calling the payout for an era of one year payout(current_total_staked, current_total_issuance, one_year)
.
This doesn't look so good, but could be fine.
Better would be to:
- either add a method to
EraPayout
trait to be able to retrieve the reward rate - or expose the rate from the node.
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.
Indeed. The calculations currently in place were based on an outdated calculation of PJS. We can simply refer to era payout to determine the inflation on a per-era basis.
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
Addresses paritytech/polkadot-sdk#427.
staked_percent
values.polkadot companion: paritytech/polkadot#6764