github.com/Oyster-zx/tendermint@v0.34.24-fork/proto/tendermint/types/types.proto (about) 1 syntax = "proto3"; 2 package tendermint.types; 3 4 option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; 5 6 import "gogoproto/gogo.proto"; 7 import "google/protobuf/timestamp.proto"; 8 import "tendermint/crypto/proof.proto"; 9 import "tendermint/version/types.proto"; 10 import "tendermint/types/validator.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 } 91 92 // Vote represents a prevote, precommit, or commit vote from validators for 93 // consensus. 94 message Vote { 95 SignedMsgType type = 1; 96 int64 height = 2; 97 int32 round = 3; 98 BlockID block_id = 4 99 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. 100 google.protobuf.Timestamp timestamp = 5 101 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; 102 bytes validator_address = 6; 103 int32 validator_index = 7; 104 bytes signature = 8; 105 } 106 107 // Commit contains the evidence that a block was committed by a set of validators. 108 message Commit { 109 int64 height = 1; 110 int32 round = 2; 111 BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; 112 repeated CommitSig signatures = 4 [(gogoproto.nullable) = false]; 113 } 114 115 // CommitSig is a part of the Vote included in a Commit. 116 message CommitSig { 117 BlockIDFlag block_id_flag = 1; 118 bytes validator_address = 2; 119 google.protobuf.Timestamp timestamp = 3 120 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; 121 bytes signature = 4; 122 } 123 124 message Proposal { 125 SignedMsgType type = 1; 126 int64 height = 2; 127 int32 round = 3; 128 int32 pol_round = 4; 129 BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; 130 google.protobuf.Timestamp timestamp = 6 131 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; 132 bytes signature = 7; 133 } 134 135 message SignedHeader { 136 Header header = 1; 137 Commit commit = 2; 138 } 139 140 message LightBlock { 141 SignedHeader signed_header = 1; 142 tendermint.types.ValidatorSet validator_set = 2; 143 } 144 145 message BlockMeta { 146 BlockID block_id = 1 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; 147 int64 block_size = 2; 148 Header header = 3 [(gogoproto.nullable) = false]; 149 int64 num_txs = 4; 150 } 151 152 // TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. 153 message TxProof { 154 bytes root_hash = 1; 155 bytes data = 2; 156 tendermint.crypto.Proof proof = 3; 157 }