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

Upgrade to IBC v4.2.0 with interchain-accounts v0.2.4 #1088

Merged
merged 7 commits into from
Nov 22, 2022
Merged

Upgrade to IBC v4.2.0 with interchain-accounts v0.2.4 #1088

merged 7 commits into from
Nov 22, 2022

Conversation

alpe
Copy link
Contributor

@alpe alpe commented Nov 10, 2022

Resolves #960
Upgrade to ibc-go v4.2.0

Includes:

  • IBC protocol handshake
  • interchain-accounts v0.2.4
  • Updates to the ibctesting package coming from the ibc-go repo. Credits and big thank you to the original authors

You can read more about ibc fees middleware included in v4 in this article

Notes for users

In order to submit a relayer fee for an IBC packet, a MsgPayPacketFee needs to be in the TX before the packet creating msg.

  • native ics20 transfer:
transferCoin := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(1))
ibcPayloadMsg := ibctransfertypes.NewMsgTransfer(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, transferCoin, actorChainA.String(), receiver.String(), clienttypes.Height{}, uint64(time.Now().Add(time.Minute).UnixNano()))
ibcPackageFee := ibcfee.NewFee(oneToken, oneToken, sdk.Coins{})
feeMsg := ibcfee.NewMsgPayPacketFee(ibcPackageFee, ibctransfertypes.PortID, path.EndpointA.ChannelID, actorChainA.String(), nil)

_, err = chainA.SendMsgs(feeMsg, ibcPayloadMsg)
  • cw20-ics transfer
execMsg := wasmtypes.MsgExecuteContract{
	Sender:   actorChainA.String(),
	Contract: cw20ContractAddr.String(),
	Msg:      exec,
}
ibcPackageFee := ibcfee.NewFee(oneToken, oneToken, sdk.Coins{})
feeMsg := ibcfee.NewMsgPayPacketFee(ibcPackageFee, ibcContractPortID, path.EndpointA.ChannelID, actorChainA.String(), nil)

_, err = chainA.SendMsgs(feeMsg, &execMsg)

@codecov
Copy link

codecov bot commented Nov 10, 2022

Codecov Report

Merging #1088 (48642be) into main (c0a482e) will increase coverage by 0.00%.
The diff coverage is 60.86%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1088   +/-   ##
=======================================
  Coverage   59.79%   59.80%           
=======================================
  Files          54       54           
  Lines        7273     7306   +33     
=======================================
+ Hits         4349     4369   +20     
- Misses       2612     2621    +9     
- Partials      312      316    +4     
Impacted Files Coverage Δ
app/ante.go 62.50% <ø> (ø)
app/test_access.go 0.00% <ø> (ø)
app/test_helpers.go 0.79% <0.00%> (-0.02%) ⬇️
x/wasm/keeper/handler_plugin.go 85.14% <ø> (ø)
x/wasm/keeper/handler_plugin_encoders.go 80.88% <ø> (ø)
x/wasm/keeper/ibc.go 77.77% <ø> (ø)
x/wasm/keeper/query_plugins.go 81.81% <ø> (ø)
x/wasm/keeper/relay.go 96.47% <50.00%> (-1.21%) ⬇️
x/wasm/ibc.go 67.41% <58.06%> (-2.10%) ⬇️
app/app.go 88.54% <100.00%> (+0.39%) ⬆️

@alpe alpe marked this pull request as ready for review November 15, 2022 11:37
@alpe alpe marked this pull request as draft November 16, 2022 14:05
@alpe alpe marked this pull request as ready for review November 17, 2022 17:04
Copy link
Contributor

@pinosu pinosu left a comment

Choose a reason for hiding this comment

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

Excellent work! Many changes but the extensive testing you provided covers them very well! 💯

@sonarcloud
Copy link

sonarcloud bot commented Nov 22, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 12 Code Smells

No Coverage information No Coverage information
7.4% 7.4% Duplication

@alpe alpe merged commit e6f5149 into main Nov 22, 2022
@alpe alpe deleted the 960_ibc420 branch November 22, 2022 09:54
alpe added a commit that referenced this pull request Nov 22, 2022
* main:
  Upgrade to IBC v4.2.0 with interchain-accounts v0.2.4 (#1088)
NoahSaso pushed a commit to NoahSaso/wasmd that referenced this pull request Dec 2, 2022
* Upgrade to IBC v4.2.0 with interchain-accounts v0.2.4

* Fix linter issues

* Test version handshake

* Add more ibc e2e scenarios

* Add fee middleware to wasm

* Get ibc app version from middleware
Magicloud pushed a commit to fpco/wasmd that referenced this pull request Jan 13, 2023
* Upgrade to IBC v4.2.0 with interchain-accounts v0.2.4

* Fix linter issues

* Test version handshake

* Add more ibc e2e scenarios

* Add fee middleware to wasm

* Get ibc app version from middleware
conorpp pushed a commit to wormhole-foundation/wasmd that referenced this pull request Feb 1, 2023
* Upgrade to IBC v4.2.0 with interchain-accounts v0.2.4

* Fix linter issues

* Test version handshake

* Add more ibc e2e scenarios

* Add fee middleware to wasm

* Get ibc app version from middleware
youngjoon-lee added a commit to medibloc/panacea-core that referenced this pull request Feb 4, 2023
youngjoon-lee added a commit to medibloc/panacea-core that referenced this pull request Feb 5, 2023
loloicci pushed a commit to Finschia/wasmd that referenced this pull request Aug 2, 2023
…#1088)

cherry-pick original CosmWasm#1088 except ICA part.

* Upgrade to IBC v4.2.0 with interchain-accounts v0.2.4

* Fix linter issues

* Test version handshake

* Add more ibc e2e scenarios

* Add fee middleware to wasm

* Get ibc app version from middleware
zemyblue pushed a commit to Finschia/wasmd that referenced this pull request Aug 3, 2023
* feat: Upgrade to IBC v4.2.0 with interchain-accounts v0.2.4 (CosmWasm#1088)

cherry-pick original CosmWasm#1088 except ICA part.

* Upgrade to IBC v4.2.0 with interchain-accounts v0.2.4

* Fix linter issues

* Test version handshake

* Add more ibc e2e scenarios

* Add fee middleware to wasm

* Get ibc app version from middleware

* feat: remove channel hack

cherry-picking d522e54

* docs: add this PR to CHANGELOG

* chore: execute go fmt

* fix: add missed e2e ibc-fees test in cherry-pick

* chore: make format

* fix: fix missed duplicating changes for app/app.go to appplus/app.go

* build: upgrade finschia-sdk to v0.48.0-rc1

---------

Co-authored-by: Alexander Peters <alpe@users.noreply.github.com>
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.

Upgrade to IBC v4 or v5
2 participants