github.com/okex/exchain@v1.8.0/libs/tendermint/abci/types/types.proto (about)

     1  syntax = "proto3";
     2  package tendermint.abci.types;
     3  option  go_package = "github.com/tendermint/tendermint/abci/types";
     4  
     5  // For more information on gogo.proto, see:
     6  // https://github.com/gogo/protobuf/blob/master/extensions.md
     7  import "third_party/proto/gogoproto/gogo.proto";
     8  import "crypto/merkle/merkle.proto";
     9  import "libs/kv/types.proto";
    10  import "google/protobuf/timestamp.proto";
    11  import "google/protobuf/duration.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  option (gogoproto.marshaler_all)        = true;
    18  option (gogoproto.unmarshaler_all)      = true;
    19  option (gogoproto.sizer_all)            = true;
    20  option (gogoproto.goproto_registration) = true;
    21  // Generate tests
    22  option (gogoproto.populate_all) = true;
    23  option (gogoproto.equal_all)    = true;
    24  option (gogoproto.testgen_all)  = true;
    25  
    26  //----------------------------------------
    27  // Request types
    28  
    29  message Request {
    30    oneof value {
    31      RequestEcho       echo        = 2;
    32      RequestFlush      flush       = 3;
    33      RequestInfo       info        = 4;
    34      RequestSetOption  set_option  = 5;
    35      RequestInitChain  init_chain  = 6;
    36      RequestQuery      query       = 7;
    37      RequestBeginBlock begin_block = 8;
    38      RequestCheckTx    check_tx    = 9;
    39      RequestDeliverTx  deliver_tx  = 19;
    40      RequestEndBlock   end_block   = 11;
    41      RequestCommit     commit      = 12;
    42    }
    43  }
    44  
    45  message RequestEcho {
    46    string message = 1;
    47  }
    48  
    49  message RequestFlush {}
    50  
    51  message RequestInfo {
    52    string version       = 1;
    53    uint64 block_version = 2;
    54    uint64 p2p_version   = 3;
    55  }
    56  
    57  // nondeterministic
    58  message RequestSetOption {
    59    string key   = 1;
    60    string value = 2;
    61  }
    62  
    63  message RequestInitChain {
    64    google.protobuf.Timestamp time     = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
    65    string                    chain_id = 2;
    66    ConsensusParams           consensus_params = 3;
    67    repeated ValidatorUpdate  validators       = 4 [(gogoproto.nullable) = false];
    68    bytes                     app_state_bytes  = 5;
    69  }
    70  
    71  message RequestQuery {
    72    bytes  data   = 1;
    73    string path   = 2;
    74    int64  height = 3;
    75    bool   prove  = 4;
    76  }
    77  
    78  message RequestBeginBlock {
    79    bytes             hash                 = 1;
    80    Header            header               = 2 [(gogoproto.nullable) = false];
    81    LastCommitInfo    last_commit_info     = 3 [(gogoproto.nullable) = false];
    82    repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false];
    83    bool              use_deltas           = 5;
    84  }
    85  
    86  enum CheckTxType {
    87    New          = 0;
    88    Recheck      = 1;
    89    WrappedCheck = 2;
    90  }
    91  
    92  message RequestCheckTx {
    93    bytes       tx   = 1;
    94    CheckTxType type = 2;
    95    string      from = 3;
    96  }
    97  
    98  message RequestDeliverTx {
    99    bytes tx = 1;
   100  }
   101  
   102  message RequestEndBlock {
   103    int64 height = 1;
   104  }
   105  
   106  message Deltas {
   107    bytes abci_rsp = 1;
   108    bytes deltas_byte = 2;
   109  }
   110  message RequestCommit {
   111    Deltas deltas = 1;
   112  }
   113  
   114  //----------------------------------------
   115  // Response types
   116  
   117  message Response {
   118    oneof value {
   119      ResponseException  exception   = 1;
   120      ResponseEcho       echo        = 2;
   121      ResponseFlush      flush       = 3;
   122      ResponseInfo       info        = 4;
   123      ResponseSetOption  set_option  = 5;
   124      ResponseInitChain  init_chain  = 6;
   125      ResponseQuery      query       = 7;
   126      ResponseBeginBlock begin_block = 8;
   127      ResponseCheckTx    check_tx    = 9;
   128      ResponseDeliverTx  deliver_tx  = 10;
   129      ResponseEndBlock   end_block   = 11;
   130      ResponseCommit     commit      = 12;
   131    }
   132  }
   133  
   134  // nondeterministic
   135  message ResponseException {
   136    string error = 1;
   137  }
   138  
   139  message ResponseEcho {
   140    string message = 1;
   141  }
   142  
   143  message ResponseFlush {}
   144  
   145  message ResponseInfo {
   146    string data = 1;
   147  
   148    string version     = 2;
   149    uint64 app_version = 3;
   150  
   151    int64 last_block_height   = 4;
   152    bytes last_block_app_hash = 5;
   153  }
   154  
   155  // nondeterministic
   156  message ResponseSetOption {
   157    uint32 code = 1;
   158    // bytes data = 2;
   159    string log  = 3;
   160    string info = 4;
   161  }
   162  
   163  message ResponseInitChain {
   164    ConsensusParams          consensus_params = 1;
   165    repeated ValidatorUpdate validators       = 2 [(gogoproto.nullable) = false];
   166  }
   167  
   168  message ResponseQuery {
   169    uint32 code = 1;
   170    // bytes data = 2; // use "value" instead.
   171    string                         log       = 3;  // nondeterministic
   172    string                         info      = 4;  // nondeterministic
   173    int64                          index     = 5;
   174    bytes                          key       = 6;
   175    bytes                          value     = 7;
   176    tendermint.crypto.merkle.Proof proof     = 8;
   177    int64                          height    = 9;
   178    string                         codespace = 10;
   179  }
   180  
   181  message ResponseBeginBlock {
   182    repeated Event events = 1
   183        [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
   184  }
   185  
   186  message ResponseCheckTx {
   187    uint32         code       = 1;
   188    bytes          data       = 2;
   189    string         log        = 3;  // nondeterministic
   190    string         info       = 4;  // nondeterministic
   191    int64          gas_wanted = 5;
   192    int64          gas_used   = 6;
   193    repeated Event events     = 7
   194        [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
   195    string codespace = 8;
   196  }
   197  
   198  message ResponseDeliverTx {
   199    uint32         code       = 1;
   200    bytes          data       = 2;
   201    string         log        = 3;  // nondeterministic
   202    string         info       = 4;  // nondeterministic
   203    int64          gas_wanted = 5;
   204    int64          gas_used   = 6;
   205    repeated Event events     = 7
   206        [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
   207    string codespace = 8;
   208  }
   209  
   210  message ResponseEndBlock {
   211    repeated ValidatorUpdate validator_updates       = 1 [(gogoproto.nullable) = false];
   212    ConsensusParams          consensus_param_updates = 2;
   213    repeated Event           events                  = 3
   214        [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
   215  }
   216  
   217  message ResponseCommit {
   218    // reserve 1
   219    bytes data          = 2;
   220    int64 retain_height = 3;
   221    Deltas deltas = 4;
   222  }
   223  
   224  //----------------------------------------
   225  // Misc.
   226  
   227  // ConsensusParams contains all consensus-relevant parameters
   228  // that can be adjusted by the abci app
   229  message ConsensusParams {
   230    BlockParams     block     = 1;
   231    EvidenceParams  evidence  = 2;
   232    ValidatorParams validator = 3;
   233  }
   234  
   235  // BlockParams contains limits on the block size.
   236  message BlockParams {
   237    // Note: must be greater than 0
   238    int64 max_bytes = 1;
   239    // Note: must be greater or equal to -1
   240    int64 max_gas = 2;
   241  }
   242  
   243  message EvidenceParams {
   244    // Note: must be greater than 0
   245    int64                    max_age_num_blocks = 1;
   246    google.protobuf.Duration max_age_duration   = 2
   247        [(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
   248  }
   249  
   250  // ValidatorParams contains limits on validators.
   251  message ValidatorParams {
   252    repeated string pub_key_types = 1;
   253  }
   254  
   255  message LastCommitInfo {
   256    int32             round = 1;
   257    repeated VoteInfo votes = 2 [(gogoproto.nullable) = false];
   258  }
   259  
   260  message Event {
   261    string   type                               = 1;
   262    repeated tendermint.libs.kv.Pair attributes = 2
   263        [(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes,omitempty"];
   264  }
   265  
   266  //----------------------------------------
   267  // Blockchain Types
   268  
   269  message Header {
   270    // basic block info
   271    Version                   version  = 1 [(gogoproto.nullable) = false];
   272    string                    chain_id = 2 [(gogoproto.customname) = "ChainID"];
   273    int64                     height   = 3;
   274    google.protobuf.Timestamp time     = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
   275  
   276    // prev block info
   277    BlockID last_block_id = 5 [(gogoproto.nullable) = false];
   278  
   279    // hashes of block data
   280    bytes last_commit_hash = 6;  // commit from validators from the last block
   281    bytes data_hash        = 7;  // transactions
   282  
   283    // hashes from the app output from the prev block
   284    bytes validators_hash      = 8;   // validators for the current block
   285    bytes next_validators_hash = 9;   // validators for the next block
   286    bytes consensus_hash       = 10;  // consensus params for current block
   287    bytes app_hash             = 11;  // state after txs from the previous block
   288    bytes last_results_hash    = 12;  // root hash of all results from the txs from the previous block
   289  
   290    // consensus info
   291    bytes evidence_hash    = 13;  // evidence included in the block
   292    bytes proposer_address = 14;  // original proposer of the block
   293  }
   294  
   295  message Version {
   296    uint64 Block = 1;
   297    uint64 App   = 2;
   298  }
   299  
   300  message BlockID {
   301    bytes         hash         = 1;
   302    PartSetHeader parts_header = 2 [(gogoproto.nullable) = false];
   303  }
   304  
   305  message PartSetHeader {
   306    int32 total = 1;
   307    bytes hash  = 2;
   308  }
   309  
   310  // Validator
   311  message Validator {
   312    bytes address = 1;
   313    // PubKey pub_key = 2 [(gogoproto.nullable)=false];
   314    int64 power = 3;
   315  }
   316  
   317  // ValidatorUpdate
   318  message ValidatorUpdate {
   319    PubKey pub_key = 1 [(gogoproto.nullable) = false];
   320    int64  power   = 2;
   321  }
   322  
   323  // VoteInfo
   324  message VoteInfo {
   325    Validator validator         = 1 [(gogoproto.nullable) = false];
   326    bool      signed_last_block = 2;
   327  }
   328  
   329  message PubKey {
   330    string type = 1;
   331    bytes  data = 2;
   332  }
   333  
   334  message Evidence {
   335    string                    type      = 1;
   336    Validator                 validator = 2 [(gogoproto.nullable) = false];
   337    int64                     height    = 3;
   338    google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
   339    int64                     total_voting_power = 5;
   340  }
   341  
   342  //----------------------------------------
   343  // Service Definition
   344  
   345  service ABCIApplication {
   346    rpc Echo(RequestEcho) returns (ResponseEcho);
   347    rpc Flush(RequestFlush) returns (ResponseFlush);
   348    rpc Info(RequestInfo) returns (ResponseInfo);
   349    rpc SetOption(RequestSetOption) returns (ResponseSetOption);
   350    rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx);
   351    rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
   352    rpc Query(RequestQuery) returns (ResponseQuery);
   353    rpc Commit(RequestCommit) returns (ResponseCommit);
   354    rpc InitChain(RequestInitChain) returns (ResponseInitChain);
   355    rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock);
   356    rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock);
   357  }