-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Rpc: introduce get_inflation_reward rpc call #16278
Conversation
d08d592
to
a574cd9
Compare
Codecov Report
@@ Coverage Diff @@
## master #16278 +/- ##
=========================================
- Coverage 80.1% 80.0% -0.1%
=========================================
Files 413 413
Lines 110490 110564 +74
=========================================
- Hits 88558 88553 -5
- Misses 21932 22011 +79 |
f178076
to
3ea4247
Compare
@CriesofCarrots was waiting for this to pass CI, but it might be good for another glance. Thanks much! |
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 nit, otherwise lgtm! Thanks for all the polish
Pull request has been modified.
Can you please also add a section in the JSON RPC API docs, as well as support in RpcClient for the new method |
@mvines on it. |
Oh as a follow-up PR, can you please use this new method in the cli as well. To avoid backwards compatibility issues for now, the cli changes could only go into master and 1.6 |
What do you think about limiting the cli to some number of previous epochs? We could add a separate command or arg to include complete rewards history. But it would be rather nice if |
Yes. I hate so much how slow it is. It worked great for the first couple epochs after pico-inflation was enabled though. How about if on
Alternatively move rewards to |
How about both? Too much? I can see different use-cases for each. |
Yeah I think probably both too |
a8e4b9b
to
503f7b7
Compare
a10ca8e
to
8cdd0b3
Compare
…nd some filter staking and voting rewards
* feat: introduce get_inflation_reward rpc call * fix: style suggestions * fix: more style changes and match how other rpc functions are defined * feat: get reward for a single epoch * feat: default to the most recent epoch * fix: don't factor out get_confirmed_block * style: introduce from impl for RpcEncodingConfigWrapper * style: bring commitment into variable * feat: support multiple pubkeys for get_inflation_reward * feat: add get_inflation_reward to rpc client * feat: return rewards in order * fix: rename pubkeys to addresses * docs: introduce jsonrpc docs for get_inflation_reward * style: early return in map (not sure which is more idiomatic) * fix: call the rpc client function args addresses as well * fix: style * fix: filter out only addresses we care about * style: make this more idiomatic * fix: change rpc client epoch to optional and include some docs edits * feat: filter out rent rewards in get_inflation_reward * feat: add option epoch config param to get_inflation_reward * feat: rpc client get_inflation_reward takes epoch instead of config and some filter staking and voting rewards (cherry picked from commit e501fa5) # Conflicts: # client/src/rpc_client.rs # core/src/rpc.rs
* feat: introduce get_inflation_reward rpc call * fix: style suggestions * fix: more style changes and match how other rpc functions are defined * feat: get reward for a single epoch * feat: default to the most recent epoch * fix: don't factor out get_confirmed_block * style: introduce from impl for RpcEncodingConfigWrapper * style: bring commitment into variable * feat: support multiple pubkeys for get_inflation_reward * feat: add get_inflation_reward to rpc client * feat: return rewards in order * fix: rename pubkeys to addresses * docs: introduce jsonrpc docs for get_inflation_reward * style: early return in map (not sure which is more idiomatic) * fix: call the rpc client function args addresses as well * fix: style * fix: filter out only addresses we care about * style: make this more idiomatic * fix: change rpc client epoch to optional and include some docs edits * feat: filter out rent rewards in get_inflation_reward * feat: add option epoch config param to get_inflation_reward * feat: rpc client get_inflation_reward takes epoch instead of config and some filter staking and voting rewards (cherry picked from commit e501fa5)
* feat: introduce get_inflation_reward rpc call * fix: style suggestions * fix: more style changes and match how other rpc functions are defined * feat: get reward for a single epoch * feat: default to the most recent epoch * fix: don't factor out get_confirmed_block * style: introduce from impl for RpcEncodingConfigWrapper * style: bring commitment into variable * feat: support multiple pubkeys for get_inflation_reward * feat: add get_inflation_reward to rpc client * feat: return rewards in order * fix: rename pubkeys to addresses * docs: introduce jsonrpc docs for get_inflation_reward * style: early return in map (not sure which is more idiomatic) * fix: call the rpc client function args addresses as well * fix: style * fix: filter out only addresses we care about * style: make this more idiomatic * fix: change rpc client epoch to optional and include some docs edits * feat: filter out rent rewards in get_inflation_reward * feat: add option epoch config param to get_inflation_reward * feat: rpc client get_inflation_reward takes epoch instead of config and some filter staking and voting rewards (cherry picked from commit e501fa5) Co-authored-by: Josh <josh.hundley@gmail.com>
* Rpc: introduce get_inflation_reward rpc call (#16278) * feat: introduce get_inflation_reward rpc call * fix: style suggestions * fix: more style changes and match how other rpc functions are defined * feat: get reward for a single epoch * feat: default to the most recent epoch * fix: don't factor out get_confirmed_block * style: introduce from impl for RpcEncodingConfigWrapper * style: bring commitment into variable * feat: support multiple pubkeys for get_inflation_reward * feat: add get_inflation_reward to rpc client * feat: return rewards in order * fix: rename pubkeys to addresses * docs: introduce jsonrpc docs for get_inflation_reward * style: early return in map (not sure which is more idiomatic) * fix: call the rpc client function args addresses as well * fix: style * fix: filter out only addresses we care about * style: make this more idiomatic * fix: change rpc client epoch to optional and include some docs edits * feat: filter out rent rewards in get_inflation_reward * feat: add option epoch config param to get_inflation_reward * feat: rpc client get_inflation_reward takes epoch instead of config and some filter staking and voting rewards (cherry picked from commit e501fa5) # Conflicts: # client/src/rpc_client.rs # core/src/rpc.rs * fix: resolve cherry-pick conflicts * fix: change bool_to_option filter_map to filter + map * style: use filter_map in place of filter + map Co-authored-by: Josh <josh.hundley@gmail.com>
Problem
There is currently no way in the RPC to get the reward for a given epoch.
Summary of Changes
Fixes #16077