ibc-rs
ibc-rs copied to clipboard
support wrapper type for host client state
Feature Summary
Now that ibc-go comes with wasm-08, client state of an ibc-rs chain maybe stored as wasm wrapped format in wasm-08 enabled chain.
So when MsgConnectionOpenTry
or MsgConnectionOpenAck
is received at ibc-rs, it should expect two cases:
- normal client state. e.g., the chain is using vanilla tendermint engine, so the counterparty ibc-go chain uses ibc-go implementation of ics07.
- wasm wrapped client state. e.g., the chain is using a custom consensus, so the counterparty ibc-go chain uses wasm client via wasm-08
Proposal
We need to introduce an enum:
pub enum HostClientState<T> {
Native {
state: T,
},
Wasm {
state: T,
checksum: Vec<u8>,
latest_height: Height,
},
}
Then, use HosClientState<Ctx::HostClientState>
in the following places:
https://github.com/cosmos/ibc-rs/blob/2378cd4ba45094b8ed856ff7dba5f1d0882f59ae/ibc-core/ics03-connection/src/handler/conn_open_ack.rs#L52
https://github.com/cosmos/ibc-rs/blob/2378cd4ba45094b8ed856ff7dba5f1d0882f59ae/ibc-core/ics03-connection/src/handler/conn_open_try.rs#L42