Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relayer CLIs for channel close messages #94

Closed
3 of 9 tasks
ancazamfir opened this issue Jan 19, 2021 · 0 comments
Closed
3 of 9 tasks

Relayer CLIs for channel close messages #94

ancazamfir opened this issue Jan 19, 2021 · 0 comments
Assignees

Comments

@ancazamfir
Copy link
Collaborator

Crate

ibc, relayer, relayer-cli

Summary

MsgChannelCloseInit and MsgChannelCloseConfirm raw messages are defined here:

/// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A
/// to close a channel with Chain B.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgChannelCloseInit {
#[prost(string, tag="1")]
pub port_id: std::string::String,
#[prost(string, tag="2")]
pub channel_id: std::string::String,
#[prost(string, tag="3")]
pub signer: std::string::String,
}
/// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgChannelCloseInitResponse {
}
/// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B
/// to acknowledge the change of channel state to CLOSED on Chain A.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgChannelCloseConfirm {
#[prost(string, tag="1")]
pub port_id: std::string::String,
#[prost(string, tag="2")]
pub channel_id: std::string::String,
#[prost(bytes, tag="3")]
pub proof_init: std::vec::Vec<u8>,
#[prost(message, optional, tag="4")]
pub proof_height: ::std::option::Option<super::super::client::v1::Height>,
#[prost(string, tag="5")]
pub signer: std::string::String,
}
/// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgChannelCloseConfirmResponse {
}
/// MsgRecvPacket receives incoming IBC packet
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgRecvPacket {
#[prost(message, optional, tag="1")]
pub packet: ::std::option::Option<Packet>,
#[prost(bytes, tag="2")]
pub proof_commitment: std::vec::Vec<u8>,
#[prost(message, optional, tag="3")]
pub proof_height: ::std::option::Option<super::super::client::v1::Height>,
#[prost(string, tag="4")]
pub signer: std::string::String,
}
/// MsgRecvPacketResponse defines the Msg/RecvPacket response type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgRecvPacketResponse {
}
/// MsgTimeout receives timed-out packet
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgTimeout {
#[prost(message, optional, tag="1")]
pub packet: ::std::option::Option<Packet>,
#[prost(bytes, tag="2")]
pub proof_unreceived: std::vec::Vec<u8>,
#[prost(message, optional, tag="3")]
pub proof_height: ::std::option::Option<super::super::client::v1::Height>,
#[prost(uint64, tag="4")]
pub next_sequence_recv: u64,
#[prost(string, tag="5")]
pub signer: std::string::String,
}
/// MsgTimeoutResponse defines the Msg/Timeout response type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgTimeoutResponse {
}
/// MsgTimeoutOnClose timed-out packet upon counterparty channel closure.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgTimeoutOnClose {
#[prost(message, optional, tag="1")]
pub packet: ::std::option::Option<Packet>,
#[prost(bytes, tag="2")]
pub proof_unreceived: std::vec::Vec<u8>,
#[prost(bytes, tag="3")]
pub proof_close: std::vec::Vec<u8>,
#[prost(message, optional, tag="4")]
pub proof_height: ::std::option::Option<super::super::client::v1::Height>,
#[prost(uint64, tag="5")]
pub next_sequence_recv: u64,
#[prost(string, tag="6")]
pub signer: std::string::String,
}
/// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgTimeoutOnCloseResponse {
}
/// MsgAcknowledgement receives incoming IBC acknowledgement
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgAcknowledgement {
#[prost(message, optional, tag="1")]
pub packet: ::std::option::Option<Packet>,
#[prost(bytes, tag="2")]
pub acknowledgement: std::vec::Vec<u8>,
#[prost(bytes, tag="3")]
pub proof_acked: std::vec::Vec<u8>,
#[prost(message, optional, tag="4")]
pub proof_height: ::std::option::Option<super::super::client::v1::Height>,
#[prost(string, tag="5")]
pub signer: std::string::String,
}
/// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgAcknowledgementResponse {
}
# [doc = r" Generated client implementations."] pub mod msg_client { # ! [allow (unused_variables , dead_code , missing_docs)] use tonic :: codegen :: * ; # [doc = " Msg defines the ibc/channel Msg service."] pub struct MsgClient < T > { inner : tonic :: client :: Grpc < T > , } impl MsgClient < tonic :: transport :: Channel > { # [doc = r" Attempt to create a new client by connecting to a given endpoint."] pub async fn connect < D > (dst : D) -> Result < Self , tonic :: transport :: Error > where D : std :: convert :: TryInto < tonic :: transport :: Endpoint > , D :: Error : Into < StdError > , { let conn = tonic :: transport :: Endpoint :: new (dst) ? . connect () . await ? ; Ok (Self :: new (conn)) } } impl < T > MsgClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + HttpBody + Send + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as HttpBody > :: Error : Into < StdError > + Send , { pub fn new (inner : T) -> Self { let inner = tonic :: client :: Grpc :: new (inner) ; Self { inner } } pub fn with_interceptor (inner : T , interceptor : impl Into < tonic :: Interceptor >) -> Self { let inner = tonic :: client :: Grpc :: with_interceptor (inner , interceptor) ; Self { inner } } # [doc = " ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit."] pub async fn channel_open_init (& mut self , request : impl tonic :: IntoRequest < super :: MsgChannelOpenInit > ,) -> Result < tonic :: Response < super :: MsgChannelOpenInitResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/ibc.core.channel.v1.Msg/ChannelOpenInit") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry."] pub async fn channel_open_try (& mut self , request : impl tonic :: IntoRequest < super :: MsgChannelOpenTry > ,) -> Result < tonic :: Response < super :: MsgChannelOpenTryResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/ibc.core.channel.v1.Msg/ChannelOpenTry") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck."] pub async fn channel_open_ack (& mut self , request : impl tonic :: IntoRequest < super :: MsgChannelOpenAck > ,) -> Result < tonic :: Response < super :: MsgChannelOpenAckResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/ibc.core.channel.v1.Msg/ChannelOpenAck") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm."] pub async fn channel_open_confirm (& mut self , request : impl tonic :: IntoRequest < super :: MsgChannelOpenConfirm > ,) -> Result < tonic :: Response < super :: MsgChannelOpenConfirmResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/ibc.core.channel.v1.Msg/ChannelOpenConfirm") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit."] pub async fn channel_close_init (& mut self , request : impl tonic :: IntoRequest < super :: MsgChannelCloseInit > ,) -> Result < tonic :: Response < super :: MsgChannelCloseInitResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/ibc.core.channel.v1.Msg/ChannelCloseInit") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm."] pub async fn channel_close_confirm (& mut self , request : impl tonic :: IntoRequest < super :: MsgChannelCloseConfirm > ,) -> Result < tonic :: Response < super :: MsgChannelCloseConfirmResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/ibc.core.channel.v1.Msg/ChannelCloseConfirm") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " RecvPacket defines a rpc handler method for MsgRecvPacket."] pub async fn recv_packet (& mut self , request : impl tonic :: IntoRequest < super :: MsgRecvPacket > ,) -> Result < tonic :: Response < super :: MsgRecvPacketResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/ibc.core.channel.v1.Msg/RecvPacket") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Timeout defines a rpc handler method for MsgTimeout."] pub async fn timeout (& mut self , request : impl tonic :: IntoRequest < super :: MsgTimeout > ,) -> Result < tonic :: Response < super :: MsgTimeoutResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/ibc.core.channel.v1.Msg/Timeout") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose."] pub async fn timeout_on_close (& mut self , request : impl tonic :: IntoRequest < super :: MsgTimeoutOnClose > ,) -> Result < tonic :: Response < super :: MsgTimeoutOnCloseResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/ibc.core.channel.v1.Msg/TimeoutOnClose") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Acknowledgement defines a rpc handler method for MsgAcknowledgement."] pub async fn acknowledgement (& mut self , request : impl tonic :: IntoRequest < super :: MsgAcknowledgement > ,) -> Result < tonic :: Response < super :: MsgAcknowledgementResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/ibc.core.channel.v1.Msg/Acknowledgement") ; self . inner . unary (request . into_request () , path , codec) . await } } impl < T : Clone > Clone for MsgClient < T > { fn clone (& self) -> Self { Self { inner : self . inner . clone () , } } } impl < T > std :: fmt :: Debug for MsgClient < T > { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { write ! (f , "MsgClient {{ ... }}") } } }/// QueryChannelRequest is the request type for the Query/Channel RPC method
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryChannelRequest {
/// port unique identifier
#[prost(string, tag="1")]

Required:

  • domain type message definition + implementation
  • relayer CLI to trigger the channel close
  • relayer CLI to query for channel close and finish the close handshake
  • update in the relayer v-0 CLI loop to register for close events and exit

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@ancazamfir ancazamfir self-assigned this Jan 26, 2021
@hu55a1n1 hu55a1n1 transferred this issue from informalsystems/hermes Sep 29, 2022
shuoer86 pushed a commit to shuoer86/ibc-rs that referenced this issue Nov 4, 2023
…rost-0.11

Rust: Bump `prost` to version 0.11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant