casper-network / casper-node

Reference client for CASPER protocol
https://casper.network
Apache License 2.0
389 stars 219 forks source link

Add RPC endpoint to return rewards for a specific validator or a specific delegator for a specific era #4713

Open piotr-dziubecki opened 1 month ago

piotr-dziubecki commented 1 month ago

The existing auction info endpoint returns all of the auction info (including rewards) for a given era. As this contains all validators and all of their respective delegators, the returned data can be arbitrarily large. For consumers (such as the requesting party, BitGo) who are only concerned with a specific validator or delegator, this is inconvenient and inefficient. The new endpoint should support a request for reward info for a specific era, and specific PublicKey. The backing logic would filter the full set of rewards data for the imputed data, including records matching the imputed PublicKey and excluding all other records.

jacek-casper commented 1 week ago

I think this has already been covered in https://github.com/casper-network/casper-node/pull/4736