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

refactor: modify CheckMisbehaviourAndUpdateState to set client state #595

Conversation

colin-axner
Copy link
Contributor

@colin-axner colin-axner commented Dec 6, 2021

Description

Removes the client state return value from CheckMisbehaviourAndUpdateState. Llight clients are expected to set the client state in the client store after verifying misbehaviour

closes: #285


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

removes the client state return value from CheckMisbehaviourAndUpdateState
light clients are expected to set the client state in the client store after verifying misbehaviour
fixed tests
@codecov-commenter
Copy link

codecov-commenter commented Dec 6, 2021

Codecov Report

Merging #595 (195709e) into 02-client-refactor (d5e2ba5) will increase coverage by 0.01%.
The diff coverage is 88.88%.

Impacted file tree graph

@@                  Coverage Diff                   @@
##           02-client-refactor     #595      +/-   ##
======================================================
+ Coverage               79.85%   79.86%   +0.01%     
======================================================
  Files                     150      150              
  Lines                   10803    10809       +6     
======================================================
+ Hits                     8627     8633       +6     
  Misses                   1752     1752              
  Partials                  424      424              
Impacted Files Coverage Δ
modules/core/02-client/legacy/v100/solomachine.go 6.55% <0.00%> (ø)
...clients/07-tendermint/types/misbehaviour_handle.go 84.41% <83.33%> (+0.20%) ⬆️
modules/core/02-client/keeper/client.go 98.21% <100.00%> (-0.02%) ⬇️
...lients/06-solomachine/types/misbehaviour_handle.go 93.87% <100.00%> (+0.26%) ⬆️
modules/light-clients/07-tendermint/types/store.go 79.18% <100.00%> (+0.43%) ⬆️
...s/light-clients/09-localhost/types/client_state.go 93.19% <100.00%> (ø)

@colin-axner colin-axner changed the title modify CheckMisbehaviourAndUpdateState to set client state refactor: modify CheckMisbehaviourAndUpdateState to set client state Dec 6, 2021
Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

So CheckMisbehaviourAndUpdateState and VerifyUpgradeAndUpdateState were always supposed to update the client state but it was being done outside the scope of the functions?

So this just shifts the responsibility directly to the lightclient implementation as opposed to 02-client, is that correct? 🤔

@colin-axner colin-axner changed the base branch from main to 02-client-refactor March 7, 2022 13:24
@colin-axner colin-axner marked this pull request as ready for review March 8, 2022 11:32
@colin-axner
Copy link
Contributor Author

This function will be removed so these changes are unnecessary

@colin-axner colin-axner closed this Mar 8, 2022
@colin-axner colin-axner deleted the colin/285-modify-checkmisbehaviourandupdatestate branch April 13, 2022 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modify CheckMisbehaviourAndUpdateState to set client/consensus state in light client implementations
3 participants