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

build(deps): bump ibc to 4.3.0 and wasmd to 0.30.0 #1079

Merged
merged 7 commits into from
Feb 7, 2023

Conversation

dadamu
Copy link
Contributor

@dadamu dadamu commented Feb 2, 2023

Description

This PR bumps ibc-go to v4.3.0 and wasmd to v0.30.0.

The ibc-go migration is based on this guide, and the wasmd migration references the app.go file.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@dadamu dadamu requested a review from a team as a code owner February 2, 2023 10:30
@github-actions github-actions bot added kind/build Related to the build of the project x/CLI x/profiles Module that allows to create and manage decentralized social profiles x/relationships x/subspaces Issue on the x/subspaces module labels Feb 2, 2023
@codecov
Copy link

codecov bot commented Feb 2, 2023

Codecov Report

Base: 80.38% // Head: 80.45% // Increases project coverage by +0.06% 🎉

Coverage data is based on head (aaac09c) compared to base (c30e7a4).
Patch coverage: 84.21% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1079      +/-   ##
==========================================
+ Coverage   80.38%   80.45%   +0.06%     
==========================================
  Files         180      180              
  Lines       15735    15746      +11     
==========================================
+ Hits        12649    12668      +19     
+ Misses       2529     2522       -7     
+ Partials      557      556       -1     
Impacted Files Coverage Δ
app/ante.go 64.70% <ø> (ø)
x/profiles/client/cli/cli_app_links.go 43.93% <ø> (ø)
x/profiles/ibc_module.go 0.00% <0.00%> (ø)
x/profiles/keeper/relay_app_links.go 86.88% <ø> (ø)
x/profiles/types/genesis.go 89.39% <ø> (ø)
x/profiles/types/msgs_app_links.go 87.32% <ø> (ø)
app/app.go 88.63% <95.52%> (+1.28%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment on lines 85 to 97
version string,
) error {
) (string, error) {
if err := ValidateProfilesChannelParams(ctx, am.keeper, order, portID, channelID); err != nil {
return err
return "", err
}

// Claim channel capability passed back by IBC module
if err := am.keeper.ClaimCapability(ctx, channelCap, host.ChannelCapabilityPath(portID, channelID)); err != nil {
return err
return "", err
}

return nil
return version, nil
}
Copy link
Contributor Author

@dadamu dadamu Feb 2, 2023

Choose a reason for hiding this comment

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

We didn't define the ibc-profiles port version, so this phase we don't check the version and always return the version from requeset.
See:
https://github.com/cosmos/ibc/blob/0cd3e7de753fc44508f4a76269bc2d71a487c059/spec/core/ics-026-routing-module/README.md#chanopeninit

@dadamu dadamu marked this pull request as draft February 2, 2023 12:39
@@ -372,7 +347,7 @@ func init() {
func NewDesmosApp(
logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool,
homePath string, invCheckPeriod uint, encodingConfig simappparams.EncodingConfig,
appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp),
appOpts servertypes.AppOptions, wasmEnabledProposals []wasm.ProposalType, baseAppOptions ...func(*baseapp.BaseApp),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add wasmEnabledProposals parameter since wasm sim tests requires enabling all proposal types like:
https://github.com/CosmWasm/wasmd/blob/v0.30.0/app/sim_test.go#L155

Comment on lines +254 to +255
// delete persistent tx counter value
ctxA.KVStore(app.keys[wasm.StoreKey]).Delete(wasmtypes.TXCounterPrefix)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wasm simulation does not check TxCounter, it must be deleted manually here.
See:
https://github.com/CosmWasm/wasmd/blob/v0.30.0/x/wasm/keeper/ante.go#L24

Comment on lines -107 to -120
// set sim params to overwrite wasmd default reflect.wasm path
simParams := simtypes.AppParams{
wasmsim.OpReflectContractPath: json.RawMessage(`"../testutil/wasm/reflect.wasm"`),
}

bz, err := json.Marshal(simParams)
if err != nil {
return simtypes.Config{}, nil, "", nil, false, sdkerrors.Wrap(err, "marshal sim custom params")
}
config.ParamsFile = filepath.Join(dir, "sim-params.json")
err = ioutil.WriteFile(config.ParamsFile, bz, 0o600)
if err != nil {
return simtypes.Config{}, nil, "", nil, false, sdkerrors.Wrap(err, "write temp sim params")
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No idea why it was needed. The default path should work properly, and the default one does not require to track the test contract ../testutil/wasm/reflect.wasm version. So I delete it.

@@ -1,14 +1,14 @@
module github.com/desmos-labs/desmos/v4

go 1.18
go 1.19
Copy link
Contributor Author

@dadamu dadamu Feb 2, 2023

Choose a reason for hiding this comment

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

The wasmd 0.30.0 requires go 1.19, Desmos should follow the version now.

@dadamu dadamu marked this pull request as ready for review February 3, 2023 05:31
@dadamu dadamu mentioned this pull request Feb 3, 2023
19 tasks
if loadLatest {
if err := app.LoadLatestVersion(); err != nil {
tmos.Exit(err.Error())
}
}
ctx := app.BaseApp.NewUncachedContext(true, tmproto.Header{})
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this used for?

Copy link
Contributor Author

@dadamu dadamu Feb 3, 2023

Choose a reason for hiding this comment

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

It is used for InitializePinnedCodes function, which initializes wasmVM caching contracts codes. See:
https://github.com/CosmWasm/wasmd/blob/88e01a98ab8a87b98dc26c03715e6aef5c92781b/x/wasm/keeper/keeper.go#L885

The pinned codes is defined by the proposals, see:
https://github.com/CosmWasm/docs/blob/1629990736eb934c164dfa693299141fd3c2e14a/docs/04-smart-contracts/12-code-pinning.md

I think it was missing to add this part in Desmos, since it is added in wasmd app here:
https://github.com/CosmWasm/wasmd/blob/v0.30.0/app/app.go#L795-L806

@@ -274,6 +275,7 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts serverty
cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)),
app.MakeTestEncodingConfig(), // Ideally, we would reuse the one created by NewRootCmd.
appOpts,
wasm.DisableAllProposals,
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we get this list from somewhere? Otherwise we will have all proposals always disabled. Or am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, currently it is hard coded, and it requires all the nodes having the same accepted list. Hope they can have the on chain parameter in the future.
Here I use the previous setting which disabled all proposals.

go.mod Outdated
// Our wasmd branch is: https://github.com/desmos-labs/wasmd v0.28.x-desmos
github.com/CosmWasm/wasmd => github.com/desmos-labs/wasmd v0.29.0-desmos.2
// Our wasmd branch is: https://github.com/desmos-labs/wasmd v0.30.x-desmos
github.com/CosmWasm/wasmd => github.com/desmos-labs/wasmd v0.23.1-0.20230202060518-edbdd2dcb064
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably better to tag a version here before merging this PR. So we can use v0.30.0-desmos.1 instead of the commit hash

@dadamu dadamu requested a review from RiccardoM February 6, 2023 07:47
@RiccardoM RiccardoM added the automerge Automatically merge PR once all prerequisites pass label Feb 7, 2023
@mergify mergify bot merged commit efbb0b9 into master Feb 7, 2023
@mergify mergify bot deleted the paul/bump-wasmd-and-ibc branch February 7, 2023 15:03
mergify bot pushed a commit that referenced this pull request Feb 7, 2023
## Description

This PR integrates ibc fee middleware for ibc modules, allowing the relayer operators to receive tokens when submit the ibc transactions.

This integration follows [this guide](https://ibc.cosmos.network/main/middleware/ics29-fee/integration.html).

Note:
The channel to support ibc fee middleware should have the version like:
```json
{"fee_version": "ics29-1", "app_version": "ics20-1"}
```
If the version does not include `fee_version`, for example `ics20-1`, then the channel will be considered without middleware, then passing the version onto underlying IBC module and also tagging the channel is not `FeeEnabled`. The channel version is set in relayer side. So it should work properly integrate ibc fee in our side app only. See [here](https://github.com/cosmos/ibc-go/blob/v4.3.0/modules/apps/29-fee/ibc_middleware.go#L34-L82).


Depends-On: #1079

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html)
- [ ] included the necessary unit and integration [tests](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once all prerequisites pass kind/build Related to the build of the project x/CLI x/profiles Module that allows to create and manage decentralized social profiles x/relationships x/subspaces Issue on the x/subspaces module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants