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