Skip to content
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

Please expose the block height slashes occured at in x/evicence queries #15338

Closed
0xekez opened this issue Mar 9, 2023 · 16 comments
Closed

Please expose the block height slashes occured at in x/evicence queries #15338

0xekez opened this issue Mar 9, 2023 · 16 comments

Comments

@0xekez
Copy link

0xekez commented Mar 9, 2023

ValidatorSlashEvent does not expose the block height the slash occured. "Height is implicit within the store key" is mentioned in the docs, but unless there is a way to query the height, this is not useful to non-sdk-modules. It would be amazing to have a way to query "for a given validator, what slash events have occured" 🙏.

@github-actions github-actions bot added the needs-triage Issue that needs to be triaged label Mar 9, 2023
@alexanderbez
Copy link
Contributor

for a given validator, what slash events have occured

You can do this. You query for events where slash.address={address}.

@0xekez
Copy link
Author

0xekez commented Mar 10, 2023

You query for events where slash.address={address}.

@alexanderbez, this is not what I'm asking for or saying. I know this to be true. If you want to use this in a frontend, you need to be running a full node. There needs to be a way to query this information without one.

@0xekez
Copy link
Author

0xekez commented Mar 10, 2023

right now the infraction height isn't even included in the event: kintsugi-tech@972ac7f

@NoahSaso
Copy link

+1 this is essentially unusable to any frontend/app that consumes the SDK because of the dependency on archive nodes and speed of searching events

@tac0turtle
Copy link
Member

tac0turtle commented Mar 12, 2023

This query can be supported without needing to change the data schema. Are you trying to do this within the state machine?

@0xekez
Copy link
Author

0xekez commented Mar 13, 2023

@tac0turtle, i'm not sure what you mean by "in the state machine", would you mind expanding a little?

on the surface level, we'd like to be able to query the SDK via an RPC call to answer questions like "for a given validator, what slashes have occurred."

it would be fine if this was RPC-only, though i think a proper solution would make this queryable inside of a transaction.

@tac0turtle
Copy link
Member

tac0turtle commented Mar 13, 2023

i'm not sure what you mean by "in the state machine", would you mind expanding a little?

within a another module or smart contract.

We will look into this. It might require some more changes. Is there a timeline you are needing this feature?

@tac0turtle tac0turtle added C:x/slashing C:x/evidence T: Client UX and removed needs-triage Issue that needs to be triaged labels Mar 13, 2023
@alexanderbez
Copy link
Contributor

I have no idea what you're asking for TBH. The issue description isn't clear.

@0xekez
Copy link
Author

0xekez commented Mar 13, 2023

we'd like to be able to query the SDK via an RPC call to answer questions like "for a given validator, what slashes have occurred."

@alexanderbez i don't know how to ask this more clearly. what part of this doesn't make sense?

@0xekez
Copy link
Author

0xekez commented Mar 13, 2023

@tac0turtle thanks for the response. there is no particular timeline. for now we've written our own custom indexing to get around the problem on a fork.

@alexanderbez
Copy link
Contributor

If you're looking for indexing solutions, they already exist.

@0xekez
Copy link
Author

0xekez commented Mar 13, 2023

@alexanderbez, I'm not looking for indexing solutions. I'm looking for a way to query the SDK to get the slash history for a particular validator.

I can't tell if you're trolling or taking this seriously.

@tac0turtle
Copy link
Member

not sure why this was closed, we should still triage this and see what can be provided as the current search for evidence is subpar offchain indexing or not

@tac0turtle tac0turtle reopened this Mar 13, 2023
@kj89
Copy link

kj89 commented Jun 28, 2023

that would be amazing if we could get validator slashing details without archive node dependency

@alexanderbez
Copy link
Contributor

@0xekez and @kj89 -- the SDK does not store slashing occurrences/records in state, it only executes the actual slashing logic which, as byproduct, emits events, which you can than query (as these happen in Begin/EndBlock).

So to answer your question -- you cannot directly query the SDK for these. It would also make no sense to store these because they would only increase state bloat w/o any added benefit or use to the state machine (x/staking and x/slashing don't need to know).

@tac0turtle
Copy link
Member

Hey after much consideration we opted to create a offchain inprocess indexer to help build complex queries where data like this will live. This is in effort to reduce the IO of the state machine. This. is the epic for the work #20352

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants