timewave-computer / covenants

Apache License 2.0
17 stars 4 forks source link

Handle ICA timeouts #21

Closed uditvira closed 1 year ago

uditvira commented 1 year ago

https://docs.neutron.org/tutorials/cosmwasm_ica/#timeout

uditvira commented 1 year ago

Main points

uditvira commented 1 year ago

Documenting further for clarity.

There are two distinct settings where timeouts are required.

1. Timeouts for Neutron Submit TX's, where a message is sent by controller to host chain over an ICA.

We will call these ICA timeouts

Example:

let stride_submit_msg = NeutronMsg::submit_tx(
    controller_conn_id,
    INTERCHAIN_ACCOUNT_ID.to_string(),
    vec![protobuf.clone()],
    "".to_string(),
    timeout,
    fee,
    );

ICA timeout strategy

2. Timeouts for an IBC transfer message where the source chain is a host chain.

We will call these IBC transfer timeouts

Example:

  let stride_msg = MsgTransfer {
      source_port: "transfer".to_string(),
      source_channel: gaia_stride_channel,
      token: Some(coin), 
      sender: address,
      receiver: autopilot_receiver,
      timeout_height: Some(Height {
          revision_number: 3,
          revision_height: 1000,
      }),
      timeout_timestamp: 0,
  };

IBC transfer timeout strategy