penumbra-zone / web

Apache License 2.0
12 stars 15 forks source link

Jailed validators are not correctly removed from the set of active validators #1453

Closed turbocrime closed 2 months ago

turbocrime commented 2 months ago

Not all validators are returned in a ValidatorInfoResponse, even if the flag showInactive is true.

This means that some classes of validator, including jailed validators, will fail to transition out of 'active' state.

The block processor should either

  1. clear the validator table every time it updates validator info, instead of upserting.
  2. or, compare the list of returned validators to the table, to identify validators missing from the response.

If (2) then the block processor could specifically query validator info for specific validators that the user may be interested in.

turbocrime commented 2 months ago

validator assets will remain in the asset table. is it important to somehow identify those assets as belonging to jailed or inactive validators?

Valentine1898 commented 2 months ago

If (2) then the block processor could specifically query validator info for specific validators that the user may be interested in.

It sounds like a privacy leak

erwanor commented 2 months ago

It sounds like a privacy leak

I don't think that's the case, because those extra calls are done systematically, rather than based on specific user activity.

This is an extension of the strategy of fetching the entire active set, only to account for a limited RPC response we have to detect validators that have stopped being indexed by the chain (i.e., jailed or tombstoned) and fetch specific rate data for those identities. This is done by everyone on every modern epoch transition though.

erwanor commented 2 months ago

I think what we really want to avoid (and OP doesn't suggest this) is detecting that we have stale rate data when processing user actions, and doing an extra call then. That solves the problem of stale rate data, but telegraphs to the RPC what the user is doing in real time.

Valentine1898 commented 2 months ago
  1. clear the validator table every time it updates validator info, instead of upserting.

We can't remove data about jailed validators, because users may have stakes in those validators, and we have to provide a way to undelegate or redelegate. And this actually creates another sync issue, by sync only the modern block we may lose some validators and some stakes. Example: Epoch 2: the validator has joined the network Epoch 3: user delegates tokens to validator Epoch 4: validator jailed

If the user sync from the beginning after epoch 5 and the validator remains jailed, we will never know about the existence of this validator and will lose the user stake

Valentine1898 commented 2 months ago

Given a high priority because many users are facing the effects of this issue in mainnet

fyi @grod220

Image

Image

Image

Valentine1898 commented 2 months ago

We can't remove data about jailed validators, because users may have stakes in those validators, and we have to provide a way to undelegate or redelegate. And this actually creates another sync issue, by sync only the modern block we may lose some validators and some stakes. Example: Epoch 2: the validator has joined the network Epoch 3: user delegates tokens to validator Epoch 4: validator jailed

If the user sync from the beginning after epoch 5 and the validator remains jailed, we will never know about the existence of this validator and will lose the user stake

@erwanor what do you think about that? I don't see a way to get jailed validators in the modern epoch. This means that if a user had a stake on a validator that is now jailed, we wouldn't be able to display it.

turbocrime commented 2 months ago

users are complaining about this and it is now more urgent

grod220 commented 2 months ago

Closed by: https://github.com/penumbra-zone/web/pull/1640 https://github.com/penumbra-zone/web/pull/1643