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