github.com/okex/exchain@v1.8.0/libs/ibc-go/proto/ibc/core/channel/v1/channel.proto (about) 1 syntax = "proto3"; 2 3 package ibc.core.channel.v1; 4 5 option go_package = "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types"; 6 7 import "gogoproto/gogo.proto"; 8 import "ibc/core/client/v1/client.proto"; 9 10 // Channel defines pipeline for exactly-once packet delivery between specific 11 // modules on separate blockchains, which has at least one end capable of 12 // sending packets and one end capable of receiving packets. 13 message Channel { 14 option (gogoproto.goproto_getters) = false; 15 16 // current state of the channel end 17 State state = 1; 18 // whether the channel is ordered or unordered 19 Order ordering = 2; 20 // counterparty channel end 21 Counterparty counterparty = 3 [(gogoproto.nullable) = false]; 22 // list of connection identifiers, in order, along which packets sent on 23 // this channel will travel 24 repeated string connection_hops = 4 [(gogoproto.moretags) = "yaml:\"connection_hops\""]; 25 // opaque channel version, which is agreed upon during the handshake 26 string version = 5; 27 } 28 29 // IdentifiedChannel defines a channel with additional port and channel 30 // identifier fields. 31 message IdentifiedChannel { 32 option (gogoproto.goproto_getters) = false; 33 34 // current state of the channel end 35 State state = 1; 36 // whether the channel is ordered or unordered 37 Order ordering = 2; 38 // counterparty channel end 39 Counterparty counterparty = 3 [(gogoproto.nullable) = false]; 40 // list of connection identifiers, in order, along which packets sent on 41 // this channel will travel 42 repeated string connection_hops = 4 [(gogoproto.moretags) = "yaml:\"connection_hops\""]; 43 // opaque channel version, which is agreed upon during the handshake 44 string version = 5; 45 // port identifier 46 string port_id = 6; 47 // channel identifier 48 string channel_id = 7; 49 } 50 51 // State defines if a channel is in one of the following states: 52 // CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. 53 enum State { 54 option (gogoproto.goproto_enum_prefix) = false; 55 56 // Default State 57 STATE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNINITIALIZED"]; 58 // A channel has just started the opening handshake. 59 STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"]; 60 // A channel has acknowledged the handshake step on the counterparty chain. 61 STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"]; 62 // A channel has completed the handshake. Open channels are 63 // ready to send and receive packets. 64 STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"]; 65 // A channel has been closed and can no longer be used to send or receive 66 // packets. 67 STATE_CLOSED = 4 [(gogoproto.enumvalue_customname) = "CLOSED"]; 68 } 69 70 // Order defines if a channel is ORDERED or UNORDERED 71 enum Order { 72 option (gogoproto.goproto_enum_prefix) = false; 73 74 // zero-value for channel ordering 75 ORDER_NONE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "NONE"]; 76 // packets can be delivered in any order, which may differ from the order in 77 // which they were sent. 78 ORDER_UNORDERED = 1 [(gogoproto.enumvalue_customname) = "UNORDERED"]; 79 // packets are delivered exactly in the order which they were sent 80 ORDER_ORDERED = 2 [(gogoproto.enumvalue_customname) = "ORDERED"]; 81 } 82 83 // Counterparty defines a channel end counterparty 84 message Counterparty { 85 option (gogoproto.goproto_getters) = false; 86 87 // port on the counterparty chain which owns the other end of the channel. 88 string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; 89 // channel end on the counterparty chain 90 string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; 91 } 92 93 // Packet defines a type that carries data across different chains through IBC 94 message Packet { 95 option (gogoproto.goproto_getters) = false; 96 97 // number corresponds to the order of sends and receives, where a Packet 98 // with an earlier sequence number must be sent and received before a Packet 99 // with a later sequence number. 100 uint64 sequence = 1; 101 // identifies the port on the sending chain. 102 string source_port = 2 [(gogoproto.moretags) = "yaml:\"source_port\""]; 103 // identifies the channel end on the sending chain. 104 string source_channel = 3 [(gogoproto.moretags) = "yaml:\"source_channel\""]; 105 // identifies the port on the receiving chain. 106 string destination_port = 4 [(gogoproto.moretags) = "yaml:\"destination_port\""]; 107 // identifies the channel end on the receiving chain. 108 string destination_channel = 5 [(gogoproto.moretags) = "yaml:\"destination_channel\""]; 109 // actual opaque bytes transferred directly to the application module 110 bytes data = 6; 111 // block height after which the packet times out 112 ibc.core.client.v1.Height timeout_height = 7 113 [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; 114 // block timestamp (in nanoseconds) after which the packet times out 115 uint64 timeout_timestamp = 8 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; 116 } 117 118 // PacketState defines the generic type necessary to retrieve and store 119 // packet commitments, acknowledgements, and receipts. 120 // Caller is responsible for knowing the context necessary to interpret this 121 // state as a commitment, acknowledgement, or a receipt. 122 message PacketState { 123 option (gogoproto.goproto_getters) = false; 124 125 // channel port identifier. 126 string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; 127 // channel unique identifier. 128 string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; 129 // packet sequence. 130 uint64 sequence = 3; 131 // embedded data that represents packet state. 132 bytes data = 4; 133 } 134 135 // Acknowledgement is the recommended acknowledgement format to be used by 136 // app-specific protocols. 137 // NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental 138 // conflicts with other protobuf message formats used for acknowledgements. 139 // The first byte of any message with this format will be the non-ASCII values 140 // `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: 141 // https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope 142 message Acknowledgement { 143 // response contains either a result or an error and must be non-empty 144 oneof response { 145 bytes result = 21; 146 string error = 22; 147 } 148 }