github.com/ari-anchor/sei-tendermint@v0.0.0-20230519144642-dc826b7b56bb/proto/tendermint/abci/types.proto (about) 1 syntax = "proto3"; 2 package seitendermint.abci; 3 4 option go_package = "github.com/ari-anchor/sei-tendermint/abci/types"; 5 6 import "tendermint/crypto/proof.proto"; 7 import "tendermint/crypto/keys.proto"; 8 import "tendermint/types/params.proto"; 9 import "tendermint/types/types.proto"; 10 import "google/protobuf/timestamp.proto"; 11 import "gogoproto/gogo.proto"; 12 13 // This file is copied from http://github.com/tendermint/abci 14 // NOTE: When using custom types, mind the warnings. 15 // https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues 16 17 //---------------------------------------- 18 // Request types 19 20 message Request { 21 oneof value { 22 RequestEcho echo = 1; 23 RequestFlush flush = 2; 24 RequestInfo info = 3; 25 RequestInitChain init_chain = 4; 26 RequestQuery query = 5; 27 RequestCheckTx check_tx = 7; 28 RequestCommit commit = 10; 29 RequestListSnapshots list_snapshots = 11; 30 RequestOfferSnapshot offer_snapshot = 12; 31 RequestLoadSnapshotChunk load_snapshot_chunk = 13; 32 RequestApplySnapshotChunk apply_snapshot_chunk = 14; 33 RequestPrepareProposal prepare_proposal = 15; 34 RequestProcessProposal process_proposal = 16; 35 RequestExtendVote extend_vote = 17; 36 RequestVerifyVoteExtension verify_vote_extension = 18; 37 RequestFinalizeBlock finalize_block = 19; 38 RequestBeginBlock begin_block = 20; 39 RequestDeliverTx deliver_tx = 21; 40 RequestEndBlock end_block = 22; 41 RequestLoadLatest load_latest = 23; 42 } 43 reserved 6, 8, 9; // RequestBeginBlock, RequestDeliverTx, RequestEndBlock 44 } 45 46 message RequestEcho { 47 string message = 1; 48 } 49 50 message RequestFlush {} 51 52 message RequestInfo { 53 string version = 1; 54 uint64 block_version = 2; 55 uint64 p2p_version = 3; 56 string abci_version = 4; 57 } 58 59 message RequestInitChain { 60 google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; 61 string chain_id = 2; 62 seitendermint.types.ConsensusParams consensus_params = 3; 63 repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; 64 bytes app_state_bytes = 5; 65 int64 initial_height = 6; 66 } 67 68 message RequestQuery { 69 bytes data = 1; 70 string path = 2; 71 int64 height = 3; 72 bool prove = 4; 73 } 74 75 enum CheckTxType { 76 NEW = 0 [(gogoproto.enumvalue_customname) = "New"]; 77 RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"]; 78 } 79 80 message RequestCheckTx { 81 bytes tx = 1; 82 CheckTxType type = 2; 83 } 84 85 message RequestCommit {} 86 87 // lists available snapshots 88 message RequestListSnapshots {} 89 90 // offers a snapshot to the application 91 message RequestOfferSnapshot { 92 Snapshot snapshot = 1; // snapshot offered by peers 93 bytes app_hash = 2; // light client-verified app hash for snapshot height 94 } 95 96 // loads a snapshot chunk 97 message RequestLoadSnapshotChunk { 98 uint64 height = 1; 99 uint32 format = 2; 100 uint32 chunk = 3; 101 } 102 103 // Applies a snapshot chunk 104 message RequestApplySnapshotChunk { 105 uint32 index = 1; 106 bytes chunk = 2; 107 string sender = 3; 108 } 109 110 message RequestPrepareProposal { 111 // the modified transactions cannot exceed this size. 112 int64 max_tx_bytes = 1; 113 // txs is an array of transactions that will be included in a block, 114 // sent to the app for possible modifications. 115 repeated bytes txs = 2; 116 ExtendedCommitInfo local_last_commit = 3 [(gogoproto.nullable) = false]; 117 repeated Misbehavior byzantine_validators = 4 [(gogoproto.nullable) = false]; 118 int64 height = 5; 119 google.protobuf.Timestamp time = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; 120 bytes next_validators_hash = 7; 121 // address of the public key of the validator proposing the block. 122 bytes proposer_address = 8; 123 bytes app_hash = 9; 124 bytes validators_hash = 10; 125 bytes consensus_hash = 11; 126 bytes data_hash = 12; 127 bytes evidence_hash = 13; 128 bytes last_block_hash = 14; 129 int64 last_block_part_set_total = 15; 130 bytes last_block_part_set_hash = 16; 131 bytes last_commit_hash = 17; 132 bytes last_results_hash = 18; 133 } 134 135 message RequestProcessProposal { 136 repeated bytes txs = 1; 137 CommitInfo proposed_last_commit = 2 [(gogoproto.nullable) = false]; 138 repeated Misbehavior byzantine_validators = 3 [(gogoproto.nullable) = false]; 139 // hash is the merkle root hash of the fields of the proposed block. 140 bytes hash = 4; 141 int64 height = 5; 142 google.protobuf.Timestamp time = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; 143 bytes next_validators_hash = 7; 144 // address of the public key of the original proposer of the block. 145 bytes proposer_address = 8; 146 bytes app_hash = 10; 147 bytes validators_hash = 11; 148 bytes consensus_hash = 12; 149 bytes data_hash = 13; 150 bytes evidence_hash = 14; 151 bytes last_block_hash = 15; 152 int64 last_block_part_set_total = 16; 153 bytes last_block_part_set_hash = 17; 154 bytes last_commit_hash = 18; 155 bytes last_results_hash = 19; 156 } 157 158 // Extends a vote with application-side injection 159 message RequestExtendVote { 160 bytes hash = 1; 161 int64 height = 2; 162 } 163 164 // Verify the vote extension 165 message RequestVerifyVoteExtension { 166 bytes hash = 1; 167 bytes validator_address = 2; 168 int64 height = 3; 169 bytes vote_extension = 4; 170 } 171 172 message RequestFinalizeBlock { 173 repeated bytes txs = 1; 174 CommitInfo decided_last_commit = 2 [(gogoproto.nullable) = false]; 175 repeated Misbehavior byzantine_validators = 3 [(gogoproto.nullable) = false]; 176 // hash is the merkle root hash of the fields of the proposed block. 177 bytes hash = 4; 178 int64 height = 5; 179 google.protobuf.Timestamp time = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; 180 bytes next_validators_hash = 7; 181 // proposer_address is the address of the public key of the original proposer of the block. 182 bytes proposer_address = 8; 183 bytes app_hash = 10; 184 bytes validators_hash = 11; 185 bytes consensus_hash = 12; 186 bytes data_hash = 13; 187 bytes evidence_hash = 14; 188 bytes last_block_hash = 15; 189 int64 last_block_part_set_total = 16; 190 bytes last_block_part_set_hash = 17; 191 bytes last_commit_hash = 18; 192 bytes last_results_hash = 19; 193 } 194 195 message RequestBeginBlock { 196 bytes hash = 1; 197 seitendermint.types.Header header = 2 [(gogoproto.nullable) = false]; 198 LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; 199 repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; 200 } 201 202 message RequestDeliverTx { 203 bytes tx = 1; 204 bool sig_verified = 2; 205 } 206 207 message RequestEndBlock { 208 int64 height = 1; 209 } 210 211 message RequestLoadLatest {} 212 213 //---------------------------------------- 214 // Response types 215 216 message Response { 217 oneof value { 218 ResponseException exception = 1; 219 ResponseEcho echo = 2; 220 ResponseFlush flush = 3; 221 ResponseInfo info = 4; 222 ResponseInitChain init_chain = 5; 223 ResponseQuery query = 6; 224 ResponseCheckTx check_tx = 8; 225 ResponseCommit commit = 11; 226 ResponseListSnapshots list_snapshots = 12; 227 ResponseOfferSnapshot offer_snapshot = 13; 228 ResponseLoadSnapshotChunk load_snapshot_chunk = 14; 229 ResponseApplySnapshotChunk apply_snapshot_chunk = 15; 230 ResponsePrepareProposal prepare_proposal = 16; 231 ResponseProcessProposal process_proposal = 17; 232 ResponseExtendVote extend_vote = 18; 233 ResponseVerifyVoteExtension verify_vote_extension = 19; 234 ResponseFinalizeBlock finalize_block = 20; 235 ResponseBeginBlock begin_block = 21; 236 ResponseDeliverTx deliver_tx = 22; 237 ResponseEndBlock end_block = 23; 238 ResponseLoadLatest load_latest = 24; 239 } 240 reserved 7, 9, 10; // ResponseBeginBlock, ResponseDeliverTx, ResponseEndBlock 241 } 242 243 // nondeterministic 244 message ResponseException { 245 string error = 1; 246 } 247 248 message ResponseEcho { 249 string message = 1; 250 } 251 252 message ResponseFlush {} 253 254 message ResponseInfo { 255 string data = 1; 256 257 // this is the software version of the application. TODO: remove? 258 string version = 2; 259 uint64 app_version = 3; 260 261 int64 last_block_height = 4; 262 bytes last_block_app_hash = 5; 263 } 264 265 message ResponseInitChain { 266 seitendermint.types.ConsensusParams consensus_params = 1; 267 repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; 268 bytes app_hash = 3; 269 } 270 271 message ResponseQuery { 272 uint32 code = 1; 273 // bytes data = 2; // use "value" instead. 274 string log = 3; // nondeterministic 275 string info = 4; // nondeterministic 276 int64 index = 5; 277 bytes key = 6; 278 bytes value = 7; 279 seitendermint.crypto.ProofOps proof_ops = 8; 280 int64 height = 9; 281 string codespace = 10; 282 } 283 284 message ResponseBeginBlock { 285 repeated Event events = 1 286 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; 287 } 288 289 message ResponseCheckTx { 290 uint32 code = 1; 291 bytes data = 2; 292 string log = 3; // nondeterministic 293 int64 gas_wanted = 5; 294 string codespace = 8; 295 string sender = 9; 296 int64 priority = 10; 297 298 reserved 4, 6, 7, 11; // see https://github.com/tendermint/tendermint/issues/8543 299 } 300 301 message ResponseDeliverTx { 302 uint32 code = 1; 303 bytes data = 2; 304 string log = 3; // nondeterministic 305 string info = 4; // nondeterministic 306 int64 gas_wanted = 5 [json_name = "gas_wanted"]; 307 int64 gas_used = 6 [json_name = "gas_used"]; 308 repeated Event events = 7 309 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic 310 string codespace = 8; 311 } 312 313 message ResponseEndBlock { 314 repeated ValidatorUpdate validator_updates = 1 315 [(gogoproto.nullable) = false]; 316 ConsensusParams consensus_param_updates = 2; 317 repeated Event events = 3 318 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; 319 } 320 321 message ResponseCommit { 322 // reserve 1 323 int64 retain_height = 3; 324 } 325 326 message ResponseListSnapshots { 327 repeated Snapshot snapshots = 1; 328 } 329 330 message ResponseOfferSnapshot { 331 Result result = 1; 332 333 enum Result { 334 UNKNOWN = 0; // Unknown result, abort all snapshot restoration 335 ACCEPT = 1; // Snapshot accepted, apply chunks 336 ABORT = 2; // Abort all snapshot restoration 337 REJECT = 3; // Reject this specific snapshot, try others 338 REJECT_FORMAT = 4; // Reject all snapshots of this format, try others 339 REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others 340 } 341 } 342 343 message ResponseLoadSnapshotChunk { 344 bytes chunk = 1; 345 } 346 347 message ResponseApplySnapshotChunk { 348 Result result = 1; 349 repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply 350 repeated string reject_senders = 3; // Chunk senders to reject and ban 351 352 enum Result { 353 UNKNOWN = 0; // Unknown result, abort all snapshot restoration 354 ACCEPT = 1; // Chunk successfully accepted 355 ABORT = 2; // Abort all snapshot restoration 356 RETRY = 3; // Retry chunk (combine with refetch and reject) 357 RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) 358 REJECT_SNAPSHOT = 5; // Reject this snapshot, try others 359 } 360 } 361 362 message ResponsePrepareProposal { 363 repeated TxRecord tx_records = 1; 364 bytes app_hash = 2; 365 repeated ExecTxResult tx_results = 3; 366 repeated ValidatorUpdate validator_updates = 4; 367 seitendermint.types.ConsensusParams consensus_param_updates = 5; 368 } 369 370 message ResponseProcessProposal { 371 ProposalStatus status = 1; 372 bytes app_hash = 2; 373 repeated ExecTxResult tx_results = 3; 374 repeated ValidatorUpdate validator_updates = 4; 375 seitendermint.types.ConsensusParams consensus_param_updates = 5; 376 377 enum ProposalStatus { 378 UNKNOWN = 0; 379 ACCEPT = 1; 380 REJECT = 2; 381 } 382 } 383 384 message ResponseExtendVote { 385 bytes vote_extension = 1; 386 } 387 388 message ResponseVerifyVoteExtension { 389 VerifyStatus status = 1; 390 391 enum VerifyStatus { 392 UNKNOWN = 0; 393 ACCEPT = 1; 394 REJECT = 2; 395 } 396 } 397 398 message ResponseFinalizeBlock { 399 repeated Event events = 1 400 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; 401 repeated ExecTxResult tx_results = 2; 402 repeated ValidatorUpdate validator_updates = 3 [(gogoproto.nullable) = false]; 403 seitendermint.types.ConsensusParams consensus_param_updates = 4; 404 bytes app_hash = 5; 405 } 406 407 message ResponseLoadLatest {} 408 409 //---------------------------------------- 410 // Misc. 411 412 message CommitInfo { 413 int32 round = 1; 414 repeated VoteInfo votes = 2 [(gogoproto.nullable) = false]; 415 } 416 417 message LastCommitInfo { 418 int32 round = 1; 419 repeated VoteInfo votes = 2 [(gogoproto.nullable) = false]; 420 } 421 422 // ExtendedCommitInfo is similar to CommitInfo except that it is only used in 423 // the PrepareProposal request such that Tendermint can provide vote extensions 424 // to the application. 425 message ExtendedCommitInfo { 426 // The round at which the block proposer decided in the previous height. 427 int32 round = 1; 428 // List of validators' addresses in the last validator set with their voting 429 // information, including vote extensions. 430 repeated ExtendedVoteInfo votes = 2 [(gogoproto.nullable) = false]; 431 } 432 433 // Event allows application developers to attach additional information to 434 // ResponseFinalizeBlock, ResponseDeliverTx, ExecTxResult 435 // Later, transactions may be queried using these events. 436 message Event { 437 string type = 1; 438 repeated EventAttribute attributes = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes,omitempty"]; 439 } 440 441 // EventAttribute is a single key-value pair, associated with an event. 442 message EventAttribute { 443 bytes key = 1; 444 bytes value = 2; 445 bool index = 3; // nondeterministic 446 } 447 448 // ExecTxResult contains results of executing one individual transaction. 449 // 450 // * Its structure is equivalent to #ResponseDeliverTx which will be deprecated/deleted 451 message ExecTxResult { 452 uint32 code = 1; 453 bytes data = 2; 454 string log = 3; // nondeterministic 455 string info = 4; // nondeterministic 456 int64 gas_wanted = 5; 457 int64 gas_used = 6; 458 repeated Event events = 7 459 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic 460 string codespace = 8; 461 } 462 463 // TxResult contains results of executing the transaction. 464 // 465 // One usage is indexing transaction results. 466 message TxResult { 467 int64 height = 1; 468 uint32 index = 2; 469 bytes tx = 3; 470 ExecTxResult result = 4 [(gogoproto.nullable) = false]; 471 } 472 473 message TxRecord { 474 TxAction action = 1; 475 bytes tx = 2; 476 477 // TxAction contains App-provided information on what to do with a transaction that is part of a raw proposal 478 enum TxAction { 479 UNKNOWN = 0; // Unknown action 480 UNMODIFIED = 1; // The Application did not modify this transaction. 481 ADDED = 2; // The Application added this transaction. 482 REMOVED = 3; // The Application wants this transaction removed from the proposal and the mempool. 483 } 484 } 485 486 message BlockParams { 487 // Note: must be greater than 0 488 int64 max_bytes = 1; 489 // Note: must be greater or equal to -1 490 int64 max_gas = 2; 491 } 492 493 message ConsensusParams { 494 BlockParams block = 1; 495 seitendermint.types.EvidenceParams evidence = 2; 496 seitendermint.types.ValidatorParams validator = 3; 497 seitendermint.types.VersionParams version = 4; 498 } 499 500 //---------------------------------------- 501 // Blockchain Types 502 503 // Validator 504 message Validator { 505 bytes address = 1; // The first 20 bytes of SHA256(public key) 506 // PubKey pub_key = 2 [(gogoproto.nullable)=false]; 507 int64 power = 3; // The voting power 508 } 509 510 // ValidatorUpdate 511 message ValidatorUpdate { 512 seitendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; 513 int64 power = 2; 514 } 515 516 // VoteInfo 517 message VoteInfo { 518 Validator validator = 1 [(gogoproto.nullable) = false]; 519 bool signed_last_block = 2; 520 } 521 522 // ExtendedVoteInfo 523 message ExtendedVoteInfo { 524 // The validator that sent the vote. 525 Validator validator = 1 [(gogoproto.nullable) = false]; 526 // Indicates whether the validator signed the last block, allowing for rewards based on validator availability. 527 bool signed_last_block = 2; 528 // Non-deterministic extension provided by the sending validator's application. 529 bytes vote_extension = 3; 530 } 531 532 enum MisbehaviorType { 533 UNKNOWN = 0; 534 DUPLICATE_VOTE = 1; 535 LIGHT_CLIENT_ATTACK = 2; 536 } 537 538 message Misbehavior { 539 MisbehaviorType type = 1; 540 // The offending validator 541 Validator validator = 2 [(gogoproto.nullable) = false]; 542 // The height when the offense occurred 543 int64 height = 3; 544 // The corresponding time where the offense occurred 545 google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; 546 // Total voting power of the validator set in case the ABCI application does 547 // not store historical validators. 548 // https://github.com/tendermint/tendermint/issues/4581 549 int64 total_voting_power = 5; 550 } 551 552 message Evidence { 553 MisbehaviorType type = 1; 554 // The offending validator 555 Validator validator = 2 [(gogoproto.nullable) = false]; 556 // The height when the offense occurred 557 int64 height = 3; 558 // The corresponding time where the offense occurred 559 google.protobuf.Timestamp time = 4 [ 560 (gogoproto.nullable) = false, 561 (gogoproto.stdtime) = true 562 ]; 563 // Total voting power of the validator set in case the ABCI application does 564 // not store historical validators. 565 // https://github.com/tendermint/tendermint/issues/4581 566 int64 total_voting_power = 5; 567 } 568 569 //---------------------------------------- 570 // State Sync Types 571 572 message Snapshot { 573 uint64 height = 1; // The height at which the snapshot was taken 574 uint32 format = 2; // The application-specific snapshot format 575 uint32 chunks = 3; // Number of chunks in the snapshot 576 bytes hash = 4; // Arbitrary snapshot hash, equal only if identical 577 bytes metadata = 5; // Arbitrary application metadata 578 } 579 580 //---------------------------------------- 581 // Service Definition 582 583 service ABCIApplication { 584 rpc Echo(RequestEcho) returns (ResponseEcho); 585 rpc Flush(RequestFlush) returns (ResponseFlush); 586 rpc Info(RequestInfo) returns (ResponseInfo); 587 rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); 588 rpc Query(RequestQuery) returns (ResponseQuery); 589 rpc Commit(RequestCommit) returns (ResponseCommit); 590 rpc InitChain(RequestInitChain) returns (ResponseInitChain); 591 rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots); 592 rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot); 593 rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) returns (ResponseLoadSnapshotChunk); 594 rpc ApplySnapshotChunk(RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk); 595 rpc PrepareProposal(RequestPrepareProposal) returns (ResponsePrepareProposal); 596 rpc ProcessProposal(RequestProcessProposal) returns (ResponseProcessProposal); 597 rpc ExtendVote(RequestExtendVote) returns (ResponseExtendVote); 598 rpc VerifyVoteExtension(RequestVerifyVoteExtension) returns (ResponseVerifyVoteExtension); 599 rpc FinalizeBlock(RequestFinalizeBlock) returns (ResponseFinalizeBlock); 600 rpc LoadLatest(RequestLoadLatest) returns (ResponseLoadLatest); 601 }