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

chore: Cosmos SDK 0.44.* series upgrade for Osmosis #538

Merged
merged 42 commits into from
Nov 21, 2021
Merged

Conversation

faddat
Copy link
Member

@faddat faddat commented Oct 17, 2021

Closes: #419

Description

This is ready for review. One thing that'll need review especially is the decimal math stuff in the faddat/basecoin cosmos sdk. I am working to get that up to 0.44.2 and when that's done, the sdk stuff will need review also.

Thanks!

Tracking checklist:

NB: This has also added & enabled authz and feegrant. It should also ease some of @sunnya97's work on ethereum address formats.

Big big Goal

Osmo is IBC yo.

oh, and I hate, hate hate Marshaler.


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@faddat faddat changed the title Faddat/sdk 0441 Cosmos SDK 0.44.* series upgrade for Osmosis Oct 17, 2021
@faddat faddat changed the title Cosmos SDK 0.44.* series upgrade for Osmosis chore: Cosmos SDK 0.44.* series upgrade for Osmosis Oct 17, 2021
@faddat
Copy link
Member Author

faddat commented Oct 20, 2021

I'm now keeping two cosmos-sdk branches fresh in osmosis-labs/cosmos-sdk:

  • 0.44.2
  • 0.45

For testing purposes, I am also tagging and releasing them so that we can build osmosis against it. This opens up many possibilities.

I figure that the best possible time of transition would be:

  • Tendermint 0.35 with new p2p hotness
  • Cosmos-SDK 0.45 with presumably some cool stuff too

@ValarDragon
Copy link
Member

ValarDragon commented Oct 20, 2021

Thanks so much for doing this! The merge conflicts here were a ton of work!

Going to start reviewing this tomorrow. Quick notes, I think we should keep feegrant disabled. I don't see it realistically being used by anyone anytime soon, and want to keep API surface down for new modules. (Lowering risk of sdk v0.44.2-like vulnerabilities)

Can you provide some context for the decisions with airdrop cmd?

@faddat
Copy link
Member Author

faddat commented Oct 21, 2021

Sure!

So basically I figured that the airdrop command was now a part of history.

By traveling back throught the repository someone could always verify the airdrop, and that is what is important about it. I also think that I needed to import some.... v036 somesuch thing-- and that had been dropped from v0.44.2 so I also dropped the airdrop command and figured folks could grab it if they wanted it.

also-- do we want authz?

also, also: if we were to upgrade, would we export state and begin anew as osmosis-2 (my preference because we would gain many performance improvements) or do you reckon we should do another in-place upgrade?

@ValarDragon ValarDragon mentioned this pull request Oct 21, 2021
4 tasks
@sunnya97
Copy link
Collaborator

@faddat what kind of performance upgrades do we get from an export state upgrade?

@faddat
Copy link
Member Author

faddat commented Nov 19, 2021

@sunnya97 the performance improvements tend to be quite dramatic.

That said, we surely cannot lose the existing IBC channels, so I will look into other ways to roll.

I'm also going to look into weather it is realistic to include this in v5.x

@ValarDragon
Copy link
Member

I think its realistic to include this in v5.x!

We made a branch for the changes by cherry-picking every commit manually instead of the rebase hell. (Spent awhile trying to figure out how to double check everything in a rebase and its super hard)

I think we can use osmosis-labs/cosmos-sdk branch v0.44.3x-osmo-v5 in the go.mod.

If your fine with it, can I just push to this branch directly? I think it should take some minor changes before this is merge ready!

app/app.go Outdated Show resolved Hide resolved
app/app.go Outdated Show resolved Hide resolved
app/app.go Outdated Show resolved Hide resolved
app/app.go Outdated Show resolved Hide resolved
AppConstructor: NewAppConstructor(encCfg),
GenesisState: ModuleBasics.DefaultGenesis(encCfg.Marshaler),
TimeoutCommit: 2 * time.Second,
ChainID: "osmosis-code-test",
Copy link
Member

Choose a reason for hiding this comment

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

TODO: Double check this still gets set correctly in client.toml after osmosisd init

Copy link
Member

Choose a reason for hiding this comment

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

chain id is set under the logic:

"chainID, _ := cmd.Flags().GetString(flags.FlagChainID)
if chainID == "" {
chainID = fmt.Sprintf("test-chain-%v", tmrand.Str(6))
}"

as far as I can tell.

Copy link
Member

Choose a reason for hiding this comment

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

Ah no, client.toml happens entirely separately. I'll file an issue for updating that.

@codecov-commenter
Copy link

codecov-commenter commented Nov 21, 2021

Codecov Report

Merging #538 (eac2618) into main (f70c7a7) will decrease coverage by 1.80%.
The diff coverage is 18.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #538      +/-   ##
==========================================
- Coverage   20.23%   18.43%   -1.81%     
==========================================
  Files         172      172              
  Lines       24172    24203      +31     
==========================================
- Hits         4892     4462     -430     
- Misses      18486    18977     +491     
+ Partials      794      764      -30     
Impacted Files Coverage Δ
app/ante.go 0.00% <0.00%> (-68.97%) ⬇️
app/app.go 0.60% <0.00%> (-84.08%) ⬇️
app/config.go 0.00% <0.00%> (ø)
x/claim/keeper/hooks.go 29.16% <ø> (ø)
x/claim/keeper/keeper.go 87.50% <ø> (ø)
x/claim/module.go 60.00% <0.00%> (-2.07%) ⬇️
x/epochs/keeper/keeper.go 62.50% <ø> (ø)
x/epochs/module.go 50.00% <0.00%> (-1.43%) ⬇️
x/gamm/keeper/keeper.go 81.25% <ø> (ø)
x/gamm/module.go 62.16% <0.00%> (-1.73%) ⬇️
... and 27 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 f70c7a7...eac2618. Read the comment docs.

@ValarDragon
Copy link
Member

ValarDragon commented Nov 21, 2021

All tests now working. Now need to fix simulation, and the IBC upgrade guide to this version

app/app.go Outdated Show resolved Hide resolved
app/ante.go Outdated Show resolved Hide resolved
Comment on lines +235 to +238
// This is a hardcoded path in the events to get the lockID
// this is incredibly brittle...
// fmt.Println(txResp.Logs[0])
lockID := txResp.Logs[0].Events[2].Attributes[0].Value
Copy link
Member

Choose a reason for hiding this comment

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

Need to open an issue for this

Comment on lines +73 to +74
suite.Assert().EqualValues(122316, int(avgGas), "average gas / lock")
suite.Assert().EqualValues(242903, int(maxGas), "max gas / lock")
Copy link
Member

@ValarDragon ValarDragon Nov 21, 2021

Choose a reason for hiding this comment

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

These constants are suspected to have gone up due to FundAccount instead of SetBalances. This is actually noise we need to remove from the Lockup Gas tests

Copy link
Member

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

Everything looks good to me here, aside from my outstanding comments

@ValarDragon ValarDragon merged commit dedcfb8 into main Nov 21, 2021
@ValarDragon ValarDragon deleted the faddat/sdk-0441 branch November 21, 2021 07:08
@ValarDragon
Copy link
Member

Done, opening follow-up issues now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants