New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: Provide a way to query validators' jails and their reasoning #20188
Comments
This is a very good idea. Needs some work in the Cosmos-SDK to make it happen. @tac0turtle what's your take? |
I guess this is how it might be done (consider this comment a mini-ADR lol):
Unlikely that we can generate jail infos for previous jails, so I guess we can only track new jails. Feel free to assign me to do this btw, sounds like a challenge lol. |
this goes into a larger conversation around state management. State machine vs client. I think we should delete all information within modules that is not needed for the state machine. Then we have a side car process that indexes things related to querying. It would be like the tx_index.db of comet but have lots more information. Application developers could have a state machine schema and a query/client schema which would translate the state machine data + events into the schema needed for queries. The more information we add to the node directly and consensus the slower the overall state machine becomes, even with small amounts of information. We have been discussing this internally and are thinking through different designs. Once we have agreement we will begin to build something out. |
@tac0turtle is there an issue for discussing this sidecar approach? |
We dont store this information on chain as it was meant to be indexed via events or some other service. If we were to add it nodes would not have any legacy information. With the side car process we would be able to go back in time and extract the information. ill update this issue with the current discussions #18000 |
This is very good idea, as our validator was constantly getting jailed recently without clear reason, only discussion in Discord community helped us to address the issue. May be there is also good idea to add more info in the node logs, right now it just writes:
But there is no any reason or additional info. |
there is definitely more information on why. Have you looked at the events? |
I agree, there are some info in the events, but it is hard to create relation sometimes between event message as a jail reason. I mean to make it more user friendly and include more info in the same entry about jail. |
So i guess the debate here is that @tac0turtle feels that extraneous information should not be kept in state if you can just look it up in events. That's definitely a fair point and it's a common practice in blockchain development. @freak12techno feels that this may be true, but in this case the extra information is so useful that it should be stored. I should probably know this, but what would the command be to get a focused query to find out exactly why a validator was jailed, using events? Like, filtering for only jailing events with their address. Is that possible? That would probably satisfy @freak12techno's use case without adding any state bloat. |
One more point: IMO the issue @tac0turtle outlined isn't really blocking the development of this, I think we can add it to the staking module and store it in the same db the same way we store for example delegations, then later, once the sidecar is introduced, move it there (as we'll have to move a lot of stuff to the sidecar anyways I guess?), what do you think of that? @jtremback @tac0turtle Also, jails aren't a thing that happen quite often, like delegations, so IMO they shouldn't add that much of an overhead. About finding out a reason why the validator was jailed: IMO ideally it should be a CLI command that allows you to see your latest jails and why they happened, or a query, or both (ideally both, as it's useful not only for validators, but for other people who build on Cosmos, like for explorers, so they can display validators' slashing history). Can this be done via events? As far as I know most of the |
Summary
Add a query or something similar to return validators' jails and why did they happen.
Problem Definition
Currently there's no way to see the occurrences of validators' jails and why did they happen.
There's a query to get the validators' slashes from block X to block Y, but there are some jail cases when the slashing doesn't occur.
With ICS introduction, it's getting more complex, and I've personally seen and helped a few validators who got jailed for downtime on consumer chains and these jails were completely unexpected and unclear for them.
So for now I know at least 5 cases why a validator can get jailed (unbonding all of the self-stake; downtime on a provider chain; downtime on a consumer chain; double sign on a provider chain; double sign on a consumer chain), and that's not including some custom jails that some chains introduce (like on Kujira, a validator is jailed if it doesn't run a price-feeder).
I think if there's an endpoint that will return the validators' jails (ideally throughout the whole time, so they won't get pruned, like votes, and would be available even on a pruned node), with the height the validator was jailed at, jail time/whether it's permanent, maybe slashing percent, jail reason, and some metadata (like if it's ICS downtime jail, it may include which chain a validator have missed enough blocks at; ideally extendable, so if a chain has a custom way of jailing a validator, they can put some metadata explaining the jail).
This should benefit both the validators (for example, with my example above; if they get jailed they can easily see the reason why) and the chain users in general (such a query can be highly benefitial for explorers, by showing a validators' jails history, which can lead to delegators seeing more info about their validators and being able to do their due diligence better).
Proposed Feature
The text was updated successfully, but these errors were encountered: