Skip to content

Commit

Permalink
ICS29 Fee Middleware Support (#1981)
Browse files Browse the repository at this point in the history
* Add simple_send_tx

Introduce TxConfig

Add test constructor for TxConfig

Add send_tx method on ChainDriver

Accept Wallet instead of WalletAddress for transferring tokens

Implement ibc_token_transfer

Simplify ibc_token_transfer

Token transfer using ibc_token_transfer is now working

* Move AddressType into TxConfig, as it is configured per chain

* Disable GRPC Web and not rely on chain version

* Clean up ibc_transfer_token interface on ChainDriver

* Use longer IBC transfer timeout

* Further increase IBC transfer timeout

* Fix client expiration test in gaia7

* Move tx_raw_ft_transfer to simulation test

* Update protobuf and add basic channel with fee test

* Basic transfer with pay packet is working

* Modularize ibc_token_transfer

* Basic relayer fee payment working

* Implementing registering counterparty address

* Fix fee calculation with register counterparty address working

* Wait for TX confirmation straight from TxResponse

* Introduce Token type to encapsulate Denom and amount

* Set full node config mode to "validator"

Set minimum price on node bootstrap

* Refactor wait_tx to work with all responses

* Add fee methods to ChainDriver

* Add back test with no forward relayer setup

* Add timeout fee test

* Simplify wait control flow using iterator and streams

* Implement pay packet fee async

* Relaying of pay packet fee async is somehow not working

* Reproduce execute_schedule slowdown

* Add test to reproduce clear packet failure

* Apply dirty hack fix

* Fix merge error

* Pay packet fee async test is now working

* Refactor ChainDriver methods into separate extension traits

* Refactor chain bootstrap CLI functions

* Move query CLI functions

* Refactor all remaining CLI methods

* Refactor ChainDriver bootstrap methods into extension trait

* Refactor packet workers to simplify control flow

* Provide latest height for clear_packet_on_start_worker

* Still trying to fix Python test

* Clear on start can only be performed within packet cmd worker

* Fix merge conflict

* Clean up for review

* Refactor common code from spawn_packet_worker to handle_execute_schedule

* Better handle packet cmd worker retry

* Remove worker_subborn_strategy

* Add query counterparty address method

* Add basic test and implementation for query incenvized packets

* Copy fee implementations to ibc-relayer crate

* Copy proto message builders to ibc crate

* Remove fee implementation in test framework and import from ibc-relayer

* Catch panics in hang_on_error

* Fix merge error

* Implement maybe_register_counterparty_address

* Add maybe_register_counterparty_address ChainHandle method

* Fix import error

* Add Link option for auto registering counterparty address

* Add auto forward relayer test

* Add test for using fee feature with non-fee channels

* Update protobuf with new port_id field in MsgRegisterCounterpartyAddress

* Fix cargo doc

* Add RawCoin type with string as denom

* Use Amount instead of u128 in Token

* Turn Token into type alias for Coin<Denom>

* Refactor use of encode_message

* Refactor Coin and Amount definitions into separate modules

* Add parsing logic for incentivized packet event

* Update protobuf

* Update CounterpartyAddress to CounterpartyPayee

* Add IncentivizedPacket event to IbcEvent

* Fix itertools dependency

* Testing of incentivized packet event is working

* Fix merge error

* Split fee tests into separate files

* Fix fee tests not running on CI, and fix test_auto_forward_relayer

* Test incentivized packet event after pay packet fee async

* Fix merge error

* Update ibc-go

* Update Cosmos.nix and ibc-go version

* Update Cosmos.nix

* Fix merge error

* Use back Cosmos.nix master

* Enable general CI test for ibc-go-v4-simapp

* Add register payee test

* Initial draft implementation for register-payee CLI

* Add register counterparty payee CLI

* Fix clippy

* Add test for registering invalid counterparty payee

* Add example config for auto_register_counterparty_payee

* Fix clippy

* Fix test_pay_packet_fee_async error caused by merge conflict

* Fix clippy

* Refactor coin and amount constructs into separate modules

* Follow the same coin display format as in ibc-go

* Initial token amount cannot exceed u64::MAX

* Small cleanup of fee commands

* Apply suggestions from code review

Co-authored-by: Sean Chen <[email protected]>
Signed-off-by: Soares Chen <[email protected]>

* Update compatibility bound for ibc-go

* Fix no-std check

* ICS29: Add `fee transfer` command (#2682)

* WIP: Add `fee transfer` command

* Added config override in order to change  used to transfer tokens with fee

* Added  unit tests for command argument parsing

* Updated  command in order to send a pay message for each transfer message

* Cargo fmt and cargo clippy fixes

* Use main branch of `ibc-proto`

* Update guide templates and fix script

* Added changelog entry

* Added comments in the body of the 'check_can_send_on_channel' function

* Moved imports to top level in 'cli_utils.rs'

* Removed branch specification for ibc-proto repo in no-std-check Cargo.toml

* Added warning when not GNU sed is used

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

* Added 'value_name', 'visible_alias' and unit-tests to the two new commands 'register-counterparty-payee' and 'register-payee'

* Missed renaming some 'ibc' to 'ibc_relayer_types'

* Regenerated Cargo.lock for no-std-check

* Updated guide

* Run more CI integration tests for fee

* Removed ICS29 fee tests using gaia-main, as it has not yet activated the ICS29 feature

* Update tools/integration-test/src/tests/fee/register_payee.rs

Signed-off-by: Sean Chen <[email protected]>

* Update tools/integration-test/src/tests/fee/pay_fee_async.rs

Signed-off-by: Sean Chen <[email protected]>

* Update tools/integration-test/src/bin/test_setup_with_fee_enabled_binary_channel.rs

Signed-off-by: Sean Chen <[email protected]>

* Update tools/integration-test/src/bin/test_setup_with_fee_enabled_binary_channel.rs

Signed-off-by: Sean Chen <[email protected]>

* Update tools/integration-test/src/tests/fee/no_forward_relayer.rs

Signed-off-by: Sean Chen <[email protected]>

* Update tools/integration-test/src/tests/fee/timeout_fee.rs

Signed-off-by: Sean Chen <[email protected]>

* Update tools/integration-test/src/tests/fee/auto_forward_relayer.rs

Signed-off-by: Sean Chen <[email protected]>

* Update tools/integration-test/src/bin/test_setup_with_fee_enabled_binary_channel.rs

Signed-off-by: Sean Chen <[email protected]>

* Formatting

* Increment `maybe_register_counterparty_payee` metric

Co-authored-by: Luca Joss <[email protected]>
Signed-off-by: Romain Ruetschi <[email protected]>

Signed-off-by: Soares Chen <[email protected]>
Signed-off-by: Sean Chen <[email protected]>
Signed-off-by: Romain Ruetschi <[email protected]>
Co-authored-by: Adi Seredinschi <[email protected]>
Co-authored-by: Romain Ruetschi <[email protected]>
Co-authored-by: Sean Chen <[email protected]>
Co-authored-by: Luca Joss <[email protected]>
Co-authored-by: Luca Joss <[email protected]>
  • Loading branch information
6 people authored Oct 24, 2022
1 parent 0753dc9 commit 2122813
Show file tree
Hide file tree
Showing 123 changed files with 4,835 additions and 605 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- New command `fee transfer` which transfers tokens with fees
([#2714](https://github.com/informalsystems/ibc-rs/issues/2714))
43 changes: 43 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,49 @@ jobs:
test -p ibc-integration-test --features ica --no-fail-fast -- \
--nocapture --test-threads=1 test_ica_filter
ics29-fee-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
chain:
- package: ibc-go-v5-simapp
command: simd
account_prefix: cosmos
- package: ibc-go-v6-simapp
command: simd
account_prefix: cosmos
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v15
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@v10
with:
name: cosmos
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: test
args: -p ibc-integration-test --features ics29-fee --no-fail-fast --no-run
- env:
RUST_LOG: info
RUST_BACKTRACE: 1
NO_COLOR_LOG: 1
CHAIN_COMMAND_PATH: ${{ matrix.chain.command }}
ACCOUNT_PREFIX: ${{ matrix.chain.account_prefix }}
run: |
nix shell .#${{ matrix.chain.package }} -c cargo \
test -p ibc-integration-test --features ics29-fee --no-fail-fast -- \
--nocapture --test-threads=1 fee::
model-based-test:
runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down
95 changes: 89 additions & 6 deletions Cargo.lock

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

Loading

0 comments on commit 2122813

Please sign in to comment.