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/slashing): migrate ValidatorSigningInfo to collections #17023

Merged
merged 7 commits into from
Jul 18, 2023

Conversation

likhita-809
Copy link
Contributor

Description

Closes: #16362


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
  • added ! to 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
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • 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.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@likhita-809 likhita-809 marked this pull request as ready for review July 18, 2023 08:45
@likhita-809 likhita-809 requested a review from a team as a code owner July 18, 2023 08:45
Comment on lines +30 to +31
Params collections.Item[types.Params]
ValidatorSigningInfo collections.Map[sdk.ConsAddress, types.ValidatorSigningInfo]
Copy link
Member

Choose a reason for hiding this comment

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

random thought but are we able to make these private? params i feel yes since the module can make a query through the router to get the same info

a bit out of scope of this pr but something to think about instead of making it all public

Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

utACK, left one question but doesnt need to be solved in this pr

@julienrbrt julienrbrt changed the title refactor: migrate ValidatorSigningInfo to collections in x/slashing refactor(x/slashing): migrate ValidatorSigningInfo to collections Jul 18, 2023
simapp/export.go Outdated
info.StartHeight = 0
err = app.SlashingKeeper.ValidatorSigningInfo.Set(ctx, addr, info)
if err != nil {
panic(err)
Copy link
Member

@julienrbrt julienrbrt Jul 18, 2023

Choose a reason for hiding this comment

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

Why cannot we return the error here? We probably should instead of panicking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought we are panicking on every error in prepForZeroHeightGenesis. To keep that consistent behaviour I put panic there instead of returning error

Copy link
Contributor

Choose a reason for hiding this comment

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

the error is propagated back to err in line 235, so it's fine to error here

Copy link
Contributor

@samricotta samricotta left a comment

Choose a reason for hiding this comment

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

lgtm!

@julienrbrt julienrbrt added this pull request to the merge queue Jul 18, 2023
Merged via the queue into main with commit a61e11e Jul 18, 2023
@julienrbrt julienrbrt deleted the likhita/coll-valSignInfo branch July 18, 2023 16:17
@coderabbitai coderabbitai bot mentioned this pull request May 3, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor(slashing): move ValidatorSigningInfo to collections
6 participants