From 2006af39e998de4b683c90c5c2c84e6c89f2f93e Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Sat, 11 Jan 2025 23:51:36 +0100 Subject: [PATCH] fix(ibc-union): normalize event name, extend creation with counterparty chain id --- .../app/ucs00-pingpong/src/contract.rs | 9 ++-- .../ibc-union/app/ucs03-zkgm/src/contract.rs | 18 ++++---- .../core/light-client-interface/src/lib.rs | 13 +++++- .../ibc-union/core/msg/src/lightclient.rs | 7 ++++ cosmwasm/ibc-union/core/src/contract.rs | 41 +++++++++++-------- .../light-clients/arbitrum/src/client.rs | 4 ++ .../light-clients/berachain/src/client.rs | 4 ++ .../light-clients/cometbls/src/client.rs | 4 ++ .../light-clients/ethereum/src/client.rs | 4 ++ .../light-clients/movement/src/client.rs | 4 ++ .../state-lens-ics23-mpt/src/client.rs | 4 ++ .../light-clients/tendermint/src/client.rs | 4 ++ .../src/chain_id.rs | 4 ++ lib/ibc-solidity/src/lib.rs | 4 +- .../event-source/cosmos-sdk/src/main.rs | 28 ++++++------- .../plugins/event-source/ethereum/src/main.rs | 10 ++--- voyager/plugins/transaction-batch/src/main.rs | 8 ++-- voyager/plugins/transaction/aptos/src/main.rs | 6 +-- 18 files changed, 117 insertions(+), 59 deletions(-) diff --git a/cosmwasm/ibc-union/app/ucs00-pingpong/src/contract.rs b/cosmwasm/ibc-union/app/ucs00-pingpong/src/contract.rs index 99533bdc70..0575296974 100644 --- a/cosmwasm/ibc-union/app/ucs00-pingpong/src/contract.rs +++ b/cosmwasm/ibc-union/app/ucs00-pingpong/src/contract.rs @@ -52,15 +52,18 @@ pub fn execute( ExecuteMsg::IbcUnionMsg(IbcUnionMsg::OnRecvPacket { packet, .. }) => { let ping_packet = UCS00PingPong::decode(&packet.data)?; let config = CONFIG.load(deps.storage)?; - let msg = - ping_packet.reverse(&config, env.block.time.nanos(), packet.destination_channel); + let msg = ping_packet.reverse( + &config, + env.block.time.nanos(), + packet.destination_channel_id, + ); Ok(Response::default() .add_message(wasm_execute( &config.ibc_host, &ibc_union_msg::msg::ExecuteMsg::WriteAcknowledgement( MsgWriteAcknowledgement { - channel_id: packet.destination_channel, + channel_id: packet.destination_channel_id, packet, acknowledgement: ack_success().into(), }, diff --git a/cosmwasm/ibc-union/app/ucs03-zkgm/src/contract.rs b/cosmwasm/ibc-union/app/ucs03-zkgm/src/contract.rs index a6b9c87a69..bb415178d8 100644 --- a/cosmwasm/ibc-union/app/ucs03-zkgm/src/contract.rs +++ b/cosmwasm/ibc-union/app/ucs03-zkgm/src/contract.rs @@ -223,7 +223,7 @@ fn timeout_internal( match instruction.opcode { OP_FUNGIBLE_ASSET_ORDER => { let order = FungibleAssetOrder::abi_decode_params(&instruction.operand, true)?; - refund(deps, packet.source_channel, order) + refund(deps, packet.source_channel_id, order) } _ => { return Err(ContractError::UnknownOpcode { @@ -366,7 +366,7 @@ fn acknowledge_fungible_asset_order( let base_denom = String::from_utf8(order.base_token.to_vec()) .map_err(|_| ContractError::InvalidBaseToken)?; // TODO: handle forward path - if order.base_token_path == packet.source_channel.try_into().unwrap() { + if order.base_token_path == packet.source_channel_id.try_into().unwrap() { messages.push( TokenFactoryMsg::MintTokens { denom: base_denom, @@ -393,7 +393,7 @@ fn acknowledge_fungible_asset_order( Ok(Response::new().add_messages(messages)) } // Transfer failed, refund - None => refund(deps, packet.source_channel, order), + None => refund(deps, packet.source_channel_id, order), } } @@ -503,7 +503,7 @@ fn execute_fungible_asset_order( } let wrapped_denom = predict_wrapped_denom( path, - packet.destination_channel, + packet.destination_channel_id, Bytes::from(order.base_token.to_vec()), ); let quote_amount = @@ -551,7 +551,7 @@ fn execute_fungible_asset_order( TOKEN_ORIGIN.save( deps.storage, subdenom.clone(), - &Uint256::from_u128(packet.destination_channel as _), + &Uint256::from_u128(packet.destination_channel_id as _), )?; }; messages.push( @@ -573,12 +573,12 @@ fn execute_fungible_asset_order( ); } } else { - if order.base_token_path == packet.source_channel.try_into().unwrap() { + if order.base_token_path == packet.source_channel_id.try_into().unwrap() { let quote_token = String::from_utf8(order.quote_token.to_vec()) .map_err(|_| ContractError::InvalidQuoteToken)?; CHANNEL_BALANCE.update( deps.storage, - (packet.destination_channel, quote_token.clone()), + (packet.destination_channel_id, quote_token.clone()), |balance| match balance { Some(value) => value .checked_sub(quote_amount.into()) @@ -657,7 +657,7 @@ pub fn reply( &ibc_host, &ibc_union_msg::msg::ExecuteMsg::WriteAcknowledgement( MsgWriteAcknowledgement { - channel_id: packet.destination_channel, + channel_id: packet.destination_channel_id, packet, acknowledgement: zkgm_ack.into(), }, @@ -682,7 +682,7 @@ pub fn reply( &ibc_host, &ibc_union_msg::msg::ExecuteMsg::WriteAcknowledgement( MsgWriteAcknowledgement { - channel_id: packet.destination_channel, + channel_id: packet.destination_channel_id, packet, acknowledgement: zkgm_ack.into(), }, diff --git a/cosmwasm/ibc-union/core/light-client-interface/src/lib.rs b/cosmwasm/ibc-union/core/light-client-interface/src/lib.rs index c90c36ce8b..f10efb71f6 100644 --- a/cosmwasm/ibc-union/core/light-client-interface/src/lib.rs +++ b/cosmwasm/ibc-union/core/light-client-interface/src/lib.rs @@ -8,7 +8,7 @@ use cosmwasm_std::{ }; use cw_storage_plus::{Item, Map}; use ibc_union_msg::lightclient::{ - MisbehaviourResponse, QueryMsg, Status, VerifyClientMessageUpdate, + MisbehaviourResponse, QueryMsg, Status, VerifyClientMessageUpdate, VerifyCreationResponse, }; use msg::InstantiateMsg; use state::IBC_HOST; @@ -205,6 +205,9 @@ pub trait IbcClient: Sized { /// Get the height fn get_latest_height(client_state: &Self::ClientState) -> u64; + /// Get the tracked (counterparty) chain id. + fn get_counterparty_chain_id(client_state: &Self::ClientState) -> String; + /// Get the status of the client fn status(client_state: &Self::ClientState) -> Status; @@ -276,7 +279,13 @@ pub fn query( .map_err(|e| IbcClientError::Decode(DecodeError::ConsensusState(e)))?; T::verify_creation(&client_state, &consensus_state)?; - to_json_binary(&T::get_latest_height(&client_state)).map_err(Into::into) + + let response = VerifyCreationResponse { + latest_height: T::get_latest_height(&client_state), + counterparty_chain_id: T::get_counterparty_chain_id(&client_state), + }; + + to_json_binary(&response).map_err(Into::into) } QueryMsg::VerifyMembership { client_id, diff --git a/cosmwasm/ibc-union/core/msg/src/lightclient.rs b/cosmwasm/ibc-union/core/msg/src/lightclient.rs index efd2e01206..917bda9840 100644 --- a/cosmwasm/ibc-union/core/msg/src/lightclient.rs +++ b/cosmwasm/ibc-union/core/msg/src/lightclient.rs @@ -22,6 +22,13 @@ pub struct MisbehaviourResponse { pub client_state: Bytes, } +#[derive(serde::Serialize, serde::Deserialize)] +#[serde(deny_unknown_fields, rename_all = "snake_case")] +pub struct VerifyCreationResponse { + pub latest_height: u64, + pub counterparty_chain_id: String, +} + #[derive(serde::Serialize, serde::Deserialize)] #[serde(deny_unknown_fields, rename_all = "snake_case")] pub enum QueryMsg { diff --git a/cosmwasm/ibc-union/core/src/contract.rs b/cosmwasm/ibc-union/core/src/contract.rs index e60e15d23b..e35b503d0c 100644 --- a/cosmwasm/ibc-union/core/src/contract.rs +++ b/cosmwasm/ibc-union/core/src/contract.rs @@ -9,7 +9,9 @@ use cosmwasm_std::{ use cw_storage_plus::Item; use ibc_solidity::{Channel, ChannelState, Connection, ConnectionState, Packet}; use ibc_union_msg::{ - lightclient::{QueryMsg as LightClientQuery, Status, VerifyClientMessageUpdate}, + lightclient::{ + QueryMsg as LightClientQuery, Status, VerifyClientMessageUpdate, VerifyCreationResponse, + }, module::{ExecuteMsg as ModuleMsg, IbcUnionMsg}, msg::{ ExecuteMsg, InitMsg, MsgBatchAcks, MsgBatchSend, MsgChannelCloseConfirm, @@ -85,6 +87,7 @@ pub mod events { pub const ACKNOWLEDGEMENT: &str = "acknowledgement"; pub const CLIENT_TYPE: &str = "client_type"; pub const CLIENT_ADDRESS: &str = "client_address"; + pub const COUNTERPARTY_CHAIN_ID: &str = "counterparty_chain_id"; pub const COUNTERPARTY_CLIENT_ID: &str = "counterparty_client_id"; pub const COUNTERPARTY_CONNECTION_ID: &str = "counterparty_connection_id"; pub const PORT_ID: &str = "port_id"; @@ -559,8 +562,8 @@ fn timeout_packet( proof_height: u64, relayer: Addr, ) -> ContractResult { - let source_channel = packet.source_channel; - let destination_channel = packet.destination_channel; + let source_channel = packet.source_channel_id; + let destination_channel = packet.destination_channel_id; let channel = ensure_channel_state(deps.as_ref(), source_channel)?; let connection = ensure_connection_state(deps.as_ref(), channel.connection_id)?; @@ -629,8 +632,8 @@ fn acknowledge_packet( ) -> ContractResult { let first = packets.first().ok_or(ContractError::NotEnoughPackets)?; - let source_channel = first.source_channel; - let destination_channel = first.destination_channel; + let source_channel = first.source_channel_id; + let destination_channel = first.destination_channel_id; let channel = ensure_channel_state(deps.as_ref(), source_channel)?; let connection = ensure_connection_state(deps.as_ref(), channel.connection_id)?; @@ -745,7 +748,7 @@ fn create_client( let client_id = next_client_id(deps.branch())?; CLIENT_TYPES.save(deps.storage, client_id, &client_type)?; CLIENT_IMPLS.save(deps.storage, client_id, &client_impl)?; - let latest_height = deps.querier.query_wasm_smart( + let verify_creation_response = deps.querier.query_wasm_smart::( &client_impl, &LightClientQuery::VerifyCreation { client_id, @@ -756,7 +759,7 @@ fn create_client( CLIENT_STATES.save(deps.storage, client_id, &client_state_bytes.to_vec().into())?; CLIENT_CONSENSUS_STATES.save( deps.storage, - (client_id, latest_height), + (client_id, verify_creation_response.latest_height), &consensus_state_bytes.to_vec().into(), )?; store_commit( @@ -768,7 +771,7 @@ fn create_client( deps, &ConsensusStatePath { client_id, - height: latest_height, + height: verify_creation_response.latest_height, } .key(), &commit(consensus_state_bytes), @@ -777,6 +780,10 @@ fn create_client( Response::new().add_event(Event::new(events::client::CREATE).add_attributes([ (events::attribute::CLIENT_TYPE, client_type), (events::attribute::CLIENT_ID, client_id.to_string()), + ( + events::attribute::COUNTERPARTY_CHAIN_ID, + verify_creation_response.counterparty_chain_id, + ), ])), ) } @@ -1396,8 +1403,8 @@ fn process_receive( intent: bool, ) -> Result { let first = packets.first().ok_or(ContractError::NotEnoughPackets)?; - let source_channel = first.source_channel; - let destination_channel = first.destination_channel; + let source_channel = first.source_channel_id; + let destination_channel = first.destination_channel_id; let channel = ensure_channel_state(deps.as_ref(), destination_channel)?; let connection = ensure_connection_state(deps.as_ref(), channel.connection_id)?; @@ -1562,7 +1569,7 @@ fn write_acknowledgement( fn send_packet( mut deps: DepsMut, sender: Addr, - source_channel: u32, + source_channel_id: u32, timeout_height: u64, timeout_timestamp: u64, data: Vec, @@ -1571,26 +1578,26 @@ fn send_packet( return Err(ContractError::TimeoutMustBeSet); } - let port_id = CHANNEL_OWNER.load(deps.storage, source_channel)?; + let port_id = CHANNEL_OWNER.load(deps.storage, source_channel_id)?; if port_id != sender { return Err(ContractError::Unauthorized { - channel_id: source_channel, + channel_id: source_channel_id, owner: port_id, caller: sender, }); } - let channel = ensure_channel_state(deps.as_ref(), source_channel)?; + let channel = ensure_channel_state(deps.as_ref(), source_channel_id)?; let packet = Packet { - source_channel, - destination_channel: channel.counterparty_channel_id, + source_channel_id, + destination_channel_id: channel.counterparty_channel_id, data: data.into(), timeout_height, timeout_timestamp, }; let commitment_key = BatchPacketsPath { - channel_id: source_channel, + channel_id: source_channel_id, batch_hash: commit_packet(&packet), } .key(); diff --git a/cosmwasm/ibc-union/light-clients/arbitrum/src/client.rs b/cosmwasm/ibc-union/light-clients/arbitrum/src/client.rs index acf2b624f9..04d16677d5 100644 --- a/cosmwasm/ibc-union/light-clients/arbitrum/src/client.rs +++ b/cosmwasm/ibc-union/light-clients/arbitrum/src/client.rs @@ -118,6 +118,10 @@ impl IbcClient for ArbitrumLightClient { fn get_latest_height(client_state: &Self::ClientState) -> u64 { client_state.l1_latest_slot } + + fn get_counterparty_chain_id(client_state: &Self::ClientState) -> String { + client_state.chain_id.to_string() + } } // #[cfg(test)] diff --git a/cosmwasm/ibc-union/light-clients/berachain/src/client.rs b/cosmwasm/ibc-union/light-clients/berachain/src/client.rs index ff2a6d6061..551f301557 100644 --- a/cosmwasm/ibc-union/light-clients/berachain/src/client.rs +++ b/cosmwasm/ibc-union/light-clients/berachain/src/client.rs @@ -74,6 +74,10 @@ impl IbcClient for BerachainLightClient { client_state.latest_height } + fn get_counterparty_chain_id(client_state: &Self::ClientState) -> String { + client_state.chain_id.to_string() + } + fn status(_client_state: &Self::ClientState) -> Status { // FIXME: expose the ctx to this call to allow threading this call to L1 // client. generally, we want to thread if a client is an L2 so always diff --git a/cosmwasm/ibc-union/light-clients/cometbls/src/client.rs b/cosmwasm/ibc-union/light-clients/cometbls/src/client.rs index ed7ba5e27c..863b571cbf 100644 --- a/cosmwasm/ibc-union/light-clients/cometbls/src/client.rs +++ b/cosmwasm/ibc-union/light-clients/cometbls/src/client.rs @@ -92,6 +92,10 @@ impl ibc_union_light_client::IbcClient for CometblsLightClient String { + client_state.chain_id.clone().into_string() + } + // TODO(aeryz): pass ctx fn status(client_state: &Self::ClientState) -> ibc_union_msg::lightclient::Status { if client_state.frozen_height.height() != 0 { diff --git a/cosmwasm/ibc-union/light-clients/ethereum/src/client.rs b/cosmwasm/ibc-union/light-clients/ethereum/src/client.rs index 9c1a7e76b7..b62c9922cc 100644 --- a/cosmwasm/ibc-union/light-clients/ethereum/src/client.rs +++ b/cosmwasm/ibc-union/light-clients/ethereum/src/client.rs @@ -78,6 +78,10 @@ impl ibc_union_light_client::IbcClient for EthereumLightClient { client_state.latest_height } + fn get_counterparty_chain_id(client_state: &Self::ClientState) -> String { + client_state.chain_id.to_string() + } + fn status(client_state: &Self::ClientState) -> Status { if client_state.frozen_height.height() != 0 { Status::Frozen diff --git a/cosmwasm/ibc-union/light-clients/movement/src/client.rs b/cosmwasm/ibc-union/light-clients/movement/src/client.rs index a838274e27..7a0d9744d4 100644 --- a/cosmwasm/ibc-union/light-clients/movement/src/client.rs +++ b/cosmwasm/ibc-union/light-clients/movement/src/client.rs @@ -77,6 +77,10 @@ impl ibc_union_light_client::IbcClient for MovementLightClient { client_state.latest_block_num } + fn get_counterparty_chain_id(client_state: &Self::ClientState) -> String { + client_state.chain_id.clone() + } + fn status(client_state: &Self::ClientState) -> Status { if client_state.frozen_height.height() != 0 { Status::Frozen diff --git a/cosmwasm/ibc-union/light-clients/state-lens-ics23-mpt/src/client.rs b/cosmwasm/ibc-union/light-clients/state-lens-ics23-mpt/src/client.rs index 26e962e8c4..b759e44af5 100644 --- a/cosmwasm/ibc-union/light-clients/state-lens-ics23-mpt/src/client.rs +++ b/cosmwasm/ibc-union/light-clients/state-lens-ics23-mpt/src/client.rs @@ -68,6 +68,10 @@ impl IbcClient for StateLensIcs23MptLightClient { client_state.l2_latest_height } + fn get_counterparty_chain_id(client_state: &Self::ClientState) -> String { + client_state.l2_chain_id.clone() + } + fn status(_client_state: &Self::ClientState) -> Status { // FIXME: expose the ctx to this call to allow threading this call to L1 // client. generally, we want to thread if a client is an L2 so always diff --git a/cosmwasm/ibc-union/light-clients/tendermint/src/client.rs b/cosmwasm/ibc-union/light-clients/tendermint/src/client.rs index 3c6fb56b34..43ef2cd6a7 100644 --- a/cosmwasm/ibc-union/light-clients/tendermint/src/client.rs +++ b/cosmwasm/ibc-union/light-clients/tendermint/src/client.rs @@ -149,6 +149,10 @@ impl IbcClient for TendermintLightClient { client_state.latest_height.height() } + fn get_counterparty_chain_id(client_state: &Self::ClientState) -> String { + client_state.chain_id.clone() + } + fn verify_creation( _client_state: &Self::ClientState, _consensus_state: &Self::ConsensusState, diff --git a/lib/cometbls-light-client-types/src/chain_id.rs b/lib/cometbls-light-client-types/src/chain_id.rs index d0bbe362b3..3d9a825fb8 100644 --- a/lib/cometbls-light-client-types/src/chain_id.rs +++ b/lib/cometbls-light-client-types/src/chain_id.rs @@ -14,6 +14,10 @@ pub struct ChainId(String); impl ChainId { pub const MAX_LEN: usize = 31; + pub fn into_string(self) -> String { + self.0 + } + pub fn from_string(s: impl Into) -> Result { let s = s.into(); diff --git a/lib/ibc-solidity/src/lib.rs b/lib/ibc-solidity/src/lib.rs index 5dcdf677f6..09567746c4 100644 --- a/lib/ibc-solidity/src/lib.rs +++ b/lib/ibc-solidity/src/lib.rs @@ -391,8 +391,8 @@ maybe_sol_attr! { serde(deny_unknown_fields) )] struct Packet { - uint32 source_channel; - uint32 destination_channel; + uint32 source_channel_id; + uint32 destination_channel_id; bytes data; uint64 timeout_height; uint64 timeout_timestamp; diff --git a/voyager/plugins/event-source/cosmos-sdk/src/main.rs b/voyager/plugins/event-source/cosmos-sdk/src/main.rs index 723f1fed44..08c18274af 100644 --- a/voyager/plugins/event-source/cosmos-sdk/src/main.rs +++ b/voyager/plugins/event-source/cosmos-sdk/src/main.rs @@ -1446,7 +1446,7 @@ impl PluginServer for Module { self.chain_id.clone(), QueryHeight::Specific(height), ibc_union_spec::ChannelPath { - channel_id: packet.source_channel, + channel_id: packet.source_channel_id, }, ) .await? @@ -1484,7 +1484,7 @@ impl PluginServer for Module { packet_data: packet.data.into(), packet: ibc_union_spec::PacketMetadata { source_channel: ibc_union_spec::ChannelMetadata { - channel_id: packet.source_channel, + channel_id: packet.source_channel_id, version: source_channel.version.clone(), connection: ibc_union_spec::ConnectionMetadata { client_id: source_connection.client_id, @@ -1492,7 +1492,7 @@ impl PluginServer for Module { }, }, destination_channel: ibc_union_spec::ChannelMetadata { - channel_id: packet.destination_channel, + channel_id: packet.destination_channel_id, version: source_channel.version, connection: ibc_union_spec::ConnectionMetadata { client_id: source_connection.counterparty_client_id, @@ -1525,7 +1525,7 @@ impl PluginServer for Module { self.chain_id.clone(), QueryHeight::Specific(height), ibc_union_spec::ChannelPath { - channel_id: packet.source_channel, + channel_id: packet.source_channel_id, }, ) .await? @@ -1563,7 +1563,7 @@ impl PluginServer for Module { packet_data: packet.data.into(), packet: ibc_union_spec::PacketMetadata { source_channel: ibc_union_spec::ChannelMetadata { - channel_id: packet.source_channel, + channel_id: packet.source_channel_id, version: source_channel.version.clone(), connection: ibc_union_spec::ConnectionMetadata { client_id: source_connection.client_id, @@ -1571,7 +1571,7 @@ impl PluginServer for Module { }, }, destination_channel: ibc_union_spec::ChannelMetadata { - channel_id: packet.destination_channel, + channel_id: packet.destination_channel_id, version: source_channel.version, connection: ibc_union_spec::ConnectionMetadata { client_id: source_connection.counterparty_client_id, @@ -1605,7 +1605,7 @@ impl PluginServer for Module { self.chain_id.clone(), QueryHeight::Specific(height), ibc_union_spec::ChannelPath { - channel_id: packet.destination_channel, + channel_id: packet.destination_channel_id, }, ) .await? @@ -1644,7 +1644,7 @@ impl PluginServer for Module { client_meta.chain_id.clone(), QueryHeight::Latest, ibc_union_spec::ChannelPath { - channel_id: packet.source_channel, + channel_id: packet.source_channel_id, }, ) .await? @@ -1655,7 +1655,7 @@ impl PluginServer for Module { packet_data: packet.data.into(), packet: ibc_union_spec::PacketMetadata { source_channel: ibc_union_spec::ChannelMetadata { - channel_id: packet.source_channel, + channel_id: packet.source_channel_id, version: source_channel.version.clone(), connection: ibc_union_spec::ConnectionMetadata { client_id: destination_connection.counterparty_client_id, @@ -1664,7 +1664,7 @@ impl PluginServer for Module { }, }, destination_channel: ibc_union_spec::ChannelMetadata { - channel_id: packet.destination_channel, + channel_id: packet.destination_channel_id, version: destination_channel.version.clone(), connection: ibc_union_spec::ConnectionMetadata { @@ -1699,7 +1699,7 @@ impl PluginServer for Module { self.chain_id.clone(), QueryHeight::Specific(height), ibc_union_spec::ChannelPath { - channel_id: packet.destination_channel, + channel_id: packet.destination_channel_id, }, ) .await? @@ -1738,7 +1738,7 @@ impl PluginServer for Module { client_meta.chain_id.clone(), QueryHeight::Latest, ibc_union_spec::ChannelPath { - channel_id: packet.source_channel, + channel_id: packet.source_channel_id, }, ) .await? @@ -1749,7 +1749,7 @@ impl PluginServer for Module { packet_data: packet.data.into(), packet: ibc_union_spec::PacketMetadata { source_channel: ibc_union_spec::ChannelMetadata { - channel_id: packet.source_channel, + channel_id: packet.source_channel_id, version: source_channel.version.clone(), connection: ibc_union_spec::ConnectionMetadata { client_id: destination_connection.counterparty_client_id, @@ -1758,7 +1758,7 @@ impl PluginServer for Module { }, }, destination_channel: ibc_union_spec::ChannelMetadata { - channel_id: packet.destination_channel, + channel_id: packet.destination_channel_id, version: destination_channel.version.clone(), connection: ibc_union_spec::ConnectionMetadata { diff --git a/voyager/plugins/event-source/ethereum/src/main.rs b/voyager/plugins/event-source/ethereum/src/main.rs index 04c72eb627..e37d824ea8 100644 --- a/voyager/plugins/event-source/ethereum/src/main.rs +++ b/voyager/plugins/event-source/ethereum/src/main.rs @@ -711,7 +711,7 @@ impl PluginServer for Module { ) = self .make_packet_metadata( provable_height, - event.packet.source_channel, + event.packet.source_channel_id, e.try_get()?, ) .await?; @@ -748,7 +748,7 @@ impl PluginServer for Module { ) = self .make_packet_metadata( provable_height, - event.packet.source_channel, + event.packet.source_channel_id, e.try_get()?, ) .await?; @@ -785,7 +785,7 @@ impl PluginServer for Module { ) = self .make_packet_metadata( provable_height, - event.packet.source_channel, + event.packet.source_channel_id, e.try_get()?, ) .await?; @@ -824,7 +824,7 @@ impl PluginServer for Module { ) = self .make_packet_metadata( provable_height, - event.packet.destination_channel, + event.packet.destination_channel_id, e.try_get()?, ) .await?; @@ -862,7 +862,7 @@ impl PluginServer for Module { ) = self .make_packet_metadata( provable_height, - event.packet.destination_channel, + event.packet.destination_channel_id, e.try_get()?, ) .await?; diff --git a/voyager/plugins/transaction-batch/src/main.rs b/voyager/plugins/transaction-batch/src/main.rs index fcf5cae1e0..c12ec009ec 100644 --- a/voyager/plugins/transaction-batch/src/main.rs +++ b/voyager/plugins/transaction-batch/src/main.rs @@ -741,8 +741,8 @@ async fn do_make_msg_union( EventUnion::PacketSend(event) => { let packet = Packet { - source_channel: event.packet.source_channel.channel_id, - destination_channel: event.packet.destination_channel.channel_id, + source_channel_id: event.packet.source_channel.channel_id, + destination_channel_id: event.packet.destination_channel.channel_id, data: event.packet_data.into(), timeout_height: event.packet.timeout_height, timeout_timestamp: event.packet.timeout_timestamp, @@ -785,8 +785,8 @@ async fn do_make_msg_union( EventUnion::WriteAck(event) => { let packet = Packet { - source_channel: event.packet.source_channel.channel_id, - destination_channel: event.packet.destination_channel.channel_id, + source_channel_id: event.packet.source_channel.channel_id, + destination_channel_id: event.packet.destination_channel.channel_id, data: event.packet_data.into(), timeout_height: event.packet.timeout_height, timeout_timestamp: event.packet.timeout_timestamp, diff --git a/voyager/plugins/transaction/aptos/src/main.rs b/voyager/plugins/transaction/aptos/src/main.rs index cd6d15f6f8..e469ffcd8a 100644 --- a/voyager/plugins/transaction/aptos/src/main.rs +++ b/voyager/plugins/transaction/aptos/src/main.rs @@ -436,9 +436,9 @@ async fn process_msgs< .into_iter() .map(|p| { ( - p.source_channel, + p.source_channel_id, ( - p.destination_channel, + p.destination_channel_id, (p.data.to_vec(), (p.timeout_height, p.timeout_timestamp)), ), ) @@ -472,7 +472,7 @@ async fn process_msgs< let (source_channels, destination_channels) = data .packets .into_iter() - .map(|p| (p.source_channel, p.destination_channel)) + .map(|p| (p.source_channel_id, p.destination_channel_id)) .collect::<(Vec, Vec)>(); let port_id = client