Skip to content

Commit

Permalink
Use governance proposal to initialise channel upgrade tests (#3680)
Browse files Browse the repository at this point in the history
* Use governance proposal to initialise channel upgrade tests

* Fix issue with chains which don't have 'expedited_voting_period'

* Fix issues post merge

* Correctly determine if the channel is upgrading or not

* Remove CLI to init channel upgrade

* Display channel state as 'Open' regardless if it is upgrading or not

* Change serialize for channel state

* Fix python e2e channel handshake test

* feat: implement chan upgrade cancel and add timeout ack integration test (#3736)

* feat: implement chan-upgrade-cancel and add integration test for timeout on upgrade ack

* uncomment code

* formatting

* Fix channel upgrade timeout and cancel handling

* Fix clippy warnings

* Add channel upgrade cancel tests with supervisor

* Fix typo

* Fix upgrade cancel on confirm test and update guide

* Clean channel upgrade tests

* Additional clean-up in channel upgrade test assertions

* Temporarily disable one chan upgrade timeout test

* Remove incorrect timeout channel upgrade test

---------

Co-authored-by: Luca Joss <[email protected]>
Co-authored-by: Luca Joss <[email protected]>

* Fix Docker workflow after update to upload-artifact@v4

* Fix Artifact name for Docker job

* feat: updates to upgrade fields and logic for `MsgTimeoutOnClose` and `MsgChannelCloseConfirm` (#3764)

* wip: update naming of fields

* add logic to add counterparty upgrade sequence to timeout on close and channel close confirm messages

* add integration test for: when ICA channel upgrades and afterwards packet times out, then channel is closed

* argo fmt --all

* remove empty comment

* Fix channel end parsing and test for ICA timeout after channel upgrade

* Update nix flake

* Improve documentation for upgraded ICA channel close test

* Improve build channel close methods

---------

Co-authored-by: Luca Joss <[email protected]>

* feat: add support for `MsgChannelUpgradeTimeout` and integration test (#3773)

* feat: add support for msgchannelupgradetimeout and integration test

* fix build errors

* Update nix flake

* Update CLI templates

* cargo fmt

* Fix clippy warnings/errors

* Fix extracting upgrade_timeout attribute

* WIP

* Fix channel upgrade logic

* Change Height to QueryHeight for restore_from_state method

---------

Co-authored-by: Luca Joss <[email protected]>

* fetch counterparty upgrade sequence from src chain (#3801)

* test(channel upgradability): add integration test that relays packets during flushing (#3786)

* test: add integration test that flushes packets during channel upgrade

* wip: add counterparty upgrade sequence to chan upgrade open

* update integration test

* cargo fmt

* Fix UpgradeInit parsing and Registering ICA account following simd changes

* handle new fields in messages: order in msg register interchain account and counterparty upgrade sequence in msg channel upgrade open

* fix warnings

* Update Nix flake

* address review comments

* cargo fmt

* some clippy warnings

* fix assert_eq!

* fix test

* cargo fmt

* chore: rename order to ordering in msg register interchain account

* Use ibc-go v8.1.0-rc.0 for channel upgrade tests

* Add and use legacy 'MsgRegisterInterchainAccount'

* Use different signer to initialise channel upgrade for 'test_channel_upgrade_handshake' test

* add test where ICA channel is upgraded to unordered

* cargo fmt + add debug log

* increase packet timeout

* Add case where Channel upgrade Try event is received by source chain while dst chain is open not upgrading

* Use user2 to signe channel upgrade init proposal in ICA unordered test

---------

Co-authored-by: Luca Joss <[email protected]>

* Fix ICS29 timeout fee test compatibility for ibc-go v8.1+

* Add compatibility to ICS29 tests for ibc-go v8.1+

* Fix typos

* Update method used to verify if there is an ongoing channel upgrade

* Update channel query to correctly reflect if it is upgrading or not if the state is open

* Add upgrade handshake step if both channel ends are in open upgrading

* Fix channel state assertion for channel Init and Try steps

* Fix assertions in channel upgrade tests

* Fix verification if channel needs to be flushed

* Add test for packet flushing during channel upgrade

* Fix link creation when channel is upgrading

* test(channel-upgrades): add test where upgrade timeouts on acknowledge packet (#3828)

* add test where upgrade times out during packet ack

* cargo fmt

* Fix packet worker spawning if channel is flushing or flushcomplete

---------

Co-authored-by: Luca Joss <[email protected]>

* Clean-up channel upgrade tests

* Improve channel upgrade workers

* Remove unused code

* Use ibc-proto-rs v0.42.0

* Remove unnecessary code

* Clean up code and remove guide entries for tx channel upgrade init CLI

---------

Co-authored-by: Carlos Rodriguez <[email protected]>
Co-authored-by: Romain Ruetschi <[email protected]>
  • Loading branch information
3 people authored Mar 8, 2024
1 parent c3deea4 commit b4e1d29
Show file tree
Hide file tree
Showing 74 changed files with 4,912 additions and 754 deletions.
42 changes: 1 addition & 41 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
command: simd
account_prefix: cosmos
native_token: stake
features: ica,ics29-fee
features: ica,ics29-fee,channel-upgrade
- package: wasmd
command: wasmd
account_prefix: wasm
Expand Down Expand Up @@ -161,46 +161,6 @@ jobs:
cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \
--features ordered test_ordered_channel
channel-upgrade:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
chain:
- package: ibc-go-v8-channel-upgrade-simapp
command: simd
account_prefix: cosmos
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v24
with:
install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
extra_nix_config: |
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v13
with:
name: cosmos
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
with:
command: test
args: -p ibc-integration-test --features channel-upgrade --no-fail-fast --no-run
- env:
RUST_LOG: debug
RUST_BACKTRACE: 1
NO_COLOR_LOG: 1
CHAIN_COMMAND_PATHS: ${{ matrix.chain.command }}
ACCOUNT_PREFIXES: ${{ matrix.chain.account_prefix }}
run: |
nix shell .#${{ matrix.chain.package }} -c cargo \
test -p ibc-integration-test --features channel-upgrade --no-fail-fast -- \
--nocapture --test-threads=1 channel_upgrade::
interchain-security-no-ica:
runs-on: ubuntu-20.04
strategy:
Expand Down
5 changes: 0 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ exclude = [
overflow-checks = true

[patch.crates-io]
ibc-proto = { git = "https://github.com/cosmos/ibc-proto-rs.git", branch = "romac/channel-upgrade-only" }
# ibc-proto = { git = "https://github.com/cosmos/ibc-proto-rs.git", branch = "main" }
# tendermint = { git = "https://github.com/informalsystems/tendermint-rs.git", branch = "main" }
# tendermint-rpc = { git = "https://github.com/informalsystems/tendermint-rs.git", branch = "main" }
Expand Down
9 changes: 6 additions & 3 deletions crates/relayer-cli/src/commands/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ pub enum TxCmd {
/// Confirm the closing of a channel (ChannelCloseConfirm)
ChanCloseConfirm(channel::TxChanCloseConfirmCmd),

/// Initiate a channel upgrade (ChannelUpgradeInit)
ChanUpgradeInit(channel::TxChanUpgradeInitCmd),

/// Relay the channel upgrade attempt (ChannelUpgradeTry)
ChanUpgradeTry(channel::TxChanUpgradeTryCmd),

Expand All @@ -59,6 +56,12 @@ pub enum TxCmd {
/// Relay the channel upgrade attempt (ChannelUpgradeOpen)
ChanUpgradeOpen(channel::TxChanUpgradeOpenCmd),

/// Relay the channel upgrade cancellation (ChannelUpgradeCancel)
ChanUpgradeCancel(channel::TxChanUpgradeCancelCmd),

/// Relay the channel upgrade timeout (ChannelUpgradeTimeout)
ChanUpgradeTimeout(channel::TxChanUpgradeTimeoutCmd),

/// Send a fungible token transfer test transaction (ICS20 MsgTransfer)
FtTransfer(transfer::TxIcs20MsgTransferCmd),

Expand Down
Loading

0 comments on commit b4e1d29

Please sign in to comment.