-
Notifications
You must be signed in to change notification settings - Fork 352
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
ICS29: Add fee transfer
command
#2682
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seanchen1991
approved these changes
Oct 7, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the effort being put into comments and documentation 😄
Yep, thanks @ljoss17 for the thorough testing instructions :) |
romac
commented
Oct 10, 2022
romac
added a commit
that referenced
this pull request
Oct 24, 2022
* 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]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #2714
See #1981 (comment)
Description
Add a
fee transfer
command which can be used to exercise the relayer incentivization support introduced in #1981.Testing
In order to test the
fee transfer
command, open 3 terminals:First terminal
Setup the test chains
nix shell github:informalsystems/cosmos.nix#ibc-go-v5-simapp
ornix shell --extra-experimental-features nix-command --extra-experimental-features flakes github:informalsystems/cosmos.nix#ibc-go-v5-simapp
cd
to thehermes
repoCHAIN_COMMAND_PATH=simd cargo run --bin test_setup_with_fee_enabled_binary_channel
Second terminal
Start a Hermes instance
nix shell github:informalsystems/cosmos.nix#ibc-go-v5-simapp
ornix shell --extra-experimental-features nix-command --extra-experimental-features flakes github:informalsystems/cosmos.nix#ibc-go-v5-simapp
cd
to thehermes
reposource data/test/binary-channels.env
max_msg_num = 30
tomax_msg_num = 4
in the filerelayer-config.toml
located indata/test/
CHAIN_COMMAND_PATH=simd cargo run --bin hermes -- --config $RELAYER_CONFIG start
Third terminal
Transfer some tokens with fees. In addition this tests that if the pay message is not in the same batch as the transfer message, the relayer still receives the fees
cd
to thehermes
reposource data/test/binary-channels.env
gaiad --node $NODE_A_RPC_ADDR query bank balances $NODE_A_WALLETS_RELAYER_ADDRESS
gaiad --node $NODE_A_RPC_ADDR query bank balances $NODE_A_WALLETS_USER1_ADDRESS
gaiad --node $NODE_B_RPC_ADDR query bank balances $NODE_B_WALLETS_USER2_ADDRESS
samoleans
fromuser1
touser2
:cargo run --bin hermes -- --config $RELAYER_CONFIG fee transfer --dst-chain $CHAIN_ID_B --src-chain $CHAIN_ID_A --src-port $PORT_A --src-channel $CHANNEL_ID_A --amount 5321 --denom $NODE_A_DENOM --receive-fee 1233 --ack-fee 772 --timeout-fee 2001 --timeout-seconds 120 --recipient $NODE_B_WALLETS_USER2_ADDRESS --key-name user1 --number-msgs 30
samoleans
(60150)user1
on chain A should have lost 30 times 2005+5321samoleans
(219780)user2
on chain B should have received 30 times 5321ibc/<hash>
(159630)PR author checklist:
unclog
.docs/
).Reviewer checklist:
Files changed
in the GitHub PR explorer.