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