Open egasimus opened 1 month ago
Hi @egasimus! Right now, this is a limitation of namada. We "prune" some of the PoS data each epoch, meaning that the data you are looking for its not easily accessible and requires a more complex mechanism to query it. Unfortunately, this is not a priority for us right now and we won't look into it in the short future. As a workaround, you start a fullnode from scratch and while the fullnode is synching, you can connect an indexer.
Ill' leave the issue open and update it as soon as we start working on this.
Thanks! Fair enough. For the workaround, doesn't that mean a race between the fullnode sync and the indexer? Doesn't sound very reliable. it would be massively helpful if the node at least returned an error that the queried data has been pruned, rather than just returning empty values.
Hi @egasimus! Right now, this is a limitation of namada. We "prune" some of the PoS data each epoch, meaning that the data you are looking for its not easily accessible and requires a more complex mechanism to query it. Unfortunately, this is not a priority for us right now and we won't look into it in the short future.
As a workaround, you start a fullnode from scratch and while the fullnode is synching, you can connect an indexer.
Ill' leave the issue open and update it as soon as we start working on this.
I'm curious, would running a node with indexer = kv disrupt this pruning? or unrelated?
@Fraccaman having this data available seems like a big net gain for the "indexing community" - any chance it could be given some priority? (not top ofc but also included at some point)
@opsecx I'm not super familiar with the technical details of indexers, but I think I can offer some insight here:
The pruning occurs in the protocol, so no indexer setting would be able to disrupt or change it. However, an indexer or similar service could cache these pieces of data elsewhere while it reads them as they still exist in Namada and then persist them after they've been pruned from the namada DB.
In order to independently compute proposal results, we need to fetch voting power for each vote of each past governance proposal. To achieve this, it appears that we need the following data for each past epoch:
/vp/pos/total_stake/5000
returns total staked amount at epoch 5000/vp/pos/total_stake/5000
returns0n
/vp/pos/validator/addresses/5900
returns list of validators at epoch 5900/vp/pos/validator/addresses/5900
returns an empty list.As far as I understood from
epoched.rs
, theEpoched
struct only keeps data for a fixed number of past epochs. Could you explain why this is the case and whether there is a workaround for fetching historical data from the node?