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

Persist evidence in equivocation handler #8502

Merged
merged 7 commits into from
Feb 5, 2021
Merged

Conversation

sahith-narahari
Copy link
Contributor

Description

closes: #8360


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@codecov
Copy link

codecov bot commented Feb 3, 2021

Codecov Report

Merging #8502 (c6f59ca) into master (2e9fd04) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8502   +/-   ##
=======================================
  Coverage   61.49%   61.49%           
=======================================
  Files         651      651           
  Lines       37250    37251    +1     
=======================================
+ Hits        22906    22907    +1     
  Misses      11942    11942           
  Partials     2402     2402           
Impacted Files Coverage Δ
server/grpc/grpc_web.go 66.66% <ø> (ø)
x/feegrant/client/cli/query.go 80.55% <ø> (ø)
x/feegrant/types/grant.go 48.64% <ø> (ø)
x/feegrant/types/msgs.go 0.00% <ø> (ø)
x/evidence/keeper/infraction.go 88.23% <100.00%> (+0.23%) ⬆️

@sahith-narahari sahith-narahari marked this pull request as ready for review February 4, 2021 06:50
@amaury1093 amaury1093 added the T: State Machine Breaking State machine breaking changes (impacts consensus). label Feb 5, 2021
@@ -119,4 +119,5 @@ func (k Keeper) HandleEquivocationEvidence(ctx sdk.Context, evidence *types.Equi

k.slashingKeeper.JailUntil(ctx, consAddr, types.DoubleSignJailEndTime)
k.slashingKeeper.Tombstone(ctx, consAddr)
k.SetEvidence(ctx, evidence)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we're duplicating TM evidences in state, correct? What do you think of #8360 (comment), to keep state lean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it's better to have consistency across evidence handling(all being present in store), and being able to query it using evidence queries. wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, it seems people generally agree about this duplication in #8360.

@@ -119,4 +119,5 @@ func (k Keeper) HandleEquivocationEvidence(ctx sdk.Context, evidence *types.Equi

k.slashingKeeper.JailUntil(ctx, consAddr, types.DoubleSignJailEndTime)
k.slashingKeeper.Tombstone(ctx, consAddr)
k.SetEvidence(ctx, evidence)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question about migrations. I'm working on in-place store migrations #8485, i.e. updating from e.g. v0.41 to v0.42 without doing a genesis dump, just modifying store in-place.

It seems that this PR will make in-place migrations impossible for v0.42, as the migration script doesn't have access to the history of blocks. Is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, without access to blockInfo it would be possible to migrate evidence store in-place.

Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to block, but it seems like this basically breaks x/upgrade. I think we need to think through the consequences a bit more before we do this and consider the how feasible tendermint/tendermint#5977 will be as an alternative in the near future.

Can someone comment on the where in place upgrades would and would not break with this change?

Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unblocking as this appears not to actually break live migrations.

Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

@amaury1093 amaury1093 added the A:automerge Automatically merge PR once all prerequisites pass. label Feb 5, 2021
@mergify mergify bot merged commit c5c049a into master Feb 5, 2021
@mergify mergify bot deleted the sahith/persist-evi branch February 5, 2021 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. T: State Machine Breaking State machine breaking changes (impacts consensus).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query Evidence doesn't return evidences
6 participants