Cosmos-sdk: Query Evidence doesn't return evidences

Created on 18 Jan 2021  Â·  11Comments  Â·  Source: cosmos/cosmos-sdk

Summary of Bug

The existing query evidence doesn't return handled evidences.

The issue may be because we're not storing the evidence here, it's only being handled but not committed to the store
https://github.com/cosmos/cosmos-sdk/blob/9856327d95eba4c3ae2d15d26a76ad3ac17b20b8/x/evidence/keeper/infraction.go#L25

Version

master

Steps to Reproduce

Simulate a validator double sign on a network using simapp

cc @alessio @tessr


For Admin Use

  • [ ] Not duplicate issue
  • [ ] Appropriate labels applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned

Most helpful comment

This seems like something that could/ should be in a post stargate upgrade to me.

All 11 comments

Yes this was confusing to me. In reading the spec it says all submitted valid evidence is persisted. This is not the case for tendermint based evidence but is the case when it's submitted through the SubmitEvidence method. Not sure how important this is for stargate since the evidence from Tendermint can be queried through blocks but it would be a breaking change (I believe)

yes, this seems to be inconsistent with the behavior of SubmitEvidence and looks like a breaking change.

Note there are two means of evidence handling and submission:

  1. Automatically which is sent by Tendermint and handled in BeginBlock. This is NOT persisted as it's not externally submitted.
  2. Manually handled by external submission. _If_ valid, these will be persisted.

I suppose the doc should make this distinction clear.

thanks, in that case this seems to be intended behavior and not a bug

One question, from application standpoint wouldn't we want sdk to offer a way to query such incidents?

There grpc query method _could_ just query tendermint for this evidence. I'd rather not 1) make a state breaking change for this now and 2) unnecessarily duplicate tendermint state in SDK modules.

This seems like something that could/ should be in a post stargate upgrade to me.

thanks, in that case this seems to be intended behavior and not a bug

Correct. This was always the behavior. All versions of the hub never persisted evidence submitted automatically by Tendermint.

If there's consensus that we need this post stargate, I can make a PR for the same

I think that, even if this is the intended behavior, there's probably something to be done to make it less confusing/surprising.

I think that, even if this is the intended behavior, there's probably something to be done to make it less confusing/surprising.

Yes, just also persist evidence in HandleEquivocationEvidence (any all infraction handlers).

Was this page helpful?
0 / 5 - 0 ratings