github.com/cosmos/cosmos-sdk@v0.50.10/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/crypto/keys.proto";
    10  import "tendermint/types/params.proto";
    11  import "tendermint/types/validator.proto";
    12  import "google/protobuf/timestamp.proto";
    13  import "gogoproto/gogo.proto";
    14  
    15  // NOTE: When using custom types, mind the warnings.
    16  // https://github.com/cosmos/gogoproto/blob/master/custom_types.md#warnings-and-issues
    17  
    18  service ABCI {
    19    rpc Echo(RequestEcho) returns (ResponseEcho);
    20    rpc Flush(RequestFlush) returns (ResponseFlush);
    21    rpc Info(RequestInfo) returns (ResponseInfo);
    22    rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
    23    rpc Query(RequestQuery) returns (ResponseQuery);
    24    rpc Commit(RequestCommit) returns (ResponseCommit);
    25    rpc InitChain(RequestInitChain) returns (ResponseInitChain);
    26    rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots);
    27    rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot);
    28    rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) returns (ResponseLoadSnapshotChunk);
    29    rpc ApplySnapshotChunk(RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk);
    30    rpc PrepareProposal(RequestPrepareProposal) returns (ResponsePrepareProposal);
    31    rpc ProcessProposal(RequestProcessProposal) returns (ResponseProcessProposal);
    32    rpc ExtendVote(RequestExtendVote) returns (ResponseExtendVote);
    33    rpc VerifyVoteExtension(RequestVerifyVoteExtension) returns (ResponseVerifyVoteExtension);
    34    rpc FinalizeBlock(RequestFinalizeBlock) returns (ResponseFinalizeBlock);
    35  }
    36  
    37  //----------------------------------------
    38  // Request types
    39  
    40  message Request {
    41    oneof value {
    42      RequestEcho                echo                  = 1;
    43      RequestFlush               flush                 = 2;
    44      RequestInfo                info                  = 3;
    45      RequestInitChain           init_chain            = 5;
    46      RequestQuery               query                 = 6;
    47      RequestCheckTx             check_tx              = 8;
    48      RequestCommit              commit                = 11;
    49      RequestListSnapshots       list_snapshots        = 12;
    50      RequestOfferSnapshot       offer_snapshot        = 13;
    51      RequestLoadSnapshotChunk   load_snapshot_chunk   = 14;
    52      RequestApplySnapshotChunk  apply_snapshot_chunk  = 15;
    53      RequestPrepareProposal     prepare_proposal      = 16;
    54      RequestProcessProposal     process_proposal      = 17;
    55      RequestExtendVote          extend_vote           = 18;
    56      RequestVerifyVoteExtension verify_vote_extension = 19;
    57      RequestFinalizeBlock       finalize_block        = 20;
    58    }
    59    reserved 4, 7, 9, 10; // SetOption, BeginBlock, DeliverTx, EndBlock
    60  }
    61  
    62  message RequestEcho {
    63    string message = 1;
    64  }
    65  
    66  message RequestFlush {}
    67  
    68  message RequestInfo {
    69    string version       = 1;
    70    uint64 block_version = 2;
    71    uint64 p2p_version   = 3;
    72    string abci_version  = 4;
    73  }
    74  
    75  message RequestInitChain {
    76    google.protobuf.Timestamp        time             = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
    77    string                           chain_id         = 2;
    78    tendermint.types.ConsensusParams consensus_params = 3;
    79    repeated ValidatorUpdate         validators       = 4 [(gogoproto.nullable) = false];
    80    bytes                            app_state_bytes  = 5;
    81    int64                            initial_height   = 6;
    82  }
    83  
    84  message RequestQuery {
    85    bytes  data   = 1;
    86    string path   = 2;
    87    int64  height = 3;
    88    bool   prove  = 4;
    89  }
    90  
    91  enum CheckTxType {
    92    NEW     = 0 [(gogoproto.enumvalue_customname) = "New"];
    93    RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"];
    94  }
    95  
    96  message RequestCheckTx {
    97    bytes       tx   = 1;
    98    CheckTxType type = 2;
    99  }
   100  
   101  message RequestCommit {}
   102  
   103  // lists available snapshots
   104  message RequestListSnapshots {}
   105  
   106  // offers a snapshot to the application
   107  message RequestOfferSnapshot {
   108    Snapshot snapshot = 1; // snapshot offered by peers
   109    bytes    app_hash = 2; // light client-verified app hash for snapshot height
   110  }
   111  
   112  // loads a snapshot chunk
   113  message RequestLoadSnapshotChunk {
   114    uint64 height = 1;
   115    uint32 format = 2;
   116    uint32 chunk  = 3;
   117  }
   118  
   119  // Applies a snapshot chunk
   120  message RequestApplySnapshotChunk {
   121    uint32 index  = 1;
   122    bytes  chunk  = 2;
   123    string sender = 3;
   124  }
   125  
   126  message RequestPrepareProposal {
   127    // the modified transactions cannot exceed this size.
   128    int64 max_tx_bytes = 1;
   129    // txs is an array of transactions that will be included in a block,
   130    // sent to the app for possible modifications.
   131    repeated bytes            txs                  = 2;
   132    ExtendedCommitInfo        local_last_commit    = 3 [(gogoproto.nullable) = false];
   133    repeated Misbehavior      misbehavior          = 4 [(gogoproto.nullable) = false];
   134    int64                     height               = 5;
   135    google.protobuf.Timestamp time                 = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
   136    bytes                     next_validators_hash = 7;
   137    // address of the public key of the validator proposing the block.
   138    bytes proposer_address = 8;
   139  }
   140  
   141  message RequestProcessProposal {
   142    repeated bytes       txs                  = 1;
   143    CommitInfo           proposed_last_commit = 2 [(gogoproto.nullable) = false];
   144    repeated Misbehavior misbehavior          = 3 [(gogoproto.nullable) = false];
   145    // hash is the merkle root hash of the fields of the proposed block.
   146    bytes                     hash                 = 4;
   147    int64                     height               = 5;
   148    google.protobuf.Timestamp time                 = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
   149    bytes                     next_validators_hash = 7;
   150    // address of the public key of the original proposer of the block.
   151    bytes proposer_address = 8;
   152  }
   153  
   154  // Extends a vote with application-injected data
   155  message RequestExtendVote {
   156    // the hash of the block that this vote may be referring to
   157    bytes hash = 1;
   158    // the height of the extended vote
   159    int64 height = 2;
   160    // info of the block that this vote may be referring to
   161    google.protobuf.Timestamp time                 = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
   162    repeated bytes            txs                  = 4;
   163    CommitInfo                proposed_last_commit = 5 [(gogoproto.nullable) = false];
   164    repeated Misbehavior      misbehavior          = 6 [(gogoproto.nullable) = false];
   165    bytes                     next_validators_hash = 7;
   166    // address of the public key of the original proposer of the block.
   167    bytes proposer_address = 8;
   168  }
   169  
   170  // Verify the vote extension
   171  message RequestVerifyVoteExtension {
   172    // the hash of the block that this received vote corresponds to
   173    bytes hash = 1;
   174    // the validator that signed the vote extension
   175    bytes validator_address = 2;
   176    int64 height            = 3;
   177    bytes vote_extension    = 4;
   178  }
   179  
   180  message RequestFinalizeBlock {
   181    repeated bytes       txs                 = 1;
   182    CommitInfo           decided_last_commit = 2 [(gogoproto.nullable) = false];
   183    repeated Misbehavior misbehavior         = 3 [(gogoproto.nullable) = false];
   184    // hash is the merkle root hash of the fields of the decided block.
   185    bytes                     hash                 = 4;
   186    int64                     height               = 5;
   187    google.protobuf.Timestamp time                 = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
   188    bytes                     next_validators_hash = 7;
   189    // proposer_address is the address of the public key of the original proposer of the block.
   190    bytes proposer_address = 8;
   191  }
   192  
   193  //----------------------------------------
   194  // Response types
   195  
   196  message Response {
   197    oneof value {
   198      ResponseException           exception             = 1;
   199      ResponseEcho                echo                  = 2;
   200      ResponseFlush               flush                 = 3;
   201      ResponseInfo                info                  = 4;
   202      ResponseInitChain           init_chain            = 6;
   203      ResponseQuery               query                 = 7;
   204      ResponseCheckTx             check_tx              = 9;
   205      ResponseCommit              commit                = 12;
   206      ResponseListSnapshots       list_snapshots        = 13;
   207      ResponseOfferSnapshot       offer_snapshot        = 14;
   208      ResponseLoadSnapshotChunk   load_snapshot_chunk   = 15;
   209      ResponseApplySnapshotChunk  apply_snapshot_chunk  = 16;
   210      ResponsePrepareProposal     prepare_proposal      = 17;
   211      ResponseProcessProposal     process_proposal      = 18;
   212      ResponseExtendVote          extend_vote           = 19;
   213      ResponseVerifyVoteExtension verify_vote_extension = 20;
   214      ResponseFinalizeBlock       finalize_block        = 21;
   215    }
   216    reserved 5, 8, 10, 11; // SetOption, BeginBlock, DeliverTx, EndBlock
   217  }
   218  
   219  // nondeterministic
   220  message ResponseException {
   221    string error = 1;
   222  }
   223  
   224  message ResponseEcho {
   225    string message = 1;
   226  }
   227  
   228  message ResponseFlush {}
   229  
   230  message ResponseInfo {
   231    string data = 1;
   232  
   233    string version     = 2;
   234    uint64 app_version = 3;
   235  
   236    int64 last_block_height   = 4;
   237    bytes last_block_app_hash = 5;
   238  }
   239  
   240  message ResponseInitChain {
   241    tendermint.types.ConsensusParams consensus_params = 1;
   242    repeated ValidatorUpdate         validators       = 2 [(gogoproto.nullable) = false];
   243    bytes                            app_hash         = 3;
   244  }
   245  
   246  message ResponseQuery {
   247    uint32 code = 1;
   248    // bytes data = 2; // use "value" instead.
   249    string                     log       = 3; // nondeterministic
   250    string                     info      = 4; // nondeterministic
   251    int64                      index     = 5;
   252    bytes                      key       = 6;
   253    bytes                      value     = 7;
   254    tendermint.crypto.ProofOps proof_ops = 8;
   255    int64                      height    = 9;
   256    string                     codespace = 10;
   257  }
   258  
   259  message ResponseCheckTx {
   260    uint32         code       = 1;
   261    bytes          data       = 2;
   262    string         log        = 3; // nondeterministic
   263    string         info       = 4; // nondeterministic
   264    int64          gas_wanted = 5 [json_name = "gas_wanted"];
   265    int64          gas_used   = 6 [json_name = "gas_used"];
   266    repeated Event events     = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
   267    string         codespace  = 8;
   268  
   269    // These reserved fields were used until v0.37 by the priority mempool (now
   270    // removed).
   271    reserved 9 to 11;
   272    reserved "sender", "priority", "mempool_error";
   273  }
   274  
   275  message ResponseCommit {
   276    reserved 1, 2; // data was previously returned here
   277    int64 retain_height = 3;
   278  }
   279  
   280  message ResponseListSnapshots {
   281    repeated Snapshot snapshots = 1;
   282  }
   283  
   284  message ResponseOfferSnapshot {
   285    Result result = 1;
   286  
   287    enum Result {
   288      UNKNOWN       = 0; // Unknown result, abort all snapshot restoration
   289      ACCEPT        = 1; // Snapshot accepted, apply chunks
   290      ABORT         = 2; // Abort all snapshot restoration
   291      REJECT        = 3; // Reject this specific snapshot, try others
   292      REJECT_FORMAT = 4; // Reject all snapshots of this format, try others
   293      REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others
   294    }
   295  }
   296  
   297  message ResponseLoadSnapshotChunk {
   298    bytes chunk = 1;
   299  }
   300  
   301  message ResponseApplySnapshotChunk {
   302    Result          result         = 1;
   303    repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply
   304    repeated string reject_senders = 3; // Chunk senders to reject and ban
   305  
   306    enum Result {
   307      UNKNOWN         = 0; // Unknown result, abort all snapshot restoration
   308      ACCEPT          = 1; // Chunk successfully accepted
   309      ABORT           = 2; // Abort all snapshot restoration
   310      RETRY           = 3; // Retry chunk (combine with refetch and reject)
   311      RETRY_SNAPSHOT  = 4; // Retry snapshot (combine with refetch and reject)
   312      REJECT_SNAPSHOT = 5; // Reject this snapshot, try others
   313    }
   314  }
   315  
   316  message ResponsePrepareProposal {
   317    repeated bytes txs = 1;
   318  }
   319  
   320  message ResponseProcessProposal {
   321    ProposalStatus status = 1;
   322  
   323    enum ProposalStatus {
   324      UNKNOWN = 0;
   325      ACCEPT  = 1;
   326      REJECT  = 2;
   327    }
   328  }
   329  
   330  message ResponseExtendVote {
   331    bytes vote_extension = 1;
   332  }
   333  
   334  message ResponseVerifyVoteExtension {
   335    VerifyStatus status = 1;
   336  
   337    enum VerifyStatus {
   338      UNKNOWN = 0;
   339      ACCEPT  = 1;
   340      // Rejecting the vote extension will reject the entire precommit by the sender.
   341      // Incorrectly implementing this thus has liveness implications as it may affect
   342      // CometBFT's ability to receive 2/3+ valid votes to finalize the block.
   343      // Honest nodes should never be rejected.
   344      REJECT = 2;
   345    }
   346  }
   347  
   348  message ResponseFinalizeBlock {
   349    // set of block events emmitted as part of executing the block
   350    repeated Event events = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
   351    // the result of executing each transaction including the events
   352    // the particular transction emitted. This should match the order
   353    // of the transactions delivered in the block itself
   354    repeated ExecTxResult tx_results = 2;
   355    // a list of updates to the validator set. These will reflect the validator set at current height + 2.
   356    repeated ValidatorUpdate validator_updates = 3 [(gogoproto.nullable) = false];
   357    // updates to the consensus params, if any.
   358    tendermint.types.ConsensusParams consensus_param_updates = 4;
   359    // app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was
   360    // deterministic. It is up to the application to decide which algorithm to use.
   361    bytes app_hash = 5;
   362  }
   363  
   364  //----------------------------------------
   365  // Misc.
   366  
   367  message CommitInfo {
   368    int32             round = 1;
   369    repeated VoteInfo votes = 2 [(gogoproto.nullable) = false];
   370  }
   371  
   372  // ExtendedCommitInfo is similar to CommitInfo except that it is only used in
   373  // the PrepareProposal request such that CometBFT can provide vote extensions
   374  // to the application.
   375  message ExtendedCommitInfo {
   376    // The round at which the block proposer decided in the previous height.
   377    int32 round = 1;
   378    // List of validators' addresses in the last validator set with their voting
   379    // information, including vote extensions.
   380    repeated ExtendedVoteInfo votes = 2 [(gogoproto.nullable) = false];
   381  }
   382  
   383  // Event allows application developers to attach additional information to
   384  // ResponseFinalizeBlock and ResponseCheckTx.
   385  // Later, transactions may be queried using these events.
   386  message Event {
   387    string                  type       = 1;
   388    repeated EventAttribute attributes = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes,omitempty"];
   389  }
   390  
   391  // EventAttribute is a single key-value pair, associated with an event.
   392  message EventAttribute {
   393    string key   = 1;
   394    string value = 2;
   395    bool   index = 3; // nondeterministic
   396  }
   397  
   398  // ExecTxResult contains results of executing one individual transaction.
   399  //
   400  // * Its structure is equivalent to #ResponseDeliverTx which will be deprecated/deleted
   401  message ExecTxResult {
   402    uint32         code       = 1;
   403    bytes          data       = 2;
   404    string         log        = 3; // nondeterministic
   405    string         info       = 4; // nondeterministic
   406    int64          gas_wanted = 5 [json_name = "gas_wanted"];
   407    int64          gas_used   = 6 [json_name = "gas_used"];
   408    repeated Event events     = 7
   409        [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic
   410    string codespace = 8;
   411  }
   412  
   413  // TxResult contains results of executing the transaction.
   414  //
   415  // One usage is indexing transaction results.
   416  message TxResult {
   417    int64        height = 1;
   418    uint32       index  = 2;
   419    bytes        tx     = 3;
   420    ExecTxResult result = 4 [(gogoproto.nullable) = false];
   421  }
   422  
   423  //----------------------------------------
   424  // Blockchain Types
   425  
   426  message Validator {
   427    bytes address = 1; // The first 20 bytes of SHA256(public key)
   428    // PubKey pub_key = 2 [(gogoproto.nullable)=false];
   429    int64 power = 3; // The voting power
   430  }
   431  
   432  message ValidatorUpdate {
   433    tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false];
   434    int64                       power   = 2;
   435  }
   436  
   437  message VoteInfo {
   438    Validator                    validator     = 1 [(gogoproto.nullable) = false];
   439    tendermint.types.BlockIDFlag block_id_flag = 3;
   440  
   441    reserved 2; // signed_last_block
   442  }
   443  
   444  message ExtendedVoteInfo {
   445    // The validator that sent the vote.
   446    Validator validator = 1 [(gogoproto.nullable) = false];
   447    // Non-deterministic extension provided by the sending validator's application.
   448    bytes vote_extension = 3;
   449    // Vote extension signature created by CometBFT
   450    bytes extension_signature = 4;
   451    // block_id_flag indicates whether the validator voted for a block, nil, or did not vote at all
   452    tendermint.types.BlockIDFlag block_id_flag = 5;
   453  
   454    reserved 2; // signed_last_block
   455  }
   456  
   457  enum MisbehaviorType {
   458    UNKNOWN             = 0;
   459    DUPLICATE_VOTE      = 1;
   460    LIGHT_CLIENT_ATTACK = 2;
   461  }
   462  
   463  message Misbehavior {
   464    MisbehaviorType type = 1;
   465    // The offending validator
   466    Validator validator = 2 [(gogoproto.nullable) = false];
   467    // The height when the offense occurred
   468    int64 height = 3;
   469    // The corresponding time where the offense occurred
   470    google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
   471    // Total voting power of the validator set in case the ABCI application does
   472    // not store historical validators.
   473    // https://github.com/tendermint/tendermint/issues/4581
   474    int64 total_voting_power = 5;
   475  }
   476  
   477  //----------------------------------------
   478  // State Sync Types
   479  
   480  message Snapshot {
   481    uint64 height   = 1; // The height at which the snapshot was taken
   482    uint32 format   = 2; // The application-specific snapshot format
   483    uint32 chunks   = 3; // Number of chunks in the snapshot
   484    bytes  hash     = 4; // Arbitrary snapshot hash, equal only if identical
   485    bytes  metadata = 5; // Arbitrary application metadata
   486  }