github.com/number571/tendermint@v0.34.11-gost/proto/tendermint/abci/types.proto (about) 1 syntax = "proto3"; 2 package tendermint.abci; 3 4 option go_package = "github.com/number571/tendermint/abci/types"; 5 6 // For more information on gogo.proto, see: 7 // https://github.com/gogo/protobuf/blob/master/extensions.md 8 import "tendermint/crypto/proof.proto"; 9 import "tendermint/types/types.proto"; 10 import "tendermint/crypto/keys.proto"; 11 import "tendermint/types/params.proto"; 12 import "google/protobuf/timestamp.proto"; 13 import "gogoproto/gogo.proto"; 14 15 // This file is copied from http://github.com/tendermint/abci 16 // NOTE: When using custom types, mind the warnings. 17 // https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues 18 19 //---------------------------------------- 20 // Request types 21 22 message Request { 23 oneof value { 24 RequestEcho echo = 1; 25 RequestFlush flush = 2; 26 RequestInfo info = 3; 27 RequestInitChain init_chain = 4; 28 RequestQuery query = 5; 29 RequestBeginBlock begin_block = 6; 30 RequestCheckTx check_tx = 7; 31 RequestDeliverTx deliver_tx = 8; 32 RequestEndBlock end_block = 9; 33 RequestCommit commit = 10; 34 RequestListSnapshots list_snapshots = 11; 35 RequestOfferSnapshot offer_snapshot = 12; 36 RequestLoadSnapshotChunk load_snapshot_chunk = 13; 37 RequestApplySnapshotChunk apply_snapshot_chunk = 14; 38 } 39 } 40 41 message RequestEcho { 42 string message = 1; 43 } 44 45 message RequestFlush {} 46 47 message RequestInfo { 48 string version = 1; 49 uint64 block_version = 2; 50 uint64 p2p_version = 3; 51 string abci_version = 4; 52 } 53 54 message RequestInitChain { 55 google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; 56 string chain_id = 2; 57 tendermint.types.ConsensusParams consensus_params = 3; 58 repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; 59 bytes app_state_bytes = 5; 60 int64 initial_height = 6; 61 } 62 63 message RequestQuery { 64 bytes data = 1; 65 string path = 2; 66 int64 height = 3; 67 bool prove = 4; 68 } 69 70 message RequestBeginBlock { 71 bytes hash = 1; 72 tendermint.types.Header header = 2 [(gogoproto.nullable) = false]; 73 LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; 74 repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; 75 } 76 77 enum CheckTxType { 78 NEW = 0 [(gogoproto.enumvalue_customname) = "New"]; 79 RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"]; 80 } 81 82 message RequestCheckTx { 83 bytes tx = 1; 84 CheckTxType type = 2; 85 } 86 87 message RequestDeliverTx { 88 bytes tx = 1; 89 } 90 91 message RequestEndBlock { 92 int64 height = 1; 93 } 94 95 message RequestCommit {} 96 97 // lists available snapshots 98 message RequestListSnapshots {} 99 100 // offers a snapshot to the application 101 message RequestOfferSnapshot { 102 Snapshot snapshot = 1; // snapshot offered by peers 103 bytes app_hash = 2; // light client-verified app hash for snapshot height 104 } 105 106 // loads a snapshot chunk 107 message RequestLoadSnapshotChunk { 108 uint64 height = 1; 109 uint32 format = 2; 110 uint32 chunk = 3; 111 } 112 113 // Applies a snapshot chunk 114 message RequestApplySnapshotChunk { 115 uint32 index = 1; 116 bytes chunk = 2; 117 string sender = 3; 118 } 119 120 //---------------------------------------- 121 // Response types 122 123 message Response { 124 oneof value { 125 ResponseException exception = 1; 126 ResponseEcho echo = 2; 127 ResponseFlush flush = 3; 128 ResponseInfo info = 4; 129 ResponseInitChain init_chain = 5; 130 ResponseQuery query = 6; 131 ResponseBeginBlock begin_block = 7; 132 ResponseCheckTx check_tx = 8; 133 ResponseDeliverTx deliver_tx = 9; 134 ResponseEndBlock end_block = 10; 135 ResponseCommit commit = 11; 136 ResponseListSnapshots list_snapshots = 12; 137 ResponseOfferSnapshot offer_snapshot = 13; 138 ResponseLoadSnapshotChunk load_snapshot_chunk = 14; 139 ResponseApplySnapshotChunk apply_snapshot_chunk = 15; 140 } 141 } 142 143 // nondeterministic 144 message ResponseException { 145 string error = 1; 146 } 147 148 message ResponseEcho { 149 string message = 1; 150 } 151 152 message ResponseFlush {} 153 154 message ResponseInfo { 155 string data = 1; 156 157 // this is the software version of the application. TODO: remove? 158 string version = 2; 159 uint64 app_version = 3; 160 161 int64 last_block_height = 4; 162 bytes last_block_app_hash = 5; 163 } 164 165 message ResponseInitChain { 166 tendermint.types.ConsensusParams consensus_params = 1; 167 repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; 168 bytes app_hash = 3; 169 } 170 171 message ResponseQuery { 172 uint32 code = 1; 173 // bytes data = 2; // use "value" instead. 174 string log = 3; // nondeterministic 175 string info = 4; // nondeterministic 176 int64 index = 5; 177 bytes key = 6; 178 bytes value = 7; 179 tendermint.crypto.ProofOps proof_ops = 8; 180 int64 height = 9; 181 string codespace = 10; 182 } 183 184 message ResponseBeginBlock { 185 repeated Event events = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; 186 } 187 188 message ResponseCheckTx { 189 uint32 code = 1; 190 bytes data = 2; 191 string log = 3; // nondeterministic 192 string info = 4; // nondeterministic 193 int64 gas_wanted = 5 [json_name = "gas_wanted"]; 194 int64 gas_used = 6 [json_name = "gas_used"]; 195 repeated Event events = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; 196 string codespace = 8; 197 string sender = 9; 198 int64 priority = 10; 199 string mempool_error = 11; 200 } 201 202 message ResponseDeliverTx { 203 uint32 code = 1; 204 bytes data = 2; 205 string log = 3; // nondeterministic 206 string info = 4; // nondeterministic 207 int64 gas_wanted = 5 [json_name = "gas_wanted"]; 208 int64 gas_used = 6 [json_name = "gas_used"]; 209 repeated Event events = 7 210 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic 211 string codespace = 8; 212 } 213 214 message ResponseEndBlock { 215 repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable) = false]; 216 tendermint.types.ConsensusParams consensus_param_updates = 2; 217 repeated Event events = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; 218 } 219 220 message ResponseCommit { 221 // reserve 1 222 bytes data = 2; 223 int64 retain_height = 3; 224 } 225 226 message ResponseListSnapshots { 227 repeated Snapshot snapshots = 1; 228 } 229 230 message ResponseOfferSnapshot { 231 Result result = 1; 232 233 enum Result { 234 UNKNOWN = 0; // Unknown result, abort all snapshot restoration 235 ACCEPT = 1; // Snapshot accepted, apply chunks 236 ABORT = 2; // Abort all snapshot restoration 237 REJECT = 3; // Reject this specific snapshot, try others 238 REJECT_FORMAT = 4; // Reject all snapshots of this format, try others 239 REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others 240 } 241 } 242 243 message ResponseLoadSnapshotChunk { 244 bytes chunk = 1; 245 } 246 247 message ResponseApplySnapshotChunk { 248 Result result = 1; 249 repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply 250 repeated string reject_senders = 3; // Chunk senders to reject and ban 251 252 enum Result { 253 UNKNOWN = 0; // Unknown result, abort all snapshot restoration 254 ACCEPT = 1; // Chunk successfully accepted 255 ABORT = 2; // Abort all snapshot restoration 256 RETRY = 3; // Retry chunk (combine with refetch and reject) 257 RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) 258 REJECT_SNAPSHOT = 5; // Reject this snapshot, try others 259 } 260 } 261 262 //---------------------------------------- 263 // Misc. 264 265 message LastCommitInfo { 266 int32 round = 1; 267 repeated VoteInfo votes = 2 [(gogoproto.nullable) = false]; 268 } 269 270 // Event allows application developers to attach additional information to 271 // ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. 272 // Later, transactions may be queried using these events. 273 message Event { 274 string type = 1; 275 repeated EventAttribute attributes = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes,omitempty"]; 276 } 277 278 // EventAttribute is a single key-value pair, associated with an event. 279 message EventAttribute { 280 string key = 1; 281 string value = 2; 282 bool index = 3; // nondeterministic 283 } 284 285 // TxResult contains results of executing the transaction. 286 // 287 // One usage is indexing transaction results. 288 message TxResult { 289 int64 height = 1; 290 uint32 index = 2; 291 bytes tx = 3; 292 ResponseDeliverTx result = 4 [(gogoproto.nullable) = false]; 293 } 294 295 //---------------------------------------- 296 // Blockchain Types 297 298 // Validator 299 message Validator { 300 bytes address = 1; // The first 20 bytes of SHA256(public key) 301 // PubKey pub_key = 2 [(gogoproto.nullable)=false]; 302 int64 power = 3; // The voting power 303 } 304 305 // ValidatorUpdate 306 message ValidatorUpdate { 307 tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; 308 int64 power = 2; 309 } 310 311 // VoteInfo 312 message VoteInfo { 313 Validator validator = 1 [(gogoproto.nullable) = false]; 314 bool signed_last_block = 2; 315 } 316 317 enum EvidenceType { 318 UNKNOWN = 0; 319 DUPLICATE_VOTE = 1; 320 LIGHT_CLIENT_ATTACK = 2; 321 } 322 323 message Evidence { 324 EvidenceType type = 1; 325 // The offending validator 326 Validator validator = 2 [(gogoproto.nullable) = false]; 327 // The height when the offense occurred 328 int64 height = 3; 329 // The corresponding time where the offense occurred 330 google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; 331 // Total voting power of the validator set in case the ABCI application does 332 // not store historical validators. 333 // https://github.com/number571/tendermint/issues/4581 334 int64 total_voting_power = 5; 335 } 336 337 //---------------------------------------- 338 // State Sync Types 339 340 message Snapshot { 341 uint64 height = 1; // The height at which the snapshot was taken 342 uint32 format = 2; // The application-specific snapshot format 343 uint32 chunks = 3; // Number of chunks in the snapshot 344 bytes hash = 4; // Arbitrary snapshot hash, equal only if identical 345 bytes metadata = 5; // Arbitrary application metadata 346 } 347 348 //---------------------------------------- 349 // Service Definition 350 351 service ABCIApplication { 352 rpc Echo(RequestEcho) returns (ResponseEcho); 353 rpc Flush(RequestFlush) returns (ResponseFlush); 354 rpc Info(RequestInfo) returns (ResponseInfo); 355 rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx); 356 rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); 357 rpc Query(RequestQuery) returns (ResponseQuery); 358 rpc Commit(RequestCommit) returns (ResponseCommit); 359 rpc InitChain(RequestInitChain) returns (ResponseInitChain); 360 rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock); 361 rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock); 362 rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots); 363 rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot); 364 rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) returns (ResponseLoadSnapshotChunk); 365 rpc ApplySnapshotChunk(RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk); 366 }