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

Problem: ethermint v0.9.0 is not used #241

Merged
merged 18 commits into from
Dec 8, 2021

Conversation

yihuang
Copy link
Collaborator

@yihuang yihuang commented Dec 3, 2021

Closes: #238

Solution:

  • update ethermint dependency.
  • use a constant mock feemarket keeper for now.

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

Closes: crypto-org-chain#238

Solution:
- update ethermint dependency.
- use a constant mock feemarket keeper for now.
go.mod Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
app/feemarketkeeper.go Outdated Show resolved Hide resolved
@thomas-nguy
Copy link
Collaborator

thomas-nguy commented Dec 6, 2021

I think we will need to increment the version for the upgrade handler as well

@yihuang
Copy link
Collaborator Author

yihuang commented Dec 6, 2021

I think we will need to increment the version for the upgrade handler as well

Added an upgrade handler for the next major version number v0.7.0.
I think the ConsensusVersion number of cronos module don't need to update because there's nothing to migrate in that module?

@codecov
Copy link

codecov bot commented Dec 6, 2021

Codecov Report

Merging #241 (49eb101) into main (3ea70c5) will increase coverage by 3.29%.
The diff coverage is 0.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #241      +/-   ##
==========================================
+ Coverage   21.51%   24.80%   +3.29%     
==========================================
  Files          27       34       +7     
  Lines        1729     2572     +843     
==========================================
+ Hits          372      638     +266     
- Misses       1324     1887     +563     
- Partials       33       47      +14     
Impacted Files Coverage Δ
app/prefix.go 0.00% <0.00%> (ø)
app/test_helpers.go 0.00% <0.00%> (ø)
x/cronos/genesis.go 61.53% <ø> (-38.47%) ⬇️
x/cronos/handler.go 100.00% <ø> (ø)
x/cronos/keeper/evm.go 56.31% <ø> (+4.58%) ⬆️
x/cronos/keeper/evm_hooks.go 90.00% <ø> (ø)
x/cronos/keeper/evm_log_handlers.go 83.50% <ø> (ø)
x/cronos/keeper/gravity_hooks.go 0.00% <ø> (ø)
x/cronos/keeper/grpc_query.go 0.00% <ø> (ø)
x/cronos/keeper/ibc.go 83.20% <ø> (+5.01%) ⬆️
... and 30 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 c3a4283...49eb101. Read the comment docs.

go.mod Outdated Show resolved Hide resolved
@yihuang
Copy link
Collaborator Author

yihuang commented Dec 7, 2021

integration tests passed.

@thomas-nguy
Copy link
Collaborator

is it still a draft?

@yihuang yihuang marked this pull request as ready for review December 7, 2021 08:25
@yihuang yihuang requested a review from a team as a code owner December 7, 2021 08:25
@yihuang yihuang requested review from JayT106 and devashishdxt and removed request for a team December 7, 2021 08:25
@yihuang
Copy link
Collaborator Author

yihuang commented Dec 7, 2021

is it still a draft?

changed, it's ready for review and merge.

replace github.com/tharsis/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20211207040748-254df3803d62
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
replace github.com/tharsis/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20211207040748-254df3803d62
// https://github.com/crypto-org-chain/ethermint/tree/v0.9.x-cronos
replace github.com/tharsis/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20211207040748-254df3803d62

go.mod Outdated Show resolved Hide resolved
@thomas-nguy
Copy link
Collaborator

lgtm

@tomtau could you review the upgrade section part? I think no there is no migration to be done on ethermint side

// upgrade handler
plan0_7_0 := "v0.7.0"
app.UpgradeKeeper.SetUpgradeHandler(plan0_7_0, func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if the ibc-go module version increased? https://github.com/cosmos/ibc-go/blob/main/modules/core/module.go#L164
there isn't much change between ibc-go 1 and 2, but not sure whether one shouldn't explicitly pass it in the upgrade handler so that the version map gets upgraded for the future

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the fromVM is loaded from the storage, and RunMigrations will migrate them to current version automatically, so it should work?

Copy link
Contributor

Choose a reason for hiding this comment

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

if that's desirable with the fork to upstream migration later (I'm assuming when it adds the hooks or middleware, it'll be increased to 3?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if that's desirable with the fork to upstream migration later (I'm assuming when it adds the hooks or middleware, it'll be increased to 3?)

do you mean the cronos module? I think if there's nothing to migrate in the storage, there's no need to increase the consensus version, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant the ibc-go fork. ConsensusVersion in a module should be increased with any state-breaking changes, so hopefully it's fine

Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

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

I think fee market has some on-chain parameters, so maybe those should be initialised in the upgrade handler?

@yihuang
Copy link
Collaborator Author

yihuang commented Dec 7, 2021

I think fee market has some on-chain parameters, so maybe those should be initialised in the upgrade handler?

RunMigrations will run InitGenesis if the module is not in fromVM but in current app, I think that should do it?

@tomtau
Copy link
Contributor

tomtau commented Dec 7, 2021

I think fee market has some on-chain parameters, so maybe those should be initialised in the upgrade handler?

RunMigrations will run InitGenesis if the module is not in fromVM but in current app, I think that should do it?

but fromVM will contain the old store's version map, not the one being migrated to?

@yihuang
Copy link
Collaborator Author

yihuang commented Dec 7, 2021

I think fee market has some on-chain parameters, so maybe those should be initialised in the upgrade handler?

RunMigrations will run InitGenesis if the module is not in fromVM but in current app, I think that should do it?

but fromVM will contain the old store's version map, not the one being migrated to?

fromVM is the version before upgrade, it'll compare it with current one and execute the migration, feemarket is not contained in fromVM but exists in current app, so it'll call InitGenesis and store the new version number, https://github.com/cosmos/cosmos-sdk/blob/master/types/module/module.go#L432.
That's my understanding from the code, haven't tested it yet, opened an issue to test it in integration test: #247

@tomtau
Copy link
Contributor

tomtau commented Dec 8, 2021

ok, and is feemarket's DefaultGenesis genesis reasonable or would that break or make things crazy (e.g. unreasonably low or high costs)?

@yihuang
Copy link
Collaborator Author

yihuang commented Dec 8, 2021

ok, and is feemarket's DefaultGenesis genesis reasonable or would that break or make things crazy (e.g. unreasonably low or high costs)?

Hmm, that's sth need to be aware of, the default InitialBaseFee(1000000000) happens to be much lower than our validator minimal gas price (5000000000000), both constraints are enforced, so it's ok.
I'll add a comment about this.

app/app.go Show resolved Hide resolved
go.mod Outdated

replace github.com/cosmos/iavl => github.com/cosmos/iavl v0.17.1
replace github.com/cosmos/iavl => github.com/cosmos/iavl v0.17.2
Copy link
Contributor

Choose a reason for hiding this comment

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

v0.17.2 had some race condition / concurrent access issues -- not sure if this can manifest in Ethermint / Web3 APIs: cosmos/iavl@v0.17.2...v0.17.3 but perhaps better to use the latest one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

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

the mainnet beta upgrade should be better planned, so for the feemarket network param value, the upgrade handler can be later adjusted

@thomas-nguy
Copy link
Collaborator

can you add an entry on the changelog?

@yihuang
Copy link
Collaborator Author

yihuang commented Dec 8, 2021

can you add an entry on the changelog?

done

@yihuang yihuang merged commit e4f0455 into crypto-org-chain:main Dec 8, 2021
@yihuang yihuang deleted the ethermint-mai branch December 8, 2021 08:44
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.

Feat: upgrade ethermint to v0.9.x
3 participants