Open
Description
Description
Currently there are several queries that are impossible to answer without custom indexing of the database, like:
- How many withdrawals has validator
N
received? - How many block proposals has validator
N
had? - In which slot did validator
N
have their voluntary exit included on chain?
There are few ways we could improve this:
- Add this functionality to
beacon.watch
and promote runningbeacon.watch
for these sorts of use-cases. - Index this data by default when running an archive node. With
tree-states
this shouldn't consume too much space. - Optionally index this data when certain flags are provided, e.g.
--index=withdrawals,exits
. - Implement a "plug-in" system that allows users to define their own "tables" derived from the block/state data. This could be quite cool, and all the above queries could be implemented in terms of this plug-in system. The hard part would be making the plugins dynamically load-able (we can't load Rust code at runtime). We might have to use a scripting language or lightweight VM (WASM? eBPF?). It may not be worth the complexity.
It's also possible we could index data just for a few user-specified indices, which would be more space-efficient but also more complicated.
Version
Lighthouse v5.1.0