cosmos / relayer

An IBC relayer for ibc-go
Apache License 2.0
390 stars 1.71k forks source link

memo entry in not populated for transactions via the relayer #1351

Closed spidey-169 closed 11 months ago

spidey-169 commented 11 months ago

I initialized and setup the relayer following the instructions https://github.com/cosmos/relayer and was able to setup relayers for celestia<->osmosis, celestia<->injective and celestia<->axelar channels. However when broadcasting transaction. the memo entry is not populating. I am using rly 2.4.2 but have tried 2.4.0 and giving the same issue. I have also tried passing --memo to rly start command but the issue persists.

I initialized the relayer memo using the command

rly config init --memo "My custom memo"

To check memo, I am broadcasting txn via my relayer as follows:

rly tx transfer celestia osmosis 1115utia osmo1cwuwcuthz5z66lq74qr6jfw5f7tp8qv3whtqqu channel-2 --path celestia-osmosis -d

This is the output from the relayer confiming transaction is broadcasted successfully.

2023-12-04T08:48:30.292318Z     info    Successful transaction  {"provider_type": "cosmos", "chain_id": "celestia", "packet_src_channel": "channel-2", "packet_dst_channel": "channel-6994", "gas_used": 95694, "fees": "204utia", "fee_payer": "celestia1cwuwcuthz5z66lq74qr6jfw5f7tp8qv3hxfqvr", "height": 250153, "msg_types": ["/ibc.applications.transfer.v1.MsgTransfer"], "tx_hash": "2C3E0215D7E8997F862F2E010BFB517F3BDC0791406F34FBD772D0478D7FD4E0"}
2023-12-04T08:48:30.292350Z     info    Successfully sent a transfer    {"src_chain_id": "celestia", "dst_chain_id": "osmosis-1", "send_result": {"successful_src_batches": 1, "successful_dst_batches": 0, "src_send_errors": "<nil>", "dst_send_errors": "<nil>"}}

The transaction on mintscan (with memo entry blank) is https://www.mintscan.io/celestia/tx/2C3E0215D7E8997F862F2E010BFB517F3BDC0791406F34FBD772D0478D7FD4E0?height=250153

My config.yaml file looks like this

lobal:
    api-listen-addr: :5183
    timeout: 10s
    memo: Relayed by spidey| Support by delegating to our validator on Celestia mainnet https://www.mintscan.io/celestia/validators/c
elestiavaloper1st4h4ymu52hwtl3s0n298t6adj0vputx8jw8xt
    light-cache-size: 20
chains:
    axelar:
        type: cosmos
        value:
            key-directory: /home/spidey/.relayer/keys/axelar-dojo-1
            key: axelar-relayer-wallet
            chain-id: axelar-dojo-1
            rpc-addr: https://axelar-rpc.qubelabs.io:443
            account-prefix: axelar
            keyring-backend: test
            gas-adjustment: 1.2
            gas-prices: 0.01uaxl
            min-gas-amount: 0
            max-gas-amount: 0
            debug: false
            timeout: 20s
            block-timeout: ""
            output-format: json
            sign-mode: direct
            extra-codecs: []
            coin-type: 118
            signing-algorithm: ""
           xxxx

Please let me know if I have missed any info helpful for you to debug this issue. I have tried searching but haven't found this issue here hence wanted to bring to your attention.

Regards, spidey

jtieri commented 11 months ago

thanks for opening an issue as well as for the very detailed write up here.

this was plenty of information for me to do some digging and find that you are absolutely correct, currently the relayer is only consuming the custom memo for ics-20 transfers that are processed via rly start. when a user attempts to send their own transfer and relay it from the relayer it is consuming an empty string

https://github.com/cosmos/relayer/blob/7f03bc726608a044d59cbf5e3e560f7ee99051fa/cmd/tx.go#L998

https://github.com/cosmos/relayer/blob/7f03bc726608a044d59cbf5e3e560f7ee99051fa/relayer/packet-tx.go#L105

looks like we just need to add the appropriate flags and check the configuration file accordingly and pipe this data into the transfer call.

spidey-169 commented 11 months ago

Thanks @jtieri for quickly finding and confirming the issue. Looking like the fix is minor so as to be included in the next patch. I will also see if I can dig in and create a PR with the correct flags passed, otherwise do include the fix from your end in the next patch release.

Thanks again.

jtieri commented 11 months ago

@spidey-169 I just opened a PR, #1362, which should fix this issue by registering the --memo flag and passing the value through from the CLI to the broadcast tx logic for rly tx transfer as well as rly tx register-counterparty

thanks for opening the issue!!