cosmos-sdk/proto/ibc/channel/channel.proto

245 lines
10 KiB
Protocol Buffer

syntax = "proto3";
package ibc.channel;
option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types";
import "gogoproto/gogo.proto";
// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It
// is called by a relayer on Chain A.
message MsgChannelOpenInit {
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
Channel channel = 3 [(gogoproto.nullable) = false];
bytes signer = 4
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel
// on Chain B.
message MsgChannelOpenTry {
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
Channel channel = 3 [(gogoproto.nullable) = false];
string counterparty_version = 4
[(gogoproto.moretags) = "yaml:\"counterparty_version\""];
bytes proof_init = 5 [(gogoproto.moretags) = "yaml:\"proof_init\""];
uint64 proof_height = 6 [(gogoproto.moretags) = "yaml:\"proof_height\""];
bytes signer = 7
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge
// the change of channel state to TRYOPEN on Chain B.
message MsgChannelOpenAck {
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
string counterparty_version = 3
[(gogoproto.moretags) = "yaml:\"counterparty_version\""];
bytes proof_try = 4 [(gogoproto.moretags) = "yaml:\"proof_try\""];
uint64 proof_height = 5 [(gogoproto.moretags) = "yaml:\"proof_height\""];
bytes signer = 6
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to
// acknowledge the change of channel state to OPEN on Chain A.
message MsgChannelOpenConfirm {
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
bytes proof_ack = 3 [(gogoproto.moretags) = "yaml:\"proof_ack\""];
uint64 proof_height = 4 [(gogoproto.moretags) = "yaml:\"proof_height\""];
bytes signer = 5
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain A
// to close a channel with Chain B.
message MsgChannelCloseInit {
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
bytes signer = 3
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B
// to acknowledge the change of channel state to CLOSED on Chain A.
message MsgChannelCloseConfirm {
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
bytes proof_init = 3 [(gogoproto.moretags) = "yaml:\"proof_init\""];
uint64 proof_height = 4 [(gogoproto.moretags) = "yaml:\"proof_height\""];
bytes signer = 5
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
// MsgRecvPacket receives incoming IBC packet
message MsgRecvPacket {
Packet packet = 1 [(gogoproto.nullable) = false];
bytes proof = 2;
uint64 proof_height = 3 [(gogoproto.moretags) = "yaml:\"proof_height\""];
bytes signer = 4
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
// MsgTimeout receives timed-out packet
message MsgTimeout {
Packet packet = 1 [(gogoproto.nullable) = false];
bytes proof = 2;
uint64 proof_height = 3 [(gogoproto.moretags) = "yaml:\"proof_height\""];
uint64 next_sequence_recv = 4
[(gogoproto.moretags) = "yaml:\"next_sequence_recv\""];
bytes signer = 5
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
// MsgTimeoutOnClose timed-out packet upon counterparty channel closure.
message MsgTimeoutOnClose {
Packet packet = 1 [(gogoproto.nullable) = false];
bytes proof = 2;
bytes proof_close = 3 [(gogoproto.moretags) = "yaml:\"proof_close\""];
uint64 proof_height = 4 [(gogoproto.moretags) = "yaml:\"proof_height\""];
uint64 next_sequence_recv = 5
[(gogoproto.moretags) = "yaml:\"next_sequence_recv\""];
bytes signer = 6
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
// MsgAcknowledgement receives incoming IBC acknowledgement
message MsgAcknowledgement {
Packet packet = 1 [(gogoproto.nullable) = false];
bytes acknowledgement = 2;
bytes proof = 3;
uint64 proof_height = 4 [(gogoproto.moretags) = "yaml:\"proof_height\""];
bytes signer = 5
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
// Channel defines pipeline for exactly-once packet delivery between specific
// modules on separate blockchains, which has at least one end capable of
// sending packets and one end capable of receiving packets.
message Channel {
option (gogoproto.goproto_getters) = false;
// current state of the channel end
State state = 1;
// whether the channel is ordered or unordered
Order ordering = 2;
// counterparty channel end
Counterparty counterparty = 3 [(gogoproto.nullable) = false];
// list of connection identifiers, in order, along which packets sent on this
// channel will travel
repeated string connection_hops = 4
[(gogoproto.moretags) = "yaml:\"connection_hops\""];
// opaque channel version, which is agreed upon during the handshake
string version = 5;
}
// IdentifiedChannel defines a channel with additional port and channel
// identifier fields.
message IdentifiedChannel {
option (gogoproto.goproto_getters) = false;
// current state of the channel end
State state = 1;
// whether the channel is ordered or unordered
Order ordering = 2;
// counterparty channel end
Counterparty counterparty = 3 [(gogoproto.nullable) = false];
// list of connection identifiers, in order, along which packets sent on this
// channel will travel
repeated string connection_hops = 4
[(gogoproto.moretags) = "yaml:\"connection_hops\""];
// opaque channel version, which is agreed upon during the handshake
string version = 5;
// port identifier
string port_id = 6;
// channel identifier
string channel_id = 7;
}
// State defines if a channel is in one of the following states:
// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED.
enum State {
option (gogoproto.goproto_enum_prefix) = false;
// Default State
STATE_UNINITIALIZED_UNSPECIFIED = 0
[(gogoproto.enumvalue_customname) = "UNINITIALIZED"];
// A channel has just started the opening handshake.
STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"];
// A channel has acknowledged the handshake step on the counterparty chain.
STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"];
// A channel has completed the handshake. Open channels are
// ready to send and receive packets.
STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"];
// A channel has been closed and can no longer be used to send or receive
// packets.
STATE_CLOSED = 4 [(gogoproto.enumvalue_customname) = "CLOSED"];
}
// Order defines if a channel is ORDERED or UNORDERED
enum Order {
option (gogoproto.goproto_enum_prefix) = false;
// zero-value for channel ordering
ORDER_NONE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "NONE"];
// packets can be delivered in any order, which may differ from the order in
// which they were sent.
ORDER_UNORDERED = 1 [(gogoproto.enumvalue_customname) = "UNORDERED"];
// packets are delivered exactly in the order which they were sent
ORDER_ORDERED = 2 [(gogoproto.enumvalue_customname) = "ORDERED"];
}
// Counterparty defines a channel end counterparty
message Counterparty {
option (gogoproto.goproto_getters) = false;
// port on the counterparty chain which owns the other end of the channel.
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
// channel end on the counterparty chain
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
}
// Packet defines a type that carries data across different chains through IBC
message Packet {
option (gogoproto.goproto_getters) = false;
// number corresponds to the order of sends and receives, where a Packet with
// an earlier sequence number must be sent and received before a Packet with a
// later sequence number.
uint64 sequence = 1;
// identifies the port on the sending chain.
string source_port = 2 [(gogoproto.moretags) = "yaml:\"source_port\""];
// identifies the channel end on the sending chain.
string source_channel = 3 [(gogoproto.moretags) = "yaml:\"source_channel\""];
// identifies the port on the receiving chain.
string destination_port = 4
[(gogoproto.moretags) = "yaml:\"destination_port\""];
// identifies the channel end on the receiving chain.
string destination_channel = 5
[(gogoproto.moretags) = "yaml:\"destination_channel\""];
// actual opaque bytes transferred directly to the application module
bytes data = 6;
// block height after which the packet times out
uint64 timeout_height = 7 [(gogoproto.moretags) = "yaml:\"timeout_height\""];
// block timestamp (in nanoseconds) after which the packet times out
uint64 timeout_timestamp = 8
[(gogoproto.moretags) = "yaml:\"timeout_timestamp\""];
}
// PacketAckCommitment defines the genesis type necessary to retrieve and store
// acknowlegements.
message PacketAckCommitment {
option (gogoproto.goproto_getters) = false;
// channel port identifier.
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
// channel unique identifier.
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
// packet sequence.
uint64 sequence = 3;
// packet commitment hash.
bytes hash = 4;
}