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 IBC Ping Pong contract demo #259

Merged
merged 5 commits into from
Aug 25, 2020
Merged

Conversation

alpe
Copy link
Member

@alpe alpe commented Aug 22, 2020

  • Adds relay_pingpong_test.go as happy path for Complete IBC Mock testing #255
  • Contains contract interface redesign and 🐛 fixes that I had started already

@alpe alpe force-pushed the alex_ibc_spike2e_pingpong branch from aa2bea0 to cabc206 Compare August 24, 2020 08:37
@alpe alpe marked this pull request as ready for review August 24, 2020 08:44
@alpe alpe requested a review from ethanfrey August 24, 2020 08:47
@codecov
Copy link

codecov bot commented Aug 24, 2020

Codecov Report

Merging #259 into alex_ibc_spike2d will increase coverage by 0.35%.
The diff coverage is 31.50%.

Impacted file tree graph

@@                 Coverage Diff                  @@
##           alex_ibc_spike2d     #259      +/-   ##
====================================================
+ Coverage             17.08%   17.43%   +0.35%     
====================================================
  Files                    36       36              
  Lines                 11557    11516      -41     
====================================================
+ Hits                   1974     2008      +34     
+ Misses                 9483     9406      -77     
- Partials                100      102       +2     
Impacted Files Coverage Δ
x/wasm/internal/keeper/ibc.go 9.37% <0.00%> (+0.61%) ⬆️
x/wasm/internal/types/codec.go 44.44% <0.00%> (ø)
x/wasm/internal/types/msg.go 44.69% <0.00%> (+1.31%) ⬆️
x/wasm/internal/types/ibc.pb.go 1.05% <2.77%> (+0.27%) ⬆️
x/wasm/internal/keeper/keeper.go 88.10% <20.00%> (-3.24%) ⬇️
x/wasm/internal/keeper/handler_plugin.go 56.47% <26.74%> (-17.28%) ⬇️
x/wasm/ibc.go 63.15% <97.29%> (+12.13%) ⬆️

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 92f9b28...878cfe7. Read the comment docs.

Copy link
Member

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

Start review, cover internal package.
Will do follow up review on ping_pong test

x/wasm/ibc.go Show resolved Hide resolved
x/wasm/ibc_testing/chain.go Show resolved Hide resolved
x/wasm/internal/keeper/cosmwasm/contract.go Show resolved Hide resolved
x/wasm/internal/keeper/cosmwasm/msg.go Outdated Show resolved Hide resolved
x/wasm/internal/keeper/handler_plugin.go Show resolved Hide resolved
x/wasm/internal/keeper/handler_plugin.go Show resolved Hide resolved
x/wasm/internal/keeper/handler_plugin.go Show resolved Hide resolved
x/wasm/internal/keeper/handler_plugin.go Show resolved Hide resolved
x/wasm/internal/keeper/ibc.go Show resolved Hide resolved
x/wasm/internal/keeper/reflect_test.go Show resolved Hide resolved
Copy link
Member

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

Comments on relay test

x/wasm/relay_pingpong_test.go Show resolved Hide resolved
x/wasm/relay_pingpong_test.go Show resolved Hide resolved
}, 0, nil
}

otherCount := receivedBall[counterParty(p.actor)]
Copy link
Member

Choose a reason for hiding this comment

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

Let's add a max hits (3 or 4) and if this is higher, then we return IBCPacketReceiveResponse with a "failed" response. In this case, we do not initiate another round. It will allow us to test error handling in acknowledge.

Copy link
Member

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

Looks good to merge except for some errand text renamings.

Two things needed in follow-up PRs:

  • Run the ping pong until maxValue, so we get an failure and stop. This failure should be properly relayed and not return an error to the ibc handler (and rollback the tx).
  • Try version negotiation (ADR25) and see if that works or not - if not, make an issue about it. This can be done separately in a minor PR so we can link the failing code without blocking on it being fixed.

Also submit the issue about ordered channels not working (maybe linking to another intentionally broken pr)

x/wasm/genesis_test.go Outdated Show resolved Hide resolved
x/wasm/handler.go Outdated Show resolved Hide resolved
x/wasm/relay_pingpong_test.go Show resolved Hide resolved
x/wasm/relay_pingpong_test.go Show resolved Hide resolved
x/wasm/relay_pingpong_test.go Show resolved Hide resolved
x/wasm/relay_test.go Outdated Show resolved Hide resolved
@alpe alpe merged commit 9073b89 into alex_ibc_spike2d Aug 25, 2020
@alpe alpe deleted the alex_ibc_spike2e_pingpong branch August 25, 2020 06:47
zemyblue pushed a commit to Finschia/wasmd that referenced this pull request Jan 2, 2023
zemyblue pushed a commit to Finschia/wasmd that referenced this pull request Jan 2, 2023
…ster

* remotes/gaia/master: (38 commits)
  Merge PR CosmWasm#259: Bump SDK master commit
  Exec go mod tidy (CosmWasm#267)
  Merge PR CosmWasm#265: add version v2.0.5 to CHANGELOG
  Fix broken link in delegator guide (CosmWasm#262)
  docs: removed redundant readme.md (CosmWasm#261)
  Merge PR CosmWasm#258: Bump github.com/spf13/viper from 1.6.1 to 1.6.2
  Merge PR CosmWasm#250: Docs-update
  Merge PR CosmWasm#256: Bump github.com/pkg/errors from 0.9.0 to 0.9.1
  Merge PR CosmWasm#255: Bump github.com/pkg/errors from 0.8.1 to 0.9.0
  Merge PR CosmWasm#253: Bump SDK master commit
  Merge PR CosmWasm#252: v2.0.4 Changelog
  Merge PR CosmWasm#249: docker image build and upload for release tags
  Merge PR CosmWasm#247: Update SDK Commit & Update CLI Doc
  Merge PR CosmWasm#246: Update Archive page with explorers
  Merge PR CosmWasm#245: archives
  Bump SDK commit to the latest master (CosmWasm#239)
  Merge PR CosmWasm#215: Update simulation tests
  Update join-mainnet.md (CosmWasm#229)
  Incorporate SDK's latest changes (CosmWasm#227)
  Merge PR CosmWasm#221: Hide unnecessarily exported function to better coverage report
  ...
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.

2 participants