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

Add structs for Upgrades and Forks structs #1379

Merged
merged 9 commits into from
May 4, 2022
Merged

Conversation

ValarDragon
Copy link
Member

@ValarDragon ValarDragon commented Apr 30, 2022

Closes: #1375

What is the purpose of the change

Simplifies a lot of the upgrades management logic / boilerplate. The goal is that every new upgrade should from the app.go level, just require a one line update. And all the complexity would otherwise be held to within each upgrades module.

This PR is marked as draft until Changelog update + docs update to the app/upgrades README.

Brief change log

  • Introduces an Upgrade and Fork struct
  • Adapt existing upgrades to use it

Testing and Verifying

This should be covered by the existing test for the v4 upgrade, which tests that upgrade handler execution happens.

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes? no
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? Needs to be Done
  • How is the feature or change documented? (not applicable / specification (x/<module>/spec/) / Osmosis docs repo / not documented)

@codecov-commenter
Copy link

codecov-commenter commented Apr 30, 2022

Codecov Report

Merging #1379 (c8999af) into main (f56fbe5) will decrease coverage by 0.63%.
The diff coverage is 13.52%.

@@            Coverage Diff             @@
##             main    #1379      +/-   ##
==========================================
- Coverage   19.82%   19.18%   -0.64%     
==========================================
  Files         202      216      +14     
  Lines       27685    30693    +3008     
==========================================
+ Hits         5489     5889     +400     
- Misses      21175    23723    +2548     
- Partials     1021     1081      +60     
Impacted Files Coverage Δ
x/epochs/client/cli/query.go 0.00% <ø> (ø)
x/gamm/pool-models/stableswap/amm.go 40.84% <0.00%> (-14.93%) ⬇️
x/gamm/pool-models/stableswap/msgs.go 0.00% <0.00%> (ø)
x/gamm/pool-models/stableswap/pool.go 0.00% <0.00%> (ø)
x/gamm/pool-models/stableswap/stableswap_pool.go 0.00% <0.00%> (ø)
x/gamm/types/pool.go 0.00% <ø> (ø)
x/incentives/client/cli/query.go 0.00% <ø> (ø)
x/incentives/keeper/distribute.go 61.00% <0.00%> (ø)
x/incentives/keeper/hooks.go 50.00% <0.00%> (ø)
x/incentives/module.go 51.11% <0.00%> (+1.11%) ⬆️
... and 34 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 18a3bb3...c8999af. Read the comment docs.

@ValarDragon ValarDragon marked this pull request as ready for review May 2, 2022 16:41
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.

Nice work!!!

app/app.go Outdated Show resolved Hide resolved
app/forks.go Show resolved Hide resolved
as is the case for all osmosis `Fork`s, then all logic changes must be height-gated or in the `BeginForkLogic` code.

```go
type Upgrade struct {
Copy link
Member

@p0mvn p0mvn May 3, 2022

Choose a reason for hiding this comment

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

nit: I think these code snippets are likely to go out of sync with the actual code overtime

Copy link
Member Author

Choose a reason for hiding this comment

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

Hopefully they never update O_O

@ValarDragon ValarDragon requested a review from a team May 3, 2022 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Upgrades package improvements:
4 participants