-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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!(staking): remove comet crypto as a dep #20295
Conversation
WalkthroughWalkthroughThe recent updates involve transitioning from the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
utack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review Details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (10)
- baseapp/abci_test.go (4 hunks)
- baseapp/abci_utils.go (4 hunks)
- baseapp/abci_utils_test.go (2 hunks)
- baseapp/testutil/mock/mocks.go (7 hunks)
- types/staking.go (2 hunks)
- x/staking/CHANGELOG.md (1 hunks)
- x/staking/keeper/validator.go (3 hunks)
- x/staking/testutil/expected_keepers_mocks.go (2 hunks)
- x/staking/types/expected_keepers.go (2 hunks)
- x/staking/types/validator.go (2 hunks)
Files not reviewed due to errors (1)
- baseapp/abci_utils_test.go (no review received)
Additional Context Used
LanguageTool (41)
x/staking/CHANGELOG.md (41)
Near line 30: Unpaired symbol: ‘[’ seems to be missing
Context: ...## [Unreleased] ### Features * [#19537](https://github.com/cosmos/cosmos-sdk/pu...
Near line 34: Unpaired symbol: ‘[’ seems to be missing
Context: ...validators. ### Improvements * [#19779](https://github.com/cosmos/cosmos-sdk/pu...
Near line 36: Unpaired symbol: ‘[’ seems to be missing
Context: ...ingunbonding_time
to zero. * [#19277](https://github.com/cosmos/cosmos-sdk/pu...
Near line 37: Unpaired symbol: ‘[’ seems to be missing
Context: ...g just like other hooks calls. * [#18636](https://github.com/cosmos/cosmos-sdk/pu...
Near line 38: Unpaired symbol: ‘[’ seems to be missing
Context: ...ad returns appropriate errors. * [#18506](https://github.com/cosmos/cosmos-sdk/pu...
Near line 42: Unpaired symbol: ‘[’ seems to be missing
Context: ...prevent panic. ### Bug Fixes * [#19226](https://github.com/cosmos/cosmos-sdk/pu...
Near line 46: Unpaired symbol: ‘[’ seems to be missing
Context: ...rs. ### API Breaking Changes * [#20238](https://github.com/cosmos/cosmos-sdk/pu...
Near line 47: Unpaired symbol: ‘[’ seems to be missing
Context: ...ervice` as its last argument. * [#19788](https://github.com/cosmos/cosmos-sdk/pu...
Near line 48: Unpaired symbol: ‘[’ seems to be missing
Context: ...alidatorUpdateIsZero` instead. * [#19754](https://github.com/cosmos/cosmos-sdk/pu...
Near line 49: Unpaired symbol: ‘[’ seems to be missing
Context: ...AndReturnValidatorSetUpdates`. * [#19414](https://github.com/cosmos/cosmos-sdk/pu...
Near line 50: Unpaired symbol: ‘[’ seems to be missing
Context: ...nstead of individual services. * [#19742](https://github.com/cosmos/cosmos-sdk/pu...
Near line 51: Unpaired symbol: ‘[’ seems to be missing
Context: ...saddress.Codec
as argument. * [#19735](https://github.com/cosmos/cosmos-sdk/pu...
Near line 52: Unpaired symbol: ‘[’ seems to be missing
Context: ...pmodule.HasGenesis` interface. * [#18198](https://github.com/cosmos/cosmos-sdk/pu...
Near line 53: Unpaired symbol: ‘[’ seems to be missing
Context: ...y on staking in other modules. * [#17778](https://github.com/cosmos/cosmos-sdk/pu...
Near line 55: Unpaired symbol: ‘[’ seems to be missing
Context: ...per:
GetParams,
SetParams` * [#17486](https://github.com/cosmos/cosmos-sdk/pu...
Near line 58: Unpaired symbol: ‘[’ seems to be missing
Context: ...:
RedelegationQueueIterator` * [#17562](https://github.com/cosmos/cosmos-sdk/pu...
Near line 61: Unpaired symbol: ‘[’ seems to be missing
Context: ...per:
ValidatorQueueIterator` * [#17498](https://github.com/cosmos/cosmos-sdk/pu...
Near line 64: Unpaired symbol: ‘[’ seems to be missing
Context: ...ator,
IterateLastValidators` * [#17291](https://github.com/cosmos/cosmos-sdk/pu...
Near line 68: Unpaired symbol: ‘[’ seems to be missing
Context: ...ValidatorMissedBlockBitmapKey` * [#17481](https://github.com/cosmos/cosmos-sdk/pu...
Near line 71: Unpaired symbol: ‘[’ seems to be missing
Context: ...GetUnbondingDelegationTimeKey` * [#17123](https://github.com/cosmos/cosmos-sdk/pu...
Near line 72: Unpaired symbol: ‘[’ seems to be missing
Context: ...e collections forValidators
* [#17270](https://github.com/cosmos/cosmos-sdk/pu...
Near line 75: Unpaired symbol: ‘[’ seems to be missing
Context: ...DelegatorUnbondingDelegations` * [#17336](https://github.com/cosmos/cosmos-sdk/pu...
Near line 77: Unpaired symbol: ‘[’ seems to be missing
Context: ...ey,
GetREDsToValDstIndexKey` * [#17332](https://github.com/cosmos/cosmos-sdk/pu...
Near line 79: Unpaired symbol: ‘[’ seems to be missing
Context: ...,
GetREDsFromValSrcIndexKey` * [#17315](https://github.com/cosmos/cosmos-sdk/pu...
Near line 81: Unpaired symbol: ‘[’ seems to be missing
Context: ...omkeeper
:GetRedelegation
* [#17260](https://github.com/cosmos/cosmos-sdk/pu...
Near line 83: Unpaired symbol: ‘[’ seems to be missing
Context: ...ationKey,
GetDelegationsKey` * [#17288](https://github.com/cosmos/cosmos-sdk/pu...
Near line 85: Unpaired symbol: ‘[’ seems to be missing
Context: ...ypes:
GetUnbondingIndexKey`. * [#17256](https://github.com/cosmos/cosmos-sdk/pu...
Near line 86: Unpaired symbol: ‘[’ seems to be missing
Context: ...collections forUnbondingID
. * [#17260](https://github.com/cosmos/cosmos-sdk/pu...
Near line 88: Unpaired symbol: ‘[’ seems to be missing
Context: ...:
GetValidatorByConsAddrKey` * [#17248](https://github.com/cosmos/cosmos-sdk/pu...
Near line 90: Unpaired symbol: ‘[’ seems to be missing
Context: ...types:
GetUnbondingTypeKey`. * [#17063](https://github.com/cosmos/cosmos-sdk/pu...
Near line 92: Unpaired symbol: ‘[’ seems to be missing
Context: ...icalInfo,
SetHistoricalInfo` * [#17062](https://github.com/cosmos/cosmos-sdk/pu...
Near line 93: Unpaired symbol: ‘[’ seems to be missing
Context: ...ndValidatorUpdates
storage. * [#17026](https://github.com/cosmos/cosmos-sdk/pu...
Near line 95: Unpaired symbol: ‘[’ seems to be missing
Context: ...talPower,
GetLastTotalPower` * [#17335](https://github.com/cosmos/cosmos-sdk/pu...
Near line 95: Consider a shorter alternative to avoid wordiness.
Context: ...pi/cosmos/staking/v1beta1".Infraction_` in order to remove dependency between modules on st...
Near line 96: Unpaired symbol: ‘[’ seems to be missing
Context: ...ncy between modules on staking * [#17655](https://github.com/cosmos/cosmos-sdk/pu...
Near line 97: Unpaired symbol: ‘[’ seems to be missing
Context: ...d markedHist
as deprecated. * [#20295](https://github.com/cosmos/cosmos-sdk/pu...
Near line 101: Unpaired symbol: ‘[’ seems to be missing
Context: ... ### State Breaking changes * [#18841](https://github.com/cosmos/cosmos-sdk/pu...
Near line 101: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...ub.com//pull/18841) In a undelegation or redelegation if the sha...
Near line 102: Unpaired symbol: ‘[’ seems to be missing
Context: ...ntire delegation gets removed. * [#18142](https://github.com/cosmos/cosmos-sdk/pu...
Near line 103: Unpaired symbol: ‘[’ seems to be missing
Context: ...e fees while rotating the keys * [#17655](https://github.com/cosmos/cosmos-sdk/pu...
Near line 104: Unpaired symbol: ‘[’ seems to be missing
Context: ...y keep what is needed for IBC. * [#19740](https://github.com/cosmos/cosmos-sdk/pu...
Path-based Instructions (10)
types/staking.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.x/staking/types/expected_keepers.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.x/staking/CHANGELOG.md (1)
Pattern
**/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"baseapp/testutil/mock/mocks.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.x/staking/types/validator.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.baseapp/abci_utils.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.x/staking/keeper/validator.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.baseapp/abci_utils_test.go (2)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Pattern
**/*_test.go
: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"x/staking/testutil/expected_keepers_mocks.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.baseapp/abci_test.go (2)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Pattern
**/*_test.go
: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"
Learnings (2)
x/staking/types/expected_keepers.go (1)
User: alexanderbez PR: cosmos/cosmos-sdk#18506 File: x/staking/keeper/msg_server.go:64-65 Timestamp: 2023-11-20T18:25:05.369Z Learning: The error message in the `CreateValidator` function within `x/staking/keeper/msg_server.go` should clearly indicate the expected type `cryptotypes.PubKey` when a type assertion fails.
x/staking/keeper/validator.go (1)
User: alexanderbez PR: cosmos/cosmos-sdk#18506 File: x/staking/keeper/msg_server.go:64-65 Timestamp: 2023-11-20T18:25:05.369Z Learning: The error message in the `CreateValidator` function within `x/staking/keeper/msg_server.go` should clearly indicate the expected type `cryptotypes.PubKey` when a type assertion fails.
Additional comments not posted (9)
types/staking.go (1)
1-1
: Filetypes/staking.go
reviewed.x/staking/types/expected_keepers.go (1)
75-75
: The methodGetPubKeyByConsAddr
now correctly returnscryptotypes.PubKey
as per the PR objectives.x/staking/CHANGELOG.md (1)
97-97
: The changelog entry correctly documents the change in the return type ofGetValidatorByConsAddr
tocryptotypes.PubKey
.baseapp/testutil/mock/mocks.go (1)
40-43
: The mock methodGetPubKeyByConsAddr
correctly simulates the updated interface, returningcryptotypes.PubKey
.x/staking/types/validator.go (1)
478-484
: The methodCmtConsPublicKey
has been updated to returncryptotypes.PubKey
, aligning with the PR's objectives to remove dependencies on Comet crypto.baseapp/abci_utils.go (2)
19-20
: Imports updated to use Cosmos SDK'scrypto/codec
andcrypto/types
instead of Comet crypto.
30-30
: UpdatedGetPubKeyByConsAddr
to returncryptotypes.PubKey
, aligning with the removal of Comet crypto dependencies.x/staking/testutil/expected_keepers_mocks.go (1)
314-317
: Change inGetPubKeyByConsAddr
method signature correctly reflects the removal of Comet crypto dependency.baseapp/abci_test.go (1)
41-41
: Update import to usecryptocodec
from Cosmos SDK.This change aligns with the PR's objective to remove dependencies on the Comet crypto library and use Cosmos SDK's
cryptotypes
instead.
x/staking/keeper/validator.go
Outdated
// Caller receives a Cosmos SDK Pubkey type and must cast it to a comet type | ||
func (k Keeper) GetPubKeyByConsAddr(ctx context.Context, addr sdk.ConsAddress) (cryptotypes.PubKey, error) { | ||
v, err := k.GetValidatorByConsAddr(ctx, addr) | ||
if err != nil { | ||
return cmtprotocrypto.PublicKey{}, err | ||
return nil, err | ||
} | ||
|
||
pubkey, err := v.CmtConsPublicKey() | ||
if err != nil { | ||
return cmtprotocrypto.PublicKey{}, err | ||
return nil, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Several files in the codebase might be using an incorrect or undefined type for PubKey
.
- The mock implementations in
expected_keepers_mocks.go
andmocks.go
referencetypes1.PubKey
andtypes.PubKey
, which do not appear to be aliases ofcryptotypes.PubKey
based on the script results. - Further investigation is needed to correct these references to ensure consistency across the codebase.
Analysis chain
Updated GetPubKeyByConsAddr
to return cryptotypes.PubKey
, aligning with the removal of Comet crypto dependencies. Ensure that all callers handle the new return type correctly.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify all function calls to `GetPubKeyByConsAddr` handle the new return type correctly.
# Test: Search for the function usage. Expect: Only occurrences of the new return type being handled.
rg --type go $'GetPubKeyByConsAddr'
Length of output: 2603
Script:
#!/bin/bash
# Description: Verify the type definitions of `types1.PubKey` and `types.PubKey` to confirm if they are aliases of `cryptotypes.PubKey`.
# Check the type definition of `types1.PubKey`
rg --type go "type PubKey" | grep "types1"
# Check the type definition of `types.PubKey`
rg --type go "type PubKey" | grep "types"
Length of output: 186
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Out of diff range and nitpick comments (2)
x/staking/CHANGELOG.md (2)
Line range hint
102-102
: Correct grammatical error in the changelog entry.- * [#18841](https://github.com/cosmos/cosmos-sdk/pull/18841) In a undelegation or redelegation if the shares being left delegated correspond to less than 1 token (in base denom) the entire delegation gets removed. + * [#18841](https://github.com/cosmos/cosmos-sdk/pull/18841) In an undelegation or redelegation if the shares being left delegated correspond to less than 1 token (in base denom) the entire delegation gets removed.Use "an" instead of "a" before words that start with a vowel sound to ensure proper grammar.
Line range hint
54-98
: Correct the indentation of list items in the changelog.- * remove from `Keeper`: `GetParams`, `SetParams` - * remove from `types`: `GetRedelegationTimeKey` - * remove from `Keeper`: `RedelegationQueueIterator` - * remove from `types`: `GetValidatorQueueKey`, `ParseValidatorQueueKey` - * remove from `Keeper`: `ValidatorQueueIterator` - * remove from `types`: `GetLastValidatorPowerKey` - * remove from `Keeper`: `LastValidatorsIterator`, `IterateLastValidators` - * remove from `types`: `ValidatorMissedBlockBitmapPrefixKey`, `ValidatorMissedBlockBitmapKey` - * remove from `Keeper`: `UBDQueueIterator` - * remove from `types`: `GetUnbondingDelegationTimeKey` - * remove from `types`: `GetUBDsKey` - * remove from `Keeper`: `IterateUnbondingDelegations`, `IterateDelegatorUnbondingDelegations` - * remove from `types`: `GetREDByValDstIndexKey`, `GetREDsToValDstIndexKey` - * remove from `types`: `GetREDKeyFromValSrcIndexKey`, `GetREDsFromValSrcIndexKey` - * remove from `keeper`: `GetRedelegation` - * remove from `types`: `GetDelegationKey`, `GetDelegationsKey` - * remove from `types`: `GetUnbondingIndexKey`. - * remove from `types`: `GetValidatorByConsAddrKey` - * remove from `types`: `GetUnbondingTypeKey`. - * remove from `Keeper`: `GetHistoricalInfo`, `SetHistoricalInfo` - * remove from `Keeper`: `SetLastTotalPower`, `GetLastTotalPower` + * remove from `Keeper`: `GetParams`, `SetParams` + * remove from `types`: `GetRedelegationTimeKey` + * remove from `Keeper`: `RedelegationQueueIterator` + * remove from `types`: `GetValidatorQueueKey`, `ParseValidatorQueueKey` + * remove from `Keeper`: `ValidatorQueueIterator` + * remove from `types`: `GetLastValidatorPowerKey` + * remove from `Keeper`: `LastValidatorsIterator`, `IterateLastValidators` + * remove from `types`: `ValidatorMissedBlockBitmapPrefixKey`, `ValidatorMissedBlockBitmapKey` + * remove from `Keeper`: `UBDQueueIterator` + * remove from `types`: `GetUnbondingDelegationTimeKey` + * remove from `types`: `GetUBDsKey` + * remove from `Keeper`: `IterateUnbondingDelegations`, `IterateDelegatorUnbondingDelegations` + * remove from `types`: `GetREDByValDstIndexKey`, `GetREDsToValDstIndexKey` + * remove from `types`: `GetREDKeyFromValSrcIndexKey`, `GetREDsFromValSrcIndexKey` + * remove from `keeper`: `GetRedelegation` + * remove from `types`: `GetDelegationKey`, `GetDelegationsKey` + * remove from `types`: `GetUnbondingIndexKey`. + * remove from `types`: `GetValidatorByConsAddrKey` + * remove from `types`: `GetUnbondingTypeKey`. + * remove from `Keeper`: `GetHistoricalInfo`, `SetHistoricalInfo` + * remove from `Keeper`: `SetLastTotalPower`, `GetLastTotalPower`Adjust the indentation of list items to maintain consistency and readability in the changelog.
Review Details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (3)
- x/staking/CHANGELOG.md (1 hunks)
- x/staking/keeper/validator.go (3 hunks)
- x/staking/types/validator.go (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- x/staking/keeper/validator.go
- x/staking/types/validator.go
Additional Context Used
LanguageTool (41)
x/staking/CHANGELOG.md (41)
Near line 30: Unpaired symbol: ‘[’ seems to be missing
Context: ...## [Unreleased] ### Features * [#19537](https://github.com/cosmos/cosmos-sdk/pu...
Near line 34: Unpaired symbol: ‘[’ seems to be missing
Context: ...validators. ### Improvements * [#19779](https://github.com/cosmos/cosmos-sdk/pu...
Near line 36: Unpaired symbol: ‘[’ seems to be missing
Context: ...ingunbonding_time
to zero. * [#19277](https://github.com/cosmos/cosmos-sdk/pu...
Near line 37: Unpaired symbol: ‘[’ seems to be missing
Context: ...g just like other hooks calls. * [#18636](https://github.com/cosmos/cosmos-sdk/pu...
Near line 38: Unpaired symbol: ‘[’ seems to be missing
Context: ...ad returns appropriate errors. * [#18506](https://github.com/cosmos/cosmos-sdk/pu...
Near line 42: Unpaired symbol: ‘[’ seems to be missing
Context: ...prevent panic. ### Bug Fixes * [#19226](https://github.com/cosmos/cosmos-sdk/pu...
Near line 46: Unpaired symbol: ‘[’ seems to be missing
Context: ...rs. ### API Breaking Changes * [#20238](https://github.com/cosmos/cosmos-sdk/pu...
Near line 47: Unpaired symbol: ‘[’ seems to be missing
Context: ...ervice` as its last argument. * [#19788](https://github.com/cosmos/cosmos-sdk/pu...
Near line 48: Unpaired symbol: ‘[’ seems to be missing
Context: ...alidatorUpdateIsZero` instead. * [#19754](https://github.com/cosmos/cosmos-sdk/pu...
Near line 49: Unpaired symbol: ‘[’ seems to be missing
Context: ...AndReturnValidatorSetUpdates`. * [#19414](https://github.com/cosmos/cosmos-sdk/pu...
Near line 50: Unpaired symbol: ‘[’ seems to be missing
Context: ...nstead of individual services. * [#19742](https://github.com/cosmos/cosmos-sdk/pu...
Near line 51: Unpaired symbol: ‘[’ seems to be missing
Context: ...saddress.Codec
as argument. * [#19735](https://github.com/cosmos/cosmos-sdk/pu...
Near line 52: Unpaired symbol: ‘[’ seems to be missing
Context: ...pmodule.HasGenesis` interface. * [#18198](https://github.com/cosmos/cosmos-sdk/pu...
Near line 53: Unpaired symbol: ‘[’ seems to be missing
Context: ...y on staking in other modules. * [#17778](https://github.com/cosmos/cosmos-sdk/pu...
Near line 55: Unpaired symbol: ‘[’ seems to be missing
Context: ...per:
GetParams,
SetParams` * [#17486](https://github.com/cosmos/cosmos-sdk/pu...
Near line 58: Unpaired symbol: ‘[’ seems to be missing
Context: ...:
RedelegationQueueIterator` * [#17562](https://github.com/cosmos/cosmos-sdk/pu...
Near line 61: Unpaired symbol: ‘[’ seems to be missing
Context: ...per:
ValidatorQueueIterator` * [#17498](https://github.com/cosmos/cosmos-sdk/pu...
Near line 64: Unpaired symbol: ‘[’ seems to be missing
Context: ...ator,
IterateLastValidators` * [#17291](https://github.com/cosmos/cosmos-sdk/pu...
Near line 68: Unpaired symbol: ‘[’ seems to be missing
Context: ...ValidatorMissedBlockBitmapKey` * [#17481](https://github.com/cosmos/cosmos-sdk/pu...
Near line 71: Unpaired symbol: ‘[’ seems to be missing
Context: ...GetUnbondingDelegationTimeKey` * [#17123](https://github.com/cosmos/cosmos-sdk/pu...
Near line 72: Unpaired symbol: ‘[’ seems to be missing
Context: ...e collections forValidators
* [#17270](https://github.com/cosmos/cosmos-sdk/pu...
Near line 75: Unpaired symbol: ‘[’ seems to be missing
Context: ...DelegatorUnbondingDelegations` * [#17336](https://github.com/cosmos/cosmos-sdk/pu...
Near line 77: Unpaired symbol: ‘[’ seems to be missing
Context: ...ey,
GetREDsToValDstIndexKey` * [#17332](https://github.com/cosmos/cosmos-sdk/pu...
Near line 79: Unpaired symbol: ‘[’ seems to be missing
Context: ...,
GetREDsFromValSrcIndexKey` * [#17315](https://github.com/cosmos/cosmos-sdk/pu...
Near line 81: Unpaired symbol: ‘[’ seems to be missing
Context: ...omkeeper
:GetRedelegation
* [#17260](https://github.com/cosmos/cosmos-sdk/pu...
Near line 83: Unpaired symbol: ‘[’ seems to be missing
Context: ...ationKey,
GetDelegationsKey` * [#17288](https://github.com/cosmos/cosmos-sdk/pu...
Near line 85: Unpaired symbol: ‘[’ seems to be missing
Context: ...ypes:
GetUnbondingIndexKey`. * [#17256](https://github.com/cosmos/cosmos-sdk/pu...
Near line 86: Unpaired symbol: ‘[’ seems to be missing
Context: ...collections forUnbondingID
. * [#17260](https://github.com/cosmos/cosmos-sdk/pu...
Near line 88: Unpaired symbol: ‘[’ seems to be missing
Context: ...:
GetValidatorByConsAddrKey` * [#17248](https://github.com/cosmos/cosmos-sdk/pu...
Near line 90: Unpaired symbol: ‘[’ seems to be missing
Context: ...types:
GetUnbondingTypeKey`. * [#17063](https://github.com/cosmos/cosmos-sdk/pu...
Near line 92: Unpaired symbol: ‘[’ seems to be missing
Context: ...icalInfo,
SetHistoricalInfo` * [#17062](https://github.com/cosmos/cosmos-sdk/pu...
Near line 93: Unpaired symbol: ‘[’ seems to be missing
Context: ...ndValidatorUpdates
storage. * [#17026](https://github.com/cosmos/cosmos-sdk/pu...
Near line 95: Unpaired symbol: ‘[’ seems to be missing
Context: ...talPower,
GetLastTotalPower` * [#17335](https://github.com/cosmos/cosmos-sdk/pu...
Near line 95: Consider a shorter alternative to avoid wordiness.
Context: ...pi/cosmos/staking/v1beta1".Infraction_` in order to remove dependency between modules on st...
Near line 96: Unpaired symbol: ‘[’ seems to be missing
Context: ...ncy between modules on staking * [#17655](https://github.com/cosmos/cosmos-sdk/pu...
Near line 97: Unpaired symbol: ‘[’ seems to be missing
Context: ...d markedHist
as deprecated. * [#20295](https://github.com/cosmos/cosmos-sdk/pu...
Near line 102: Unpaired symbol: ‘[’ seems to be missing
Context: .... ### State Breaking changes * [#18841](https://github.com/cosmos/cosmos-sdk/pu...
Near line 102: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...ub.com//pull/18841) In a undelegation or redelegation if the sha...
Near line 103: Unpaired symbol: ‘[’ seems to be missing
Context: ...ntire delegation gets removed. * [#18142](https://github.com/cosmos/cosmos-sdk/pu...
Near line 104: Unpaired symbol: ‘[’ seems to be missing
Context: ...e fees while rotating the keys * [#17655](https://github.com/cosmos/cosmos-sdk/pu...
Near line 105: Unpaired symbol: ‘[’ seems to be missing
Context: ...y keep what is needed for IBC. * [#19740](https://github.com/cosmos/cosmos-sdk/pu...
Path-based Instructions (1)
x/staking/CHANGELOG.md (1)
Pattern
**/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
* [#20295](https://github.com/cosmos/cosmos-sdk/pull/20295) `GetValidatorByConsAddr` now returns the Cosmos SDK `cryptotypes.Pubkey` instead of `cometcrypto.Publickey`. The caller is responsible to translate the returned value to the expected type. | ||
* Remove `CmtConsPublicKey()` and `TmConsPublicKey()` from `Validator` interface and as methods on the `Validator` struct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure consistency in the naming of cryptographic types.
- * [#20295](https://github.com/cosmos/cosmos-sdk/pull/20295) `GetValidatorByConsAddr` now returns the Cosmos SDK `cryptotypes.Pubkey` instead of `cometcrypto.Publickey`. The caller is responsible to translate the returned value to the expected type.
- * Remove `CmtConsPublicKey()` and `TmConsPublicKey()` from `Validator` interface and as methods on the `Validator` struct.
+ * [#20295](https://github.com/cosmos/cosmos-sdk/pull/20295) `GetValidatorByConsAddr` now returns the Cosmos SDK `cryptotypes.PubKey` instead of `cometcrypto.PublicKey`. The caller is responsible to translate the returned value to the expected type.
+ * Remove `CmtConsPublicKey()` and `TmConsPublicKey()` from `Validator` interface and as methods on the `Validator` struct.
Ensure that the type names cryptotypes.PubKey
and cometcrypto.PublicKey
are consistently capitalized as they appear in the code. This helps maintain clarity and accuracy in documentation.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
* [#20295](https://github.com/cosmos/cosmos-sdk/pull/20295) `GetValidatorByConsAddr` now returns the Cosmos SDK `cryptotypes.Pubkey` instead of `cometcrypto.Publickey`. The caller is responsible to translate the returned value to the expected type. | |
* Remove `CmtConsPublicKey()` and `TmConsPublicKey()` from `Validator` interface and as methods on the `Validator` struct. | |
* [#20295](https://github.com/cosmos/cosmos-sdk/pull/20295) `GetValidatorByConsAddr` now returns the Cosmos SDK `cryptotypes.PubKey` instead of `cometcrypto.PublicKey`. The caller is responsible to translate the returned value to the expected type. | |
* Remove `CmtConsPublicKey()` and `TmConsPublicKey()` from `Validator` interface and as methods on the `Validator` struct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is good to refactor and cleanup things 💪
@@ -477,27 +474,6 @@ func (v Validator) ConsPubKey() (cryptotypes.PubKey, error) { | |||
return pk, nil | |||
} | |||
|
|||
// CmtConsPublicKey casts Validator.ConsensusPubkey to cmtprotocrypto.PubKey. | |||
func (v Validator) CmtConsPublicKey() (cmtprotocrypto.PublicKey, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the methods be deprecated instead to avoid breaking changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably, its always nicer to remove things so its easy for us
Description
this pr removes some extra comet crypto imports in the staking module as part of minimising the complex dependency graph.
the caller of
GetConsPubkey
must now translate it to the comet type instead of staking handling itAuthor 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...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
Summary by CodeRabbit
cryptotypes.PubKey
instead ofcmtprotocrypto.PublicKey
.