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