Refunds of failed ICS20 withdrawals use the bridge address instead of destination chain address.
The fix is to use Ics20WithdrawalFromRollup.rollup_return_address from here:
|
string rollup_return_address = 3; |
Below shows the problematic lines of code.
execute_rollup_withdrawal_refund constructs a Deposit using a destination_address here:
|
execute_deposit(state, bridge_address, denom, amount, destination_address).await?; |
- the packet sender is then parsed as the bridge address AND the destination address:
- here the
recipient var is set to packet.sender:
|
let recipient = if is_refund { |
|
packet_data.sender.clone() |
- here
packet.sender is parsed as a bridge account:
|
let bridge_account = packet_data.sender.parse().context( |
- here we are passing in
recipient as the destination_address and bridge_address as the bridge_address:
|
execute_rollup_withdrawal_refund( |
|
state, |
|
bridge_account, |
|
&denom_trace, |
|
packet_amount, |
|
recipient, |
- but they are the same value!
The comment on Deposit.destination_chain_address reads:
|
// the address on the destination chain which |
|
// will receive the bridged funds |
|
string destination_chain_address = 5; |
┆Issue Number: ENG-771
Refunds of failed ICS20 withdrawals use the bridge address instead of destination chain address.
The fix is to use
Ics20WithdrawalFromRollup.rollup_return_addressfrom here:astria/proto/protocolapis/astria/protocol/memos/v1alpha1/types.proto
Line 42 in c348973
Below shows the problematic lines of code.
execute_rollup_withdrawal_refundconstructs aDepositusing adestination_addresshere:astria/crates/astria-sequencer/src/ibc/ics20_transfer.rs
Line 529 in c348973
recipientvar is set topacket.sender:astria/crates/astria-sequencer/src/ibc/ics20_transfer.rs
Lines 383 to 384 in c348973
packet.senderis parsed as a bridge account:astria/crates/astria-sequencer/src/ibc/ics20_transfer.rs
Line 411 in c348973
recipientas thedestination_addressandbridge_addressas thebridge_address:astria/crates/astria-sequencer/src/ibc/ics20_transfer.rs
Lines 415 to 420 in c348973
The comment on
Deposit.destination_chain_addressreads:astria/proto/sequencerblockapis/astria/sequencerblock/v1alpha1/block.proto
Lines 86 to 88 in c348973
┆Issue Number: ENG-771