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

InitGenesis in migrations when fromVersion==0 #9007

Merged
merged 14 commits into from
Apr 2, 2021

Conversation

amaury1093
Copy link
Contributor

Description

closes: #8989


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@codecov
Copy link

codecov bot commented Mar 26, 2021

Codecov Report

Merging #9007 (7dff858) into master (e3a0148) will decrease coverage by 0.01%.
The diff coverage is 22.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9007      +/-   ##
==========================================
- Coverage   58.95%   58.93%   -0.02%     
==========================================
  Files         575      575              
  Lines       32191    32198       +7     
==========================================
  Hits        18977    18977              
- Misses      10999    11006       +7     
  Partials     2215     2215              
Impacted Files Coverage Δ
types/module/module.go 68.36% <0.00%> (-5.26%) ⬇️
simapp/app.go 82.75% <100.00%> (-0.09%) ⬇️
types/module/configurator.go 18.51% <100.00%> (+3.13%) ⬆️

@orijbot
Copy link

orijbot commented Mar 26, 2021

@orijbot
Copy link

orijbot commented Mar 26, 2021

@orijbot
Copy link

orijbot commented Mar 26, 2021

@orijbot
Copy link

orijbot commented Mar 26, 2021

@amaury1093 amaury1093 marked this pull request as ready for review March 26, 2021 13:25
Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

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

This needs documentation at the function level. All the doc comments are inline, but user facing documentation needs to explain clearly all of the behavior here.

types/module/configurator.go Outdated Show resolved Hide resolved
@amaury1093 amaury1093 marked this pull request as draft March 30, 2021 14:20
@@ -339,7 +339,7 @@ func NewSimApp(

app.mm.RegisterInvariants(&app.CrisisKeeper)
app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino)
app.configurator = module.NewConfigurator(app.MsgServiceRouter(), app.GRPCQueryRouter())
app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

After the Configurator/module.Manager refactor, this would be the only place that might need to be updated by app developers (or maybe even not). The Configurator interface itself is not modified for now, to allow more flexibility on our side.

@amaury1093 amaury1093 marked this pull request as ready for review April 1, 2021 09:39
@amaury1093
Copy link
Contributor Author

this is r4r again

@clevinson clevinson requested a review from aaronc April 2, 2021 14:24
Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

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

Would like some doc updates but otherwise LGTM. In general the x/upgrade module docs need to be very clear in warning people to read everything very carefully.

types/module/module.go Show resolved Hide resolved
x/upgrade/types/handler.go Outdated Show resolved Hide resolved
@amaury1093
Copy link
Contributor Author

@technicallyty Would you be able to give this PR a review? and also double-check that your docs PR #8940 matches the same meaning as the functions comments from this PR?

Copy link
Contributor

@technicallyty technicallyty left a comment

Choose a reason for hiding this comment

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

LGTM, just some small nits leftover

types/module/module.go Outdated Show resolved Hide resolved
types/module/module.go Outdated Show resolved Hide resolved
types/module/module.go Outdated Show resolved Hide resolved
amaury1093 and others added 4 commits April 2, 2021 17:23
Co-authored-by: technicallyty <48813565+technicallyty@users.noreply.github.com>
Co-authored-by: technicallyty <48813565+technicallyty@users.noreply.github.com>
Co-authored-by: technicallyty <48813565+technicallyty@users.noreply.github.com>
@amaury1093 amaury1093 added the A:automerge Automatically merge PR once all prerequisites pass. label Apr 2, 2021
@mergify mergify bot merged commit 5d13b1f into master Apr 2, 2021
@mergify mergify bot deleted the am/8989-initgenesis-migration branch April 2, 2021 15:41
technicallyty added a commit that referenced this pull request Apr 2, 2021
-include PR #9007 information
mergify bot added a commit that referenced this pull request Apr 14, 2021
* upgrade draft docs

* upgrade draft docs2

* change to generic id

* Update docs/building-modules/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/building-modules/README.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/building-modules/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/building-modules/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/building-modules/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/building-modules/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/building-modules/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/building-modules/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/core/README.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/core/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/core/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* added lines for version map and consensus versions

* fix headers, add synopsis tag

* docs for new modules

* fix

* remove line

* Update docs/core/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/building-modules/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* SetUpgradeHandler example snippet

* -general clean up of docs
-include PR #9007 information

* Update docs/core/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/core/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/core/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/core/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/core/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/core/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/core/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/core/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/core/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/core/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/core/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Update docs/core/upgrade.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Barrie Byron <barrie.byron@tendermint.com>

* fix self-reference

* clearer definitions for overwriting genesis functions

* add sync section

* forgot to save this

* update description of initgenesis modules

* specify upgrade method

* Update docs/core/upgrade.md

Co-authored-by: Barrie Byron <barrie.byron@tendermint.com>

Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
Co-authored-by: Barrie Byron <barrie.byron@tendermint.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
* InitGenesis in migrations when fromVersion==0

* Add test

* Fix test

* Fix comment

* cdc=>codec

* Don't break Configurator

* Remove method

* Add comments

* Add more comments

* Update types/module/module.go

Co-authored-by: technicallyty <48813565+technicallyty@users.noreply.github.com>

* Update types/module/module.go

Co-authored-by: technicallyty <48813565+technicallyty@users.noreply.github.com>

* Update types/module/module.go

Co-authored-by: technicallyty <48813565+technicallyty@users.noreply.github.com>

Co-authored-by: technicallyty <48813565+technicallyty@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. T: Migration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

module.Manager.RunMigrations should probably call InitGenesis when new modules are added
5 participants