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

update godoc for VerifyClientMessage #1281

Merged
merged 7 commits into from
Apr 27, 2022

Conversation

colin-axner
Copy link
Contributor

Description

closes: #1185


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

Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

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

Just couple of nits. :)

modules/core/exported/client.go Outdated Show resolved Hide resolved
modules/core/exported/client.go Show resolved Hide resolved
colin-axner and others added 2 commits April 21, 2022 17:38
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
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.

Just a side note, should we re-order the interface definitions on ClientState so that these 4 new functions read in order of expected execution.
E.g.

  • VerifyClientMessage
  • CheckForMisbehaviour
  • UpdateStateOnMisbehaviour
  • UpdateState

@colin-axner
Copy link
Contributor Author

Just a side note, should we re-order the interface definitions on ClientState so that these 4 new functions read in order of expected execution.

Yup great idea!

// UpdateState updates and stores as necessary any associated information for an IBC client, such as the ClientState and corresponding ConsensusState.
// An error is returned if ClientMessage is of type Misbehaviour
// An error is returned if ClientMessage is of type Misbehaviour. It assumes the ClientMessage has already been verified.
UpdateState(sdk.Context, codec.BinaryCodec, sdk.KVStore, ClientMessage) error
Copy link
Member

Choose a reason for hiding this comment

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

Sorry if we've discussed this point already. Why can't CheckForMisbehaviour be in UpdateState?

Is it to make the check explicit for light client developers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it to make the check explicit for light client developers?

It's two fold:

  • make the check explicit to light client developers
  • not doing it would require the API to return that misbehaviour has been detected and the client frozen (since we emit different events)

@colin-axner colin-axner enabled auto-merge (squash) April 27, 2022 14:09
@colin-axner colin-axner merged commit 55b115a into 02-client-refactor Apr 27, 2022
@colin-axner colin-axner deleted the colin/1185-update-godoc branch April 27, 2022 14:17
oshorefueled pushed a commit to ComposableFi/ibc-go that referenced this pull request Aug 9, 2022
* update godoc

* Update modules/core/exported/client.go

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

* update UpdateState godoc

* reorganize interface functions logically

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants