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

fix: add relative timeout support for localhost clients using the transfer CLI client #3587

Merged
merged 9 commits into from
May 29, 2023

Conversation

damiannolan
Copy link
Member

@damiannolan damiannolan commented May 16, 2023

Description

This PR adds a little bit more code to the CLI handler in order to accommodate localhost clients.
I've implemented it as so to avoid breaking APIs which will allow it be backported for v7.1.0

closes: #3568

Commit Message / Changelog Entry

fix: add relative timeout support for localhost clients using the transfer CLI client

see the guidelines for commit messages. (view raw markdown for examples)


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 and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

modules/core/04-channel/keeper/packet.go Outdated Show resolved Hide resolved
modules/apps/transfer/client/cli/tx.go Outdated Show resolved Hide resolved
modules/apps/transfer/client/cli/tx.go Outdated Show resolved Hide resolved
}

var consensusState exported.ConsensusState
if clientState.ClientType() != exported.Localhost {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this command works for solo machines?

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we avoid checking explicitly for Localhost here? So that we don't stumble upon this problem again for future light clients that do not hold consensus state.

Copy link
Member Author

Choose a reason for hiding this comment

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

I wonder if this command works for solo machines?

I think it should.

Could we avoid checking explicitly for Localhost here?

We could and just use local clock time as the standard. But I'm happy to defer that til later, I'll open an issue for it.
But I think we should just proceed with this approach and backport for 7.1. I don't see many future client implementations not having the concept of consensus states, I think localhost is an outlier

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Solo machines don't set consensus states so it shouldn't work? This appears to be true already so happy to see it fixed in #3594

modules/apps/transfer/client/cli/tx.go Show resolved Hide resolved
}

var consensusState exported.ConsensusState
if clientState.ClientType() != exported.Localhost {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we avoid checking explicitly for Localhost here? So that we don't stumble upon this problem again for future light clients that do not hold consensus state.

@damiannolan damiannolan marked this pull request as ready for review May 16, 2023 14:26
Copy link
Contributor

@charleenfei charleenfei left a comment

Choose a reason for hiding this comment

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

nice work and catch on this issue!

@damiannolan damiannolan enabled auto-merge (squash) May 23, 2023 09:31
}

var consensusState exported.ConsensusState
if clientState.ClientType() != exported.Localhost {
Copy link
Contributor

Choose a reason for hiding this comment

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

Solo machines don't set consensus states so it shouldn't work? This appears to be true already so happy to see it fixed in #3594

@damiannolan damiannolan merged commit df2841d into main May 29, 2023
@damiannolan damiannolan deleted the damian/3568-localhost-transfer-cli-support branch May 29, 2023 20:33
mergify bot pushed a commit that referenced this pull request May 29, 2023
…nsfer CLI client (#3587)

* updating incorrect error return in 04-channel SendPacket

* support localhost transfers using relative timeouts via the CLI client

* Update modules/apps/transfer/client/cli/tx.go

Co-authored-by: colin axnér <[email protected]>

* optimise client consensus state query as per review suggestion, rm error adaptation for another PR

---------

Co-authored-by: colin axnér <[email protected]>
(cherry picked from commit df2841d)
damiannolan added a commit that referenced this pull request May 30, 2023
…nsfer CLI client (#3587) (#3690)

* updating incorrect error return in 04-channel SendPacket

* support localhost transfers using relative timeouts via the CLI client

* Update modules/apps/transfer/client/cli/tx.go

Co-authored-by: colin axnér <[email protected]>

* optimise client consensus state query as per review suggestion, rm error adaptation for another PR

---------

Co-authored-by: colin axnér <[email protected]>
(cherry picked from commit df2841d)

Co-authored-by: Damian Nolan <[email protected]>
@faddat faddat mentioned this pull request Jun 23, 2023
9 tasks
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.

Failed to send localhost ibc transfer
4 participants