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

feat: rpc query service for returning the UpgradeSequence stored in state for a specific port/channel pair #3360

Merged
merged 28 commits into from
Mar 29, 2023

Conversation

charleenfei
Copy link
Contributor

Description

  • adds the rpc query service for returning the UpgradeSequence stored in state for the provided port and channel identifiers.

closes: #1902

Commit Message / Changelog Entry

feat:  rpc query service for returning the UpgradeSequence stored in state for a specific port/channel pair

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.

// QueryUpgradeSequenceResponse is the response type for the QueryUpgradeSequence RPC method
message QueryUpgradeSequenceResponse {
uint64 upgrade_sequence = 1;
bytes proof = 2;
Copy link
Contributor Author

@charleenfei charleenfei Mar 28, 2023

Choose a reason for hiding this comment

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

do we need the proof in the response proto? i see it in the NextSequenceReceive query but it seems to always be set to nil

Copy link
Contributor Author

Choose a reason for hiding this comment

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

an unrelated question: do we need the cli commands for this query as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

do we need the proof in the response proto? i see it in the NextSequenceReceive query but it seems to always be set to nil

I believe the reason is that there is not support in SDK/Comet to generate proofs for a given key/value . @colin-axner opened this issue in the SDK a while back.

an unrelated question: do we need the cli commands for this query as well?

I think we have CLIs for all gRPC, soI would say that we also add it for consistency? What others think?

Copy link
Member

Choose a reason for hiding this comment

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

IIRC some of the channel CLIs use a --prove flag and based off that flag an ABCI query can be done directly to tendermint rpc.

Unsure if there's any consistency to which ones contain the --prove flag and which do not. Haven't checked in depth. You may as well go ahead and add it!

Copy link
Contributor Author

@charleenfei charleenfei Mar 29, 2023

Choose a reason for hiding this comment

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

I believe the reason is that there is not support in SDK/Comet to generate proofs for a given key/value . @colin-axner opened cosmos/cosmos-sdk#7036 in the SDK a while back.

yes, I remember this issue from the relayers having to always query the tendermint rpc instead of being able to query proofs from the grpc endpoint. I guess the question is if we want to plan for a (possible?) future of a proof returned via grpc by still putting in the proof field in the response body, even if now it will always return nil, or just remove that proof field.

EDIT i see the cli util implemented which handles the --prove flag, i'll do it that way then.

Base automatically changed from damian/1618-chan-upgrade-init to 04-channel-upgrades March 28, 2023 11:20
@charleenfei charleenfei marked this pull request as ready for review March 28, 2023 12:10
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.

Nice work, @charleenfei!

// QueryUpgradeSequenceResponse is the response type for the QueryUpgradeSequence RPC method
message QueryUpgradeSequenceResponse {
uint64 upgrade_sequence = 1;
bytes proof = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need the proof in the response proto? i see it in the NextSequenceReceive query but it seems to always be set to nil

I believe the reason is that there is not support in SDK/Comet to generate proofs for a given key/value . @colin-axner opened this issue in the SDK a while back.

an unrelated question: do we need the cli commands for this query as well?

I think we have CLIs for all gRPC, soI would say that we also add it for consistency? What others think?

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.

Looks good to me! May as well add a CLI in this PR too?

Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

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

Nice job looks super clean! 🥇

@charleenfei charleenfei enabled auto-merge (squash) March 29, 2023 13:06
@charleenfei charleenfei merged commit 7748ed9 into 04-channel-upgrades Mar 29, 2023
@charleenfei charleenfei deleted the charly/1902-upgrade-sequence branch March 29, 2023 13:13
@charleenfei charleenfei mentioned this pull request Apr 25, 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.

4 participants