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

Fixing subtle bug in genesis verification post-export #374

Merged
merged 6 commits into from
Mar 9, 2022

Conversation

joeabbey
Copy link
Contributor

@joeabbey joeabbey commented Mar 8, 2022

Description

While attempting to export the state to genesis and create a testnet, it was discovered that the InitGenesis.go hadn't considered and export after claims were completed.

Closes: #XXX


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.

PR review checkboxes:

I have...

  • added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • included the correct type prefix in the PR title
  • targeted the correct branch (see PR Targeting)
  • provided a link in the PR description to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all required CI checks have passed

Code maintenance:

I have...

  • written unit and integration tests
  • added relevant godoc and code comments.
  • updated relevant documentation (docs/) or specification (x/<module>/spec/)

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 all author checklist items have been addressed
  • confirmed that this PR does not change production code

x/claims/genesis.go Outdated Show resolved Hide resolved
x/claims/genesis.go Outdated Show resolved Hide resolved
x/claims/genesis.go Outdated Show resolved Hide resolved
Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

ACK. I'll add tests to the genesis.go file in a bit

@fedekunze fedekunze enabled auto-merge (squash) March 9, 2022 08:20
@joeabbey joeabbey requested a review from jolube as a code owner March 9, 2022 08:23
@fedekunze fedekunze merged commit 81f9ea7 into evmos:main Mar 9, 2022
for _, actionCompleted := range cr.ActionsCompleted {
if !actionCompleted {
// NOTE: only add the initial claimable amount per action for the ones that haven't been claimed
sumUnclaimed = sumUnclaimed.Add(initialClaimablePerAction)
Copy link
Contributor

Choose a reason for hiding this comment

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

You have to use:
https://github.com/tharsis/evmos/blob/f5dfed87da17ee61c1338f8d70b27f26f3d1b17a/x/claims/keeper/claim.go#L11

If you don't, genesis export will fail on decay of the claims balances. It was in the previous commit for a reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed... if we can incorporate this now.. it will prevent us from having to remember that detail should we ever need to export state again in the next few months

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fedekunze ^^ I'll make an updated PR to this effect

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.

None yet

3 participants