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

refactor(x/staking)!: rename NewToOldConsKeyMap to ConsKeyToValidatorIdentifierMap #20696

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

facundomedica
Copy link
Member

@facundomedica facundomedica commented Jun 17, 2024

Description

It was confusing and it would make one think that it was keeping all historial key changes, but it's actually keeping a map from the first ever key to the last key.


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, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

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.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • Refactor
    • Renamed NewToOldConsKeyMap to ConsKeyToValidatorIdentifierMap across the staking module for better clarity and consistency.

@facundomedica facundomedica requested a review from a team as a code owner June 17, 2024 14:05
Copy link
Contributor

coderabbitai bot commented Jun 17, 2024

Walkthrough

Walkthrough

The changes made across several files in the x/staking module include renaming the mapping NewToOldConsKeyMap to ConsKeyToValidatorIdentifierMap, reflecting a semantic shift in the way consensus key mappings are handled. This update improves clarity and consistency across method names, variable names, and descriptions.

Changes

Files Change Summary
x/staking/README.md Renamed NewToOldConsKeyMap to ConsKeyToValidatorIdentifierMap in descriptions and comments.
x/staking/keeper/cons_pubkey.go Updated method names and variable names to use setConsKeyToValidatorIdentifierMap instead of setNewToOldConsKeyMap within the updateToNewPubkey method and similar alterations.
x/staking/keeper/keeper.go Replaced NewToOldConsKeyMap with ConsKeyToValidatorIdentifierMap within the Keeper struct and updated NewKeeper function accordingly.
x/staking/keeper/msg_server.go Modified method call from NewToOldConsKeyMap.Get to ConsKeyToValidatorIdentifierMap.Get in the RotateConsPubKey method.
x/staking/types/keys.go Renamed the variable NewToOldConsKeyMap to ConsKeyToValidatorIdentifierMapPrefix.

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6d2f6ff and 0cd0058.

Files selected for processing (5)
  • x/staking/README.md (2 hunks)
  • x/staking/keeper/cons_pubkey.go (2 hunks)
  • x/staking/keeper/keeper.go (2 hunks)
  • x/staking/keeper/msg_server.go (1 hunks)
  • x/staking/types/keys.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • x/staking/types/keys.go
Additional context used
Path-based instructions (4)
x/staking/keeper/cons_pubkey.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/staking/keeper/keeper.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/staking/keeper/msg_server.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/staking/README.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

LanguageTool
x/staking/README.md

[uncategorized] ~98-~98: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...have one of three statuses * Unbonded: The validator is not in the active set....


[uncategorized] ~100-~100: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...They can receive delegations. * Bonded: Once the validator receives sufficient ...


[uncategorized] ~100-~100: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...he validator receives sufficient bonded tokens they automatically join the active se...


[style] ~103-~103: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...They can receive further delegations. They can be slashed for misbehavior. Delegat...


[uncategorized] ~107-~107: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...at the tokens were bonded. * Unbonding: When a validator leaves the active set,...


[style] ~112-~112: Unless you want to emphasize “not”, use “cannot” which is more common. (CAN_NOT_PREMIUM)
Context: ... tombstoned a validator's consensus key can not be reused within the chain where the to...


[style] ~117-~117: Consider a shorter alternative to avoid wordiness. (IN_ORDER_TO_PREMIUM)
Context: ...ces are maintained per validator object in order to fulfill required lookups for slashing a...


[typographical] ~119-~119: Consider adding two commas here. (HOWEVER_COMMA)
Context: ...alidatorPower`) is also maintained which however remains constant throughout each block,...


[uncategorized] ~144-~144: Possible missing article found. (AI_HYDRA_LEO_MISSING_A)
Context: ...rent active set. Here ConsensusPower is validator.Tokens/10^6 by default. Note that all v...


[grammar] ~167-~167: This noun is normally spelled as one word. (HOLDER_COMPOUNDS)
Context: ...torAddr -> ProtocolBuffer(delegation)` Stake holders may delegate coins to validators; under...


[style] ~171-~171: You can shorten this phrase to avoid wordiness. (BE_THE_MAKER_OF_WORDINESS)
Context: ...alidator. The sender of the transaction is the owner of the bond. ```protobuf reference https:...


[grammar] ~207-~207: The word “lookup” is a noun. The verb is spelled with a white space. (NOUN_VERB_CONFUSION)
Context: ...ndingDelegation` is used in queries, to lookup all unbonding delegations for a given ...


[grammar] ~210-~210: The word “lookup” is a noun. The verb is spelled with a white space. (NOUN_VERB_CONFUSION)
Context: ...sFromValidator` is used in slashing, to lookup all unbonding delegations associated w...


[uncategorized] ~228-~228: A comma may be missing after the conjunctive/linking adverb ‘However’. (SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
Context: ...rent validator (destination validator). However when this occurs they must be tracked i...


[grammar] ~240-~240: The word “lookup” is a noun. The verb is spelled with a white space. (NOUN_VERB_CONFUSION)
Context: ...Redelegations is used for queries, to lookup all redelegations for a given delegato...


[style] ~245-~245: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...lidatorSrcAddr. RedelegationsByDstis used for slashing based on theValidat...


[grammar] ~247-~247: The word “lookup” is a noun. The verb is spelled with a white space. (NOUN_VERB_CONFUSION)
Context: ... first map here is used for queries, to lookup all redelegations for a given delegator...


[typographical] ~259-~259: The comma may be misplaced. Try moving it before ‘and’, or removing it altogether. (COMMA_AFTER_AND)
Context: ... validator (let's call it Validator X) * and, the (re)delegator is attempting to crea...


[style] ~289-~289: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...atorConsensusKeyRotationRecordIndexKey` is to keep track of a validator that how m...


[grammar] ~299-~299: The modal verb ‘will’ requires the verb’s base form. (MD_BASEFORM)
Context: ...o prevent the spam: * There will only limited number of rotations can be done within ...


[uncategorized] ~299-~299: Possible missing article found. (AI_HYDRA_LEO_MISSING_AN)
Context: ... number of rotations can be done within unbonding period of time. * A non-negligible fee...


[uncategorized] ~305-~305: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...onverted to UTC, rounded to the nearest nanosecond then sorted. The sortable time format u...


[typographical] ~307-~307: Consider adding a comma after ‘Notably’ for more clarity. (RB_LY_COMMA)
Context: ...ring "2006-01-02T15:04:05.000000000". Notably this format: * right pads all zeros * ...


[uncategorized] ~317-~317: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...rpose of tracking progress of unbonding delegations the unbonding delegations queue is kept...


[uncategorized] ~328-~328: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...For the purpose of tracking progress of redelegations the redelegation queue is kept. * Rede...


[uncategorized] ~339-~339: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...rpose of tracking progress of unbonding validators the validator queue is kept. * Validat...


[typographical] ~345-~345: Consider adding a comma after ‘Typically’ for more clarity. (RB_LY_COMMA)
Context: ...h the validator object can be accessed. Typically it is expected that only a single valid...


[uncategorized] ~346-~346: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ... record will be associated with a given timestamp however it is possible that multiple va...


[style] ~346-~346: For conciseness, try rephrasing this sentence. (MAY_MIGHT_BE)
Context: ...sociated with a given timestamp however it is possible that multiple validators exist in the queue at the same location. ###...


[uncategorized] ~351-~351: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...f tracking progress or consensus pubkey rotations the `ValidatorConsensusKeyRotationRecor...


[style] ~383-~383: Consider a shorter alternative to avoid wordiness. (IN_ORDER_TO_PREMIUM)
Context: ...ry EndBlock in order to check for changes in the active `Valida...


[uncategorized] ~404-~404: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ... When a validator begins the unbonding process the following operations occur: * send...


[style] ~411-~411: ‘new record’ might be wordy. Consider a shorter alternative. (EN_WORDINESS_PREMIUM_NEW_RECORD)
Context: ...robject for this validator * insert a new record into theValidatorQueue` for this vali...


[style] ~424-~424: To make your writing flow more naturally, try moving ‘also’ before the verb. (ALSO_PLACEMENT)
Context: ...ved from the CometBFT set. this process may be also be reversed. the following operations o...


[uncategorized] ~438-~438: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...tions #### Delegate When a delegation occurs both the validator and the delegation o...


[uncategorized] ~442-~442: Possible missing preposition found. (AI_HYDRA_LEO_MISSING_TO)
Context: ...s from the sending account * add shares the delegation object or add them to a crea...


[grammar] ~444-~444: The verb ‘depend’ requires the preposition ‘on’ (or ‘upon’). (DEPEND_ON)
Context: ... or the NotBondedPool ModuleAccount depending if the validator.Status is Bonded o...


[misspelling] ~446-~446: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’. (EN_A_VS_AN)
Context: ...cord from ValidatorByPowerIndex * add an new updated record to the `ValidatorByP...


[misspelling] ~492-~492: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’. (EN_A_VS_AN)
Context: ...leAccount* record the token amount in an new entry in the relevantRedelegation...


[uncategorized] ~505-~505: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...y rotation When a ConsPubkeyRotation occurs the validator and the `ValidatorConsens...


[style] ~549-~549: This phrase is redundant. Consider writing “point” or “time”. (MOMENT_IN_TIME)
Context: ...How Shares are calculated At any given point in time, each validator has a number of tokens,...


[typographical] ~567-~567: It appears that a comma is missing. (DURING_THAT_TIME_COMMA)
Context: ...ill have T = S. ## Messages In this section we describe the processing of the staki...


[uncategorized] ~593-~593: A comma may be missing after the conjunctive/linking adverb ‘Additionally’. (SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
Context: ...lidator` object at appropriate indexes. Additionally a self-delegation is made with the init...


[typographical] ~622-~622: It appears that a comma is missing. (DURING_THAT_TIME_COMMA)
Context: ...` object. ### MsgDelegate Within this message the delegator provides coins, and in re...


[style] ~637-~637: Did you mean ‘different from’? ‘Different than’ is often considered colloquial style. (DIFFERENT_THAN)
Context: ...nt Coinhas a denomination different than one defined byparams.BondDenom` * the...


[uncategorized] ~642-~642: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...xist then it is created as part of this message otherwise the existing Delegation is ...


[uncategorized] ~650-~650: Possible missing article found. (AI_HYDRA_LEO_MISSING_THE)
Context: ...index, and the delegation is tracked in validator object in the Validators index. It i...


[grammar] ~680-~680: Did you mean “fewer”? The noun “shares” is countable. (FEWER_LESS)
Context: ...ator doesn't exist * the delegation has less shares than the ones worth of Amount ...


[style] ~682-~682: Did you mean ‘different from’? ‘Different than’ is often considered colloquial style. (DIFFERENT_THAN)
Context: ...e Amount has a denomination different than one defined by params.BondDenom When...


[uncategorized] ~684-~684: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...params.BondDenom` When this message is processed the following actions occur: * validat...


[grammar] ~687-~687: Using ‘plenty’ without ‘of’ is considered to be informal. (PLENTY_OF_NOUNS)
Context: ...e token worth of the shares remove that amount tokens held within the validator * with those ...


[style] ~713-~713: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ... unbondingDelegation entry balance. * the cancel unbonding delegation height do...


[style] ~714-~714: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...ingDelegationQueueof the delegator. * theunbondingDelegation` is from a jailed ...


[uncategorized] ~716-~716: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...jailed validator. When this message is processed the following actions occur: * if the ...


[grammar] ~747-~747: Did you mean “fewer”? The noun “shares” is countable. (FEWER_LESS)
Context: ...dators don't exist * the delegation has less shares than the ones worth of Amount ...


[style] ~750-~750: Did you mean ‘different from’? ‘Different than’ is often considered colloquial style. (DIFFERENT_THAN)
Context: ...nt Coinhas a denomination different than one defined byparams.BondDenom` When...


[uncategorized] ~752-~752: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...params.BondDenom` When this message is processed the following actions occur: * the sou...


[grammar] ~755-~755: Using ‘plenty’ without ‘of’ is considered to be informal. (PLENTY_OF_NOUNS)
Context: ...e token worth of the shares remove that amount tokens held within the source validator. * if ...


[uncategorized] ~757-~757: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...may be effectively reversed in the next step however). * Unbonding - add an en...


[uncategorized] ~760-~760: Possible missing preposition found. (AI_HYDRA_LEO_MISSING_TO)
Context: ...ed` - no action required in this step * Delegate the token worth to the destination vali...


[uncategorized] ~784-~784: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...lidator must pay rotation fees (default fee 1000000stake) to rotate the consensus p...


[uncategorized] ~808-~808: The verb “is” doesn’t seem to fit in this context, “are” is probably more formally correct. (AI_HYDRA_LEO_CPT_IS_ARE)
Context: ...older than height - HistoricalEntries is deleted. In most cases, this results in...


[typographical] ~810-~810: Consider adding a comma. (IF_THERE_COMMA)
Context: ...calEntries` has changed to a lower value there will be multiple entries in the store t...


[uncategorized] ~820-~820: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...e end of every block. As a part of this process any updated validators are also returne...


[style] ~821-~821: Consider using just “returned”. (RETURN_BACK)
Context: ...process any updated validators are also returned back to CometBFT for inclusion in the CometB...


[style] ~846-~846: Consider a shorter alternative to avoid wordiness. (IN_ORDER_TO_PREMIUM)
Context: ...ture certain operations must take place in order to complete the state operation. This is a...


[uncategorized] ~854-~854: Possible missing preposition found. (AI_HYDRA_LEO_MISSING_TO)
Context: ... process along with all its delegations begin unbonding (while still being delegated ...


[typographical] ~855-~855: It appears that a comma is missing. (DURING_THAT_TIME_COMMA)
Context: ...g delegated to this validator). At this point the validator is said to be an "unbondi...


[typographical] ~861-~861: It appears that a comma is missing. (DURING_THAT_TIME_COMMA)
Context: ...eight <= current block height). At this point any mature validators which do not have...


[uncategorized] ~888-~888: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...g procedure: * remove the mature entry from Redelegation.Entries * remove the `Re...


[grammar] ~905-~905: The modal verb ‘can’ requires the verb’s base form. (MD_BASEFORM)
Context: ...the hook name). The following hooks can registered with staking: * `AfterValidatorCreated...


[uncategorized] ~1158-~1158: Possible missing article found. (AI_HYDRA_LEO_MISSING_A)
Context: ...sers to query historical information at given height. Usage: ```bash simd query sta...


[uncategorized] ~1656-~1656: Possible missing article found. (AI_HYDRA_LEO_MISSING_A)
Context: ...reate-validator` allows users to create new validator initialized with a self-deleg...


[uncategorized] ~1842-~1842: Possible missing article found. (AI_HYDRA_LEO_MISSING_A)
Context: ...point queries validator information for given validator address. ```bash cosmos.stak...


[uncategorized] ~1884-~1884: Possible missing article found. (AI_HYDRA_LEO_MISSING_A)
Context: ...dpoint queries delegate information for given validator. ```bash cosmos.staking.v1be...


[uncategorized] ~1922-~1922: Possible missing article found. (AI_HYDRA_LEO_MISSING_A)
Context: ...dpoint queries delegate information for given validator. ```bash cosmos.staking.v1be...


[uncategorized] ~1974-~1974: Possible missing article found. (AI_HYDRA_LEO_MISSING_A)
Context: ...dpoint queries delegate information for given validator delegator pair. ```bash cosm...


[uncategorized] ~2011-~2011: Possible missing article found. (AI_HYDRA_LEO_MISSING_A)
Context: ...point queries unbonding information for given validator delegator. ```bash cosmos.st...


[uncategorized] ~2910-~2910: Possible missing article found. (AI_HYDRA_LEO_MISSING_A)
Context: ...point queries validator information for given validator address. ```bash /cosmos/sta...


[uncategorized] ~2962-~2962: Possible missing article found. (AI_HYDRA_LEO_MISSING_A)
Context: ...dpoint queries delegate information for given validator. ```bash /cosmos/staking/v1b...


[uncategorized] ~3044-~3044: Possible missing article found. (AI_HYDRA_LEO_MISSING_A)
Context: ...dpoint queries delegate information for given validator delegator pair. ```bash /cos...

Markdownlint
x/staking/README.md

24-24: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


25-25: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


26-26: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


27-27: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


28-28: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


29-29: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


30-30: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


31-31: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


32-32: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


33-33: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


34-34: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


36-36: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


37-37: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


38-38: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


39-39: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


41-41: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


42-42: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


43-43: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


44-44: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


45-45: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


46-46: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


47-47: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


48-48: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


50-50: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


52-52: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


53-53: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


56-56: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


57-57: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


60-60: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


61-61: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


62-62: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


588-588: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


589-589: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


590-590: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


689-689: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


690-690: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


691-691: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


693-693: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


719-719: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


720-720: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


757-757: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


758-758: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


759-759: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


762-762: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


828-828: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


830-830: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


908-908: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


910-910: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


912-912: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


914-914: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


916-916: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


918-918: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


920-920: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


922-922: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


924-924: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


926-926: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


928-928: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


297-297: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


299-299: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


355-355: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


509-509: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


897-897: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


218-218: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines


766-766: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines


930-930: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines


471-471: null (MD038, no-space-in-code)
Spaces inside code span elements

Gitleaks
x/staking/README.md

1626-1627: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key)


1679-1679: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key)


2875-2875: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key)


2902-2902: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key)

Additional comments not posted (6)
x/staking/keeper/cons_pubkey.go (2)

113-113: Refactored method name setConsKeyToValidatorIdentifierMap correctly replaces setNewToOldConsKeyMap, aligning with the new naming convention.


Line range hint 122-132: The renaming and logic within setConsKeyToValidatorIdentifierMap are consistent with the PR's objectives. The method ensures that if an old key mapping exists, it is used as the old key in a new mapping, which maintains historical mapping integrity.

x/staking/keeper/keeper.go (1)

125-127: Renaming within the Keeper struct from NewToOldConsKeyMap to ConsKeyToValidatorIdentifierMap is correctly implemented, reflecting the new clearer naming convention.

x/staking/keeper/msg_server.go (1)

653-653: The method ConsKeyToValidatorIdentifierMap.Get is used correctly in place of the old method name, aligning with the renaming strategy and ensuring the logic remains intact for key rotation checks.

x/staking/README.md (2)

283-283: The renaming of the map key from OldToNewConsKeyMap to ConsKeyToValidatorIdentifierMap has been correctly updated in the documentation. This change aligns with the PR's objective to clarify the purpose of the map.


295-295: The addition of an entry in the ConsKeyToValidatorIdentifierMap for each rotation is appropriately documented. This ensures that the map's role in blocking rotations to previously used consensus keys is clear.

@facundomedica facundomedica added this pull request to the merge queue Jun 17, 2024
Merged via the queue into main with commit 4133dc2 Jun 17, 2024
69 checks passed
@facundomedica facundomedica deleted the facu/fixaudit2 branch June 17, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: 🥳 Done
Development

Successfully merging this pull request may close these issues.

4 participants