Browse Source

proto: modify height int64 to uint64 (#253)

pull/7804/head
Marko 3 years ago
committed by GitHub
parent
commit
b315f04980
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 55 additions and 47 deletions
  1. +11
    -11
      proto/abci/types.proto
  2. +4
    -4
      proto/blockchain/types.proto
  3. +7
    -7
      proto/consensus/types.proto
  4. +0
    -1
      proto/p2p/conn.proto
  5. +7
    -2
      proto/p2p/pex.proto
  6. +14
    -7
      proto/p2p/types.proto
  7. +1
    -1
      proto/types/evidence.proto
  8. +2
    -5
      proto/types/params.proto
  9. +4
    -4
      proto/types/types.proto
  10. +5
    -5
      spec/core/data_structures.md

+ 11
- 11
proto/abci/types.proto View File

@ -48,7 +48,7 @@ message RequestInfo {
string version = 1;
uint64 block_version = 2;
uint64 p2p_version = 3;
string abci_version = 4;
string abci_version = 4;
}
message RequestInitChain {
@ -58,13 +58,13 @@ message RequestInitChain {
ConsensusParams consensus_params = 3;
repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false];
bytes app_state_bytes = 5;
int64 initial_height = 6;
uint64 initial_height = 6;
}
message RequestQuery {
bytes data = 1;
string path = 2;
int64 height = 3;
uint64 height = 3;
bool prove = 4;
}
@ -90,7 +90,7 @@ message RequestDeliverTx {
}
message RequestEndBlock {
int64 height = 1;
uint64 height = 1;
}
message RequestCommit {}
@ -160,8 +160,8 @@ message ResponseInfo {
string version = 2;
uint64 app_version = 3;
int64 last_block_height = 4;
bytes last_block_app_hash = 5;
uint64 last_block_height = 4;
bytes last_block_app_hash = 5;
}
message ResponseInitChain {
@ -179,7 +179,7 @@ message ResponseQuery {
bytes key = 6;
bytes value = 7;
tendermint.crypto.ProofOps proof_ops = 8;
int64 height = 9;
uint64 height = 9;
string codespace = 10;
}
@ -222,8 +222,8 @@ message ResponseEndBlock {
message ResponseCommit {
// reserve 1
bytes data = 2;
int64 retain_height = 3;
bytes data = 2;
uint64 retain_height = 3;
}
message ResponseListSnapshots {
@ -309,7 +309,7 @@ message EventAttribute {
//
// One usage is indexing transaction results.
message TxResult {
int64 height = 1;
uint64 height = 1;
uint32 index = 2;
bytes tx = 3;
ResponseDeliverTx result = 4 [(gogoproto.nullable) = false];
@ -348,7 +348,7 @@ message Evidence {
// The offending validator
Validator validator = 2 [(gogoproto.nullable) = false];
// The height when the offense occurred
int64 height = 3;
uint64 height = 3;
// The corresponding time where the offense occurred
google.protobuf.Timestamp time = 4 [
(gogoproto.nullable) = false,


+ 4
- 4
proto/blockchain/types.proto View File

@ -7,12 +7,12 @@ import "tendermint/types/block.proto";
// BlockRequest requests a block for a specific height
message BlockRequest {
int64 height = 1;
uint64 height = 1;
}
// NoBlockResponse informs the node that the peer does not have block at the requested height
message NoBlockResponse {
int64 height = 1;
uint64 height = 1;
}
// BlockResponse returns block to the requested
@ -26,8 +26,8 @@ message StatusRequest {
// StatusResponse is a peer response to inform their status.
message StatusResponse {
int64 height = 1;
int64 base = 2;
uint64 height = 1;
uint64 base = 2;
}
message Message {


+ 7
- 7
proto/consensus/types.proto View File

@ -10,7 +10,7 @@ import "tendermint/libs/bits/types.proto";
// NewRoundStep is sent for every step taken in the ConsensusState.
// For every height/round/step transition
message NewRoundStep {
int64 height = 1;
uint64 height = 1;
int32 round = 2;
uint32 step = 3;
int64 seconds_since_start_time = 4;
@ -21,7 +21,7 @@ message NewRoundStep {
//i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r.
// In case the block is also committed, then IsCommit flag is set to true.
message NewValidBlock {
int64 height = 1;
uint64 height = 1;
int32 round = 2;
tendermint.types.PartSetHeader block_part_set_header = 3 [(gogoproto.nullable) = false];
tendermint.libs.bits.BitArray block_parts = 4;
@ -35,14 +35,14 @@ message Proposal {
// ProposalPOL is sent when a previous proposal is re-proposed.
message ProposalPOL {
int64 height = 1;
uint64 height = 1;
int32 proposal_pol_round = 2;
tendermint.libs.bits.BitArray proposal_pol = 3 [(gogoproto.nullable) = false];
}
// BlockPart is sent when gossipping a piece of the proposed block.
message BlockPart {
int64 height = 1;
uint64 height = 1;
int32 round = 2;
tendermint.types.Part part = 3 [(gogoproto.nullable) = false];
}
@ -54,7 +54,7 @@ message Vote {
// HasVote is sent to indicate that a particular vote has been received.
message HasVote {
int64 height = 1;
uint64 height = 1;
int32 round = 2;
tendermint.types.SignedMsgType type = 3;
int32 index = 4;
@ -62,7 +62,7 @@ message HasVote {
// VoteSetMaj23 is sent to indicate that a given BlockID has seen +2/3 votes.
message VoteSetMaj23 {
int64 height = 1;
uint64 height = 1;
int32 round = 2;
tendermint.types.SignedMsgType type = 3;
tendermint.types.BlockID block_id = 4 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false];
@ -70,7 +70,7 @@ message VoteSetMaj23 {
// VoteSetBits is sent to communicate the bit-array of votes seen for the BlockID.
message VoteSetBits {
int64 height = 1;
uint64 height = 1;
int32 round = 2;
tendermint.types.SignedMsgType type = 3;
tendermint.types.BlockID block_id = 4 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false];


+ 0
- 1
proto/p2p/conn.proto View File

@ -24,7 +24,6 @@ message Packet {
}
}
// AuthSigMessage is used while upgrading an insecure connection.
message AuthSigMessage {
tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false];
bytes sig = 2;


+ 7
- 2
proto/p2p/pex.proto View File

@ -3,13 +3,18 @@ package tendermint.p2p;
option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p";
import "tendermint/p2p/types.proto";
import "gogoproto/gogo.proto";
message PexAddress {
string id = 1 [(gogoproto.customname) = "ID"];
string ip = 2 [(gogoproto.customname) = "IP"];
uint32 port = 3;
}
message PexRequest {}
message PexResponse {
repeated NetAddress addresses = 1 [(gogoproto.nullable) = false];
repeated PexAddress addresses = 1 [(gogoproto.nullable) = false];
}
message PexMessage {


+ 14
- 7
proto/p2p/types.proto View File

@ -4,12 +4,7 @@ package tendermint.p2p;
option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p";
import "gogoproto/gogo.proto";
message NetAddress {
string id = 1 [(gogoproto.customname) = "ID"];
string ip = 2 [(gogoproto.customname) = "IP"];
uint32 port = 3;
}
import "google/protobuf/timestamp.proto";
message ProtocolVersion {
uint64 p2p = 1 [(gogoproto.customname) = "P2P"];
@ -17,7 +12,6 @@ message ProtocolVersion {
uint64 app = 3;
}
// NodeInfo is the information exchanged between two peers when conducting the handshake.
message NodeInfo {
ProtocolVersion protocol_version = 1 [(gogoproto.nullable) = false];
string node_id = 2 [(gogoproto.customname) = "NodeID"];
@ -33,3 +27,16 @@ message NodeInfoOther {
string tx_index = 1;
string rpc_address = 2 [(gogoproto.customname) = "RPCAddress"];
}
message PeerInfo {
string id = 1 [(gogoproto.customname) = "ID"];
repeated PeerAddressInfo address_info = 2;
google.protobuf.Timestamp last_connected = 3 [(gogoproto.stdtime) = true];
}
message PeerAddressInfo {
string address = 1;
google.protobuf.Timestamp last_dial_success = 2 [(gogoproto.stdtime) = true];
google.protobuf.Timestamp last_dial_failure = 3 [(gogoproto.stdtime) = true];
uint32 dial_failures = 4;
}

+ 1
- 1
proto/types/evidence.proto View File

@ -27,7 +27,7 @@ message DuplicateVoteEvidence {
// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client.
message LightClientAttackEvidence {
tendermint.types.LightBlock conflicting_block = 1;
int64 common_height = 2;
uint64 common_height = 2;
repeated tendermint.types.Validator byzantine_validators = 3;
int64 total_voting_power = 4;
google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];


+ 2
- 5
proto/types/params.proto View File

@ -20,13 +20,10 @@ message ConsensusParams {
// BlockParams contains limits on the block size.
message BlockParams {
// Max block size, in bytes.
// Note: must be greater than 0
int64 max_bytes = 1;
// Max gas per block.
// Note: must be greater or equal to -1
int64 max_gas = 2;
// This parameter is unused.
int64 time_iota_ms = 3;
}
// EvidenceParams determine how we handle evidence of malfeasance.
@ -72,6 +69,6 @@ message VersionParams {
//
// It is hashed into the Header.ConsensusHash.
message HashedParams {
int64 block_max_bytes = 1;
int64 block_max_gas = 2;
uint64 block_max_bytes = 1;
uint64 block_max_gas = 2;
}

+ 4
- 4
proto/types/types.proto View File

@ -59,7 +59,7 @@ message Header {
// basic block info
tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false];
string chain_id = 2 [(gogoproto.customname) = "ChainID"];
int64 height = 3;
uint64 height = 3;
google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
// prev block info
@ -93,7 +93,7 @@ message Data {
// consensus.
message Vote {
SignedMsgType type = 1;
int64 height = 2;
uint64 height = 2;
int32 round = 3;
BlockID block_id = 4
[(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil.
@ -106,7 +106,7 @@ message Vote {
// Commit contains the evidence that a block was committed by a set of validators.
message Commit {
int64 height = 1;
uint64 height = 1;
int32 round = 2;
BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"];
repeated CommitSig signatures = 4 [(gogoproto.nullable) = false];
@ -123,7 +123,7 @@ message CommitSig {
message Proposal {
SignedMsgType type = 1;
int64 height = 2;
uint64 height = 2;
int32 round = 3;
int32 pol_round = 4;
BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false];


+ 5
- 5
spec/core/data_structures.md View File

@ -112,7 +112,7 @@ the data in the current block, the previous block, and the results returned by t
|-------------------|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Version | [Version](#version) | Version defines the application and protocol verion being used. | Must adhere to the validation rules of [Version](#version) |
| ChainID | String | ChainID is the ID of the chain. This must be unique to your chain. | ChainID must be less than 50 bytes. |
| Height | int64 | Height is the height for this header. | Must be > 0, >= initialHeight, and == previous Height+1 |
| Height | uint64 | Height is the height for this header. | Must be > 0, >= initialHeight, and == previous Height+1 |
| Time | [Time](#time) | The timestamp is equal to the weighted median of validators present in the last commit. Read more on time in the [BFT-time section](../consensus/bft-time.md). Note: the timestamp of a vote must be greater by at least one millisecond than that of the block being voted on. | Time must be >= previous header timestamp + consensus parameters TimeIotaMs. The timestamp of the first block must be equal to the genesis time (since there's no votes to compute the median). |
| LastBlockID | [BlockID](#blockid) | BlockID of the previous block. | Must adhere to the validation rules of [blockID](#blockid). The first block has `block.Header.LastBlockID == BlockID{}`. |
| LastCommitHash | slice of bytes (`[]byte`) | MerkleRoot of the lastCommit's signatures. The signatures represent the validators that committed to the last block. The first block has an empty slices of bytes for the hash. | Must be of length 32 |
@ -179,7 +179,7 @@ Commit is a simple wrapper for a list of signatures, with one for each validator
| Name | Type | Description | Validation |
|------------|----------------------------------|----------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|
| Height | int64 | Height at which this commit was created. | Must be > 0 |
| Height | uint64 | Height at which this commit was created. | Must be > 0 |
| Round | int32 | Round that the commit corresponds to. | Must be > 0 |
| BlockID | [BlockID](#blockid) | The blockID of the corresponding block. | Must adhere to the validation rules of [BlockID](#blockid). |
| Signatures | Array of [CommitSig](#commitsig) | Array of commit signatures that correspond to current validator set. | Length of signatures must be > 0 and adhere to the validation of each individual [Commitsig](#commitsig) |
@ -221,7 +221,7 @@ The vote includes information about the validator signing it. When stored in the
| Name | Type | Description | Validation |
|------------------|---------------------------------|---------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| Type | [SignedMsgType](#signedmsgtype) | Either prevote or precommit. [SignedMsgType](#signedmsgtype) | A Vote is valid if its corresponding fields are included in the enum [signedMsgType](#signedmsgtype) |
| Height | int64 | Height for which this vote was created for | Must be > 0 |
| Height | uint64 | Height for which this vote was created for | Must be > 0 |
| Round | int32 | Round that the commit corresponds to. | Must be > 0 |
| BlockID | [BlockID](#blockid) | The blockID of the corresponding block. | [BlockID](#blockid) |
| Timestamp | [Time](#Time) | Timestamp represents the time at which a validator signed. | [Time](#time) |
@ -237,7 +237,7 @@ the fields.
```proto
message CanonicalVote {
SignedMsgType type = 1;
sfixed64 height = 2;
fixed64 height = 2;
sfixed64 round = 3;
CanonicalBlockID block_id = 4;
google.protobuf.Timestamp timestamp = 5;
@ -275,7 +275,7 @@ is locked in POLRound. The message is signed by the validator private key.
| Name | Type | Description | Validation |
|-----------|---------------------------------|---------------------------------------------------------------------------------------|---------------------------------------------------------|
| Type | [SignedMsgType](#signedmsgtype) | Represents a Proposal [SignedMsgType](#signedmsgtype) | Must be `ProposalType` [signedMsgType](#signedmsgtype) |
| Height | int64 | Height for which this vote was created for | Must be > 0 |
| Height | uint64 | Height for which this vote was created for | Must be > 0 |
| Round | int32 | Round that the commit corresponds to. | Must be > 0 |
| POLRound | int64 | Proof of lock | Must be > 0 |
| BlockID | [BlockID](#blockid) | The blockID of the corresponding block. | [BlockID](#blockid) |


Loading…
Cancel
Save