Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

R4R: Implement GenesisState.Sanitize() #3397

Merged
merged 2 commits into from
Jan 28, 2019

Conversation

alessio
Copy link
Contributor

@alessio alessio commented Jan 25, 2019

Implement genesis file sanitization to avoid failures at chain init.

  • Add GenesisState.Sanitize(). It sorts genesis accounts and
    coin sets to ensure genesis state passes validation.
  • gaia app calls GenesisState.Sanitize() on initFromGenesisState()
    before processing the genesis state.

Closes: #3390

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote tests
  • Updated relevant documentation (docs/)
  • Added entries in PENDING.md with issue #
  • rereviewed Files changed in the github PR explorer

For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@alessio alessio force-pushed the alessio/3390-sanitize-genesis-state branch from cc0fe5b to 8f910c7 Compare January 25, 2019 19:14
@codecov
Copy link

codecov bot commented Jan 25, 2019

Codecov Report

Merging #3397 into develop will decrease coverage by 0.01%.
The diff coverage is 50%.

@@             Coverage Diff             @@
##           develop    #3397      +/-   ##
===========================================
- Coverage    59.38%   59.37%   -0.02%     
===========================================
  Files          131      131              
  Lines         9862     9868       +6     
===========================================
+ Hits          5857     5859       +2     
- Misses        3632     3637       +5     
+ Partials       373      372       -1

@alessio alessio force-pushed the alessio/3390-sanitize-genesis-state branch from e7689ce to 76fb55e Compare January 25, 2019 20:46
@alessio alessio changed the title WIP: Implement GenesisState.Sanitize() R4R: Implement GenesisState.Sanitize() Jan 25, 2019
Copy link
Member

@jackzampolin jackzampolin left a comment

Choose a reason for hiding this comment

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

Great additions here. I held comments cause they were all ++

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

mostly LGTM, left a few minor remarks though 👍

@alessio alessio force-pushed the alessio/3390-sanitize-genesis-state branch from 76fb55e to 461708b Compare January 25, 2019 21:31
Add GenesisState.Sanitize(). It sorts genesis accounts and
coin sets to ensure genesis state passes validation.

gaia app calls GenesisState.Sanitize() on initFromGenesisState()
before processing the genesis state.

Closes: #3390
@alessio alessio force-pushed the alessio/3390-sanitize-genesis-state branch from ee6fbf1 to 90cbfb6 Compare January 25, 2019 21:33
Copy link
Contributor

@rigelrozanski rigelrozanski left a comment

Choose a reason for hiding this comment

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

LGTM

@jackzampolin jackzampolin merged commit f494a92 into develop Jan 28, 2019
@jackzampolin jackzampolin deleted the alessio/3390-sanitize-genesis-state branch January 28, 2019 17:55
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants