github.com/adoriasoft/tendermint@v0.34.0-dev1.0.20200722151356-96d84601a75a/proto/tendermint/types/types.proto (about)

     1  syntax = "proto3";
     2  package tendermint.types;
     3  
     4  option go_package = "github.com/adoriasoft/tendermint/proto/tendermint/types";
     5  
     6  import "gogoproto/gogo.proto";
     7  import "google/protobuf/timestamp.proto";
     8  import "tendermint/libs/bits/types.proto";
     9  import "tendermint/crypto/proof.proto";
    10  import "tendermint/version/types.proto";
    11  
    12  // BlockIdFlag indicates which BlcokID the signature is for
    13  enum BlockIDFlag {
    14    option (gogoproto.goproto_enum_stringer) = true;
    15    option (gogoproto.goproto_enum_prefix)   = false;
    16  
    17    BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"];
    18    BLOCK_ID_FLAG_ABSENT  = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"];
    19    BLOCK_ID_FLAG_COMMIT  = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"];
    20    BLOCK_ID_FLAG_NIL     = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"];
    21  }
    22  
    23  // SignedMsgType is a type of signed message in the consensus.
    24  enum SignedMsgType {
    25    option (gogoproto.goproto_enum_stringer) = true;
    26    option (gogoproto.goproto_enum_prefix)   = false;
    27  
    28    SIGNED_MSG_TYPE_UNKNOWN   = 0 [(gogoproto.enumvalue_customname) = "UnknownType"];
    29    // Votes
    30    SIGNED_MSG_TYPE_PREVOTE   = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"];
    31    SIGNED_MSG_TYPE_PRECOMMIT = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"];
    32  
    33    // Proposals
    34    SIGNED_MSG_TYPE_PROPOSAL  = 32 [(gogoproto.enumvalue_customname) = "ProposalType"];
    35  }
    36  
    37  // PartsetHeader
    38  message PartSetHeader {
    39    uint32 total = 1;
    40    bytes  hash  = 2;
    41  }
    42  
    43  message Part {
    44    uint32                  index = 1;
    45    bytes                   bytes = 2;
    46    tendermint.crypto.Proof proof = 3 [(gogoproto.nullable) = false];
    47  }
    48  
    49  // BlockID
    50  message BlockID {
    51    bytes         hash            = 1;
    52    PartSetHeader part_set_header = 2 [(gogoproto.nullable) = false];
    53  }
    54  
    55  // --------------------------------
    56  
    57  // Header defines the structure of a Tendermint block header.
    58  message Header {
    59    // basic block info
    60    tendermint.version.Consensus version  = 1 [(gogoproto.nullable) = false];
    61    string                       chain_id = 2 [(gogoproto.customname) = "ChainID"];
    62    int64                        height   = 3;
    63    google.protobuf.Timestamp    time     = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
    64  
    65    // prev block info
    66    BlockID last_block_id = 5 [(gogoproto.nullable) = false];
    67  
    68    // hashes of block data
    69    bytes last_commit_hash = 6;  // commit from validators from the last block
    70    bytes data_hash        = 7;  // transactions
    71  
    72    // hashes from the app output from the prev block
    73    bytes validators_hash      = 8;   // validators for the current block
    74    bytes next_validators_hash = 9;   // validators for the next block
    75    bytes consensus_hash       = 10;  // consensus params for current block
    76    bytes app_hash             = 11;  // state after txs from the previous block
    77    bytes last_results_hash    = 12;  // root hash of all results from the txs from the previous block
    78  
    79    // consensus info
    80    bytes evidence_hash    = 13;  // evidence included in the block
    81    bytes proposer_address = 14;  // original proposer of the block
    82  }
    83  
    84  // Data contains the set of transactions included in the block
    85  message Data {
    86    // Txs that will be applied by state @ block.Height+1.
    87    // NOTE: not all txs here are valid.  We're just agreeing on the order first.
    88    // This means that block.AppHash does not include these txs.
    89    repeated bytes txs = 1;
    90    // Volatile
    91    bytes hash = 2;
    92  }
    93  
    94  // Vote represents a prevote, precommit, or commit vote from validators for
    95  // consensus.
    96  message Vote {
    97    SignedMsgType type     = 1;
    98    int64         height   = 2;
    99    int32         round    = 3;
   100    BlockID       block_id = 4
   101        [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"];  // zero if vote is nil.
   102    google.protobuf.Timestamp timestamp = 5
   103        [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
   104    bytes validator_address = 6;
   105    int32 validator_index   = 7;
   106    bytes signature         = 8;
   107  }
   108  
   109  // Commit contains the evidence that a block was committed by a set of validators.
   110  message Commit {
   111    int64                         height     = 1;
   112    int32                         round      = 2;
   113    BlockID                       block_id   = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"];
   114    repeated CommitSig            signatures = 4 [(gogoproto.nullable) = false];
   115    bytes                         hash       = 5;
   116    tendermint.libs.bits.BitArray bit_array  = 6;
   117  }
   118  
   119  // CommitSig is a part of the Vote included in a Commit.
   120  message CommitSig {
   121    BlockIDFlag               block_id_flag     = 1;
   122    bytes                     validator_address = 2;
   123    google.protobuf.Timestamp timestamp         = 3
   124        [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
   125    bytes signature = 4;
   126  }
   127  
   128  message Proposal {
   129    SignedMsgType             type      = 1;
   130    int64                     height    = 2;
   131    int32                     round     = 3;
   132    int32                     pol_round = 4;
   133    BlockID                   block_id  = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false];
   134    google.protobuf.Timestamp timestamp = 6
   135        [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
   136    bytes signature = 7;
   137  }
   138  
   139  message SignedHeader {
   140    Header header = 1;
   141    Commit commit = 2;
   142  }
   143  
   144  message BlockMeta {
   145    BlockID block_id   = 1 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false];
   146    int64   block_size = 2;
   147    Header  header     = 3 [(gogoproto.nullable) = false];
   148    int64   num_txs    = 4;
   149  }
   150  
   151  // TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
   152  message TxProof {
   153    bytes                   root_hash = 1;
   154    bytes                   data      = 2;
   155    tendermint.crypto.Proof proof     = 3;
   156  }