Skip to content

Commit

Permalink
chore: regenerate proto
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-forbes committed Jun 9, 2023
1 parent 0b9f494 commit 01790eb
Show file tree
Hide file tree
Showing 9 changed files with 543 additions and 625 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ linters:
- misspell
- nakedret
- nolintlint
- staticcheck
# - staticcheck disabling due to the sheer number of "this package has been moved to it's own module" errors TODO: reenable
- stylecheck
- typecheck
- unconvert
Expand Down
8 changes: 5 additions & 3 deletions proto/tendermint/types/block.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";

import "gogoproto/gogo.proto";
import "tendermint/types/types.proto";
import "tendermint/types/evidence.proto";

message Block {
Header header = 1 [(gogoproto.nullable) = false];
Data data = 2 [(gogoproto.nullable) = false];
Commit last_commit = 4;
Header header = 1 [(gogoproto.nullable) = false];
Data data = 2 [(gogoproto.nullable) = false];
tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false];
Commit last_commit = 4;
}
38 changes: 38 additions & 0 deletions proto/tendermint/types/evidence.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
syntax = "proto3";
package tendermint.types;

option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";

import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
import "tendermint/types/types.proto";
import "tendermint/types/validator.proto";

message Evidence {
oneof sum {
DuplicateVoteEvidence duplicate_vote_evidence = 1;
LightClientAttackEvidence light_client_attack_evidence = 2;
}
}

// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes.
message DuplicateVoteEvidence {
tendermint.types.Vote vote_a = 1;
tendermint.types.Vote vote_b = 2;
int64 total_voting_power = 3;
int64 validator_power = 4;
google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
}

// 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;
repeated tendermint.types.Validator byzantine_validators = 3;
int64 total_voting_power = 4;
google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
}

message EvidenceList {
repeated Evidence evidence = 1 [(gogoproto.nullable) = false];
}
98 changes: 3 additions & 95 deletions proto/tendermint/types/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -87,68 +87,6 @@ message Data {
// NOTE: not all txs here are valid. We're just agreeing on the order first.
// This means that block.AppHash does not include these txs.
repeated bytes txs = 1;

// field number 2 is reserved for intermediate state roots
EvidenceList evidence = 3 [(gogoproto.nullable) = false];
Messages messages = 4 [(gogoproto.nullable) = false];
uint64 original_square_size = 5;
bytes hash = 6;
}

// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes.
message DuplicateVoteEvidence {
tendermint.types.Vote vote_a = 1;
tendermint.types.Vote vote_b = 2;
int64 total_voting_power = 3;
int64 validator_power = 4;
google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
}

// 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;
repeated tendermint.types.Validator byzantine_validators = 3;
int64 total_voting_power = 4;
google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
}

message Evidence {
oneof sum {
DuplicateVoteEvidence duplicate_vote_evidence = 1;
LightClientAttackEvidence light_client_attack_evidence = 2;
}
}

// EvidenceData contains any evidence of malicious wrong-doing by validators
message EvidenceList {
repeated Evidence evidence = 1 [(gogoproto.nullable) = false];
}

message Messages {
repeated Message messages_list = 1;
}

message Message {
bytes namespace_id = 1;
bytes data = 2;
}

// DataAvailabilityHeader contains the row and column roots of the erasure
// coded version of the data in Block.Data.
// Therefor the original Block.Data is arranged in a
// k × k matrix, which is then "extended" to a
// 2k × 2k matrix applying multiple times Reed-Solomon encoding.
// For details see Section 5.2: https://arxiv.org/abs/1809.09044
// or the Celestia specification:
// https://github.com/celestiaorg/celestia-specs/blob/master/specs/data_structures.md#availabledataheader
// Note that currently we list row and column roots in separate fields
// (different from the spec).
message DataAvailabilityHeader {
// RowRoot_j = root((M_{j,1} || M_{j,2} || ... || M_{j,2k} ))
repeated bytes row_roots = 1;
// ColumnRoot_j = root((M_{1,j} || M_{2,j} || ... || M_{2k,j} ))
repeated bytes column_roots = 2;
}

// Vote represents a prevote, precommit, or commit vote from validators for
Expand Down Expand Up @@ -213,37 +151,7 @@ message BlockMeta {

// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
message TxProof {
repeated bytes row_roots = 1;
repeated bytes data = 2;
repeated NMTProof proofs = 3;
}

// MalleatedTx wraps a transaction that was derived from a different original
// transaction. This allows for tendermint to track malleated and original
// transactions
message MalleatedTx {
bytes original_tx_hash = 1;
bytes tx = 2;
}

// Proof represents proof of a namespace.ID in an NMT.
// In case this proof proves the absence of a namespace.ID
// in a tree it also contains the leaf hashes of the range
// where that namespace would be.
message NMTProof {
// start index of this proof.
int32 start = 1;
// end index of this proof.
int32 end = 2;
// Nodes that together with the corresponding leaf values can be used to
// recompute the root and verify this proof. Nodes should consist of the max
// and min namespaces along with the actual hash, resulting in each being 48
// bytes each
repeated bytes nodes = 3;
// leafHash are nil if the namespace is present in the NMT. In case the
// namespace to be proved is in the min/max range of the tree but absent, this
// will contain the leaf hash necessary to verify the proof of absence. Leaf
// hashes should consist of the namespace along with the actual hash,
// resulting 40 bytes total.
bytes leaf_hash = 4;
bytes root_hash = 1;
bytes data = 2;
tendermint.crypto.Proof proof = 3;
}
4 changes: 2 additions & 2 deletions testutil/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
// GetRequest defines a wrapper around an HTTP GET request with a provided URL.
// An error is returned if the request or reading the body fails.
func GetRequest(url string) ([]byte, error) {
res, err := http.Get(url) // nolint:gosec
res, err := http.Get(url) //nolint:gosec
if err != nil {
return nil, err
}
Expand All @@ -31,7 +31,7 @@ func GetRequest(url string) ([]byte, error) {
// PostRequest defines a wrapper around an HTTP POST request with a provided URL and data.
// An error is returned if the request or reading the body fails.
func PostRequest(url string, contentType string, data []byte) ([]byte, error) {
res, err := http.Post(url, contentType, bytes.NewBuffer(data)) // nolint:gosec
res, err := http.Post(url, contentType, bytes.NewBuffer(data)) //nolint:gosec
if err != nil {
return nil, fmt.Errorf("error while sending post request: %w", err)
}
Expand Down
16 changes: 8 additions & 8 deletions types/query/pagination.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions x/distribution/types/distribution.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions x/group/types.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 01790eb

Please sign in to comment.