github.com/evdatsion/aphelion-dpos-bft@v0.32.1/abci/types/types.proto (about)

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