This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Staking Reward Rate Runtime API #13416
Staking Reward Rate Runtime API #13416
Changes from all commits
710bab9
11c4f61
3268088
ca2ed2f
a31efce
9a1175f
6ca5f9a
fedd974
ce15e86
174fc7b
2b14048
2e1524d
3250e02
11209f2
5be4a45
85795cf
24ee1db
4cc19cc
560f144
9699959
a665ec0
b35c166
8dd63af
a5cc54d
e08a2fd
37b0fbf
7763889
705f381
b990b97
8bed2de
d5924c7
33db2ea
9495f16
f51f33c
8de9751
75f70bc
a5a70b1
28bf6c6
42d5b8a
a86ebcd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 traitEraPayout
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 yearpayout(current_total_staked, current_total_issuance, one_year)
.This doesn't look so good, but could be fine.
Better would be to:
EraPayout
trait to be able to retrieve the reward rateThere 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.