wealdtech / chaind

Apache License 2.0
99 stars 33 forks source link

Reward indexing #100

Open aBMania opened 7 months ago

aBMania commented 7 months ago

Hello,

I'm interested in indexing the detail of validators rewards returned by the /eth/v1/beacon/rewards/attestations/:epoch endpoint. Is it planned for chaind to do so ?

If so, I'd be willing to help.

mcdee commented 7 months ago

This is not something that we are looking to add, but if you wish to do so I'd accept a PR.

Due to the size of the database already, it makes sense for the information to be added to existing tables. The lowest-level table would be t_validator_epoch_summaries, which is rolled up to t_validator_day_summaries. It may also be useful to add this information to t_epoch_summaries as well.

I'd be happy to provide guidance on how to add this functionality if necessary.

aBMania commented 7 months ago

I'd be happy to provide guidance on how to add this functionality if necessary.

Sure, it'd be appreciated !

aBMania commented 6 months ago

Can you tell me what's your take on how to proceed ?

I've thought about querying the node, but it could be quite slow and necessary if all necessary information to compute detailed reward is already in the chaind db.

The way I'm trying to achieve this is by trying to compute them following the spec.