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: Add QueryAllPairsValConAddrByConsumerChainID #1503

Merged

Conversation

ThanhNhann
Copy link
Contributor

Closes: #1251

This PR adds QueryAllPairsValConAddrByConsumerChainID method to get list of all pairs valConsensus address by Consummer chainID

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • Included the correct type prefix in the PR title
  • Targeted the correct branch (see PR Targeting)
  • Provided a link to the relevant issue or specification
  • Reviewed "Files changed" and left comments if necessary
  • Confirmed all CI checks have passed

@ThanhNhann ThanhNhann requested a review from a team as a code owner December 13, 2023 11:42
@github-actions github-actions bot added C:Testing Assigned automatically by the PR labeler C:x/provider Assigned automatically by the PR labeler labels Dec 13, 2023
@ThanhNhann ThanhNhann changed the title [feat]: Add QueryAllPairsValConAddrByConsumerChainID feat: Add QueryAllPairsValConAddrByConsumerChainID Dec 13, 2023
@github-actions github-actions bot added the C:Docs Assigned automatically by the PR labeler label Dec 16, 2023
@MSalopek MSalopek self-requested a review December 19, 2023 10:56
Copy link
Contributor

@MSalopek MSalopek left a comment

Choose a reason for hiding this comment

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

@ThanhNhann
Copy link
Contributor Author

Hi @MSalopek, I see we lack a lot of tests for queries, I think we should make a pr to solve this to cover this

@mpoke
Copy link
Contributor

mpoke commented Jan 3, 2024

@ThanhNhann could you please add a changelog entry in the .changelog/unreleased/improvements/provider folder? The name of the file should be 1503-query-key-assignment.md. See https://github.com/cosmos/interchain-security/blob/main/.changelog/unreleased/improvements/1350-cleanup-types.md for an example.

@ThanhNhann
Copy link
Contributor Author

Updated it @mpoke, can you review and merge it? btw I think we should take a time to make the testing for our queries

Copy link
Contributor

@mpoke mpoke left a comment

Choose a reason for hiding this comment

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

See my comment below

x/ccv/provider/keeper/grpc_query.go Outdated Show resolved Hide resolved
x/ccv/provider/keeper/grpc_query.go Outdated Show resolved Hide resolved
Copy link
Contributor

@mpoke mpoke left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @ThanhNhann

@sainoe sainoe self-requested a review January 5, 2024 16:25
string provider_address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
// The consensus address of the validator on the consumer chain
string consumer_address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ];
tendermint.crypto.PublicKey consumer_key = 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
tendermint.crypto.PublicKey consumer_key = 3;
// The public key of the validator on the consumer chain
tendermint.crypto.PublicKey consumer_key = 3;

@sainoe sainoe self-requested a review January 5, 2024 16:30
Copy link
Contributor

@sainoe sainoe left a comment

Choose a reason for hiding this comment

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

LGTM. Just one nit.

@mpoke mpoke added this pull request to the merge queue Jan 5, 2024
Merged via the queue into cosmos:main with commit 56399f6 Jan 5, 2024
16 of 18 checks passed
mergify bot pushed a commit that referenced this pull request Jan 5, 2024
* add QueryAllPairsValConAddrByConsumerChainID

* Lint

* add pubkey in PairValConAddrProviderAndConsumer struct

* add test TestQueryAllPairsValConAddrByConsumerChainID

* add doc

* Update docs/docs/features/key-assignment.md

Co-authored-by: MSalopek <[email protected]>

* add changelog

* update with Marius Poke's suggestions

* update logic get data

---------

Co-authored-by: Du Nguyen <[email protected]>
Co-authored-by: MSalopek <[email protected]>
(cherry picked from commit 56399f6)

# Conflicts:
#	tests/e2e/tracehandler_testdata/slashThrottle.json
mpoke pushed a commit that referenced this pull request Jan 5, 2024
…#1551)

feat: Add `QueryAllPairsValConAddrByConsumerChainID` (#1503)

* add QueryAllPairsValConAddrByConsumerChainID

* Lint

* add pubkey in PairValConAddrProviderAndConsumer struct

* add test TestQueryAllPairsValConAddrByConsumerChainID

* add doc

* Update docs/docs/features/key-assignment.md

Co-authored-by: MSalopek <[email protected]>

* add changelog

* update with Marius Poke's suggestions

* update logic get data

---------

Co-authored-by: Du Nguyen <[email protected]>
Co-authored-by: MSalopek <[email protected]>
(cherry picked from commit 56399f6)

# Conflicts:
#	tests/e2e/tracehandler_testdata/slashThrottle.json

Co-authored-by: Nguyen Thanh Nhan | Decentrio <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Docs Assigned automatically by the PR labeler C:Testing Assigned automatically by the PR labeler C:x/provider Assigned automatically by the PR labeler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature requires: We need a query which can return all rotated validator keys by consumer chain_id
5 participants