Skip to content

Commit

Permalink
tendermint: update sdk to rc5 (#7527)
Browse files Browse the repository at this point in the history
* update sdk to rc5

* Update baseapp/params.go

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
  • Loading branch information
tac0turtle and alexanderbez authored Oct 14, 2020
1 parent 36c1b24 commit 2323f1a
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ proto-check-breaking-docker:
@$(DOCKER_BUF) check breaking --against-input $(HTTPS_GIT)#branch=master
.PHONY: proto-check-breaking-ci

TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/3359e0bf2f8414d9687f9eecda67b899d64a9cd1/proto/tendermint
TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.0-rc5/proto/tendermint
GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master
CONFIO_URL = https://raw.githubusercontent.com/confio/ics23/v0.6.2
Expand Down
4 changes: 2 additions & 2 deletions baseapp/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ func ValidateEvidenceParams(i interface{}) error {
return fmt.Errorf("evidence maximum age time duration must be positive: %v", v.MaxAgeDuration)
}

if v.MaxNum <= 0 {
return fmt.Errorf("evidence maximum number of evidence must be positive: %v", v.MaxNum)
if v.MaxBytes < 0 {
return fmt.Errorf("maximum evidence bytes must be positive: %v", v.MaxBytes)
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions baseapp/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func TestValidateEvidenceParams(t *testing.T) {
{nil, true},
{&tmproto.EvidenceParams{}, true},
{tmproto.EvidenceParams{}, true},
{tmproto.EvidenceParams{MaxAgeNumBlocks: -1, MaxAgeDuration: 18004000, MaxNum: 50}, true},
{tmproto.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: 18004000, MaxNum: 50}, false},
{tmproto.EvidenceParams{MaxAgeNumBlocks: -1, MaxAgeDuration: 18004000, MaxBytes: 5000000}, true},
{tmproto.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: 18004000, MaxBytes: 5000000}, false},
}

for _, tc := range testCases {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ require (
github.com/tendermint/btcd v0.1.1
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15
github.com/tendermint/go-amino v0.16.0
github.com/tendermint/tendermint v0.34.0-rc4.0.20201005135527-d7d0ffea13c6
github.com/tendermint/tendermint v0.34.0-rc5
github.com/tendermint/tm-db v0.6.2
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a
golang.org/x/net v0.0.0-20200930145003-4acb6c075d10 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,8 @@ github.com/tendermint/tendermint v0.34.0-rc3 h1:d7Fsd5rdbxq4GmJ0kRfx7l7LesQM7e70
github.com/tendermint/tendermint v0.34.0-rc3/go.mod h1:BoHcEpjfpBHc1Be7RQz3AHaXFNObcDG7SNHCev6Or4g=
github.com/tendermint/tendermint v0.34.0-rc4.0.20201005135527-d7d0ffea13c6 h1:gqZ0WDpDYgMm/iaiMEXvI1nt/GoWCuwtBomVpUMiAIs=
github.com/tendermint/tendermint v0.34.0-rc4.0.20201005135527-d7d0ffea13c6/go.mod h1:BSXqR6vWbOecet726v66qVwSkFDLfEeBrq+EhkKbij4=
github.com/tendermint/tendermint v0.34.0-rc5 h1:2bnQfWyOMfTCbol5pwB8CgM2nxi6/Kz6zqlS6Udm/Cg=
github.com/tendermint/tendermint v0.34.0-rc5/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4=
github.com/tendermint/tm-db v0.6.1 h1:w3X87itMPXopcRPlFiqspEKhw4FXihPk2rnFFkP0zGk=
github.com/tendermint/tm-db v0.6.1/go.mod h1:m3x9kRP4UFd7JODJL0yBAZqE7wTw+S37uAE90cTx7OA=
github.com/tendermint/tm-db v0.6.2 h1:DOn8jwCdjJblrCFJbtonEIPD1IuJWpbRUUdR8GWE4RM=
Expand Down
2 changes: 1 addition & 1 deletion server/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func ExportCmd(appExporter types.AppExporter, defaultNodeHome string) *cobra.Com
Evidence: tmproto.EvidenceParams{
MaxAgeNumBlocks: exported.ConsensusParams.Evidence.MaxAgeNumBlocks,
MaxAgeDuration: exported.ConsensusParams.Evidence.MaxAgeDuration,
MaxNum: exported.ConsensusParams.Evidence.MaxNum,
MaxBytes: exported.ConsensusParams.Evidence.MaxBytes,
},
Validator: tmproto.ValidatorParams{
PubKeyTypes: exported.ConsensusParams.Validator.PubKeyTypes,
Expand Down
2 changes: 1 addition & 1 deletion simapp/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var DefaultConsensusParams = &abci.ConsensusParams{
Evidence: &tmproto.EvidenceParams{
MaxAgeNumBlocks: 302400,
MaxAgeDuration: 504 * time.Hour, // 3 weeks is the max duration
MaxNum: 50,
MaxBytes: 10000,
},
Validator: &tmproto.ValidatorParams{
PubKeyTypes: []string{
Expand Down
1 change: 0 additions & 1 deletion third_party/proto/confio/proofs.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
syntax = "proto3";

package ics23;
option go_package = "github.com/confio/ics23/go";

enum HashOp {
// NO_HASH is the default if no data passed. Note this is an illegal argument some places.
Expand Down
20 changes: 10 additions & 10 deletions third_party/proto/tendermint/abci/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,9 @@ message TxResult {

// Validator
message Validator {
bytes address = 1; // The first 20 bytes of SHA256(public key)
bytes address = 1; // The first 20 bytes of SHA256(public key)
// PubKey pub_key = 2 [(gogoproto.nullable)=false];
int64 power = 3; // The voting power
int64 power = 3; // The voting power
}

// ValidatorUpdate
Expand All @@ -352,19 +352,19 @@ message VoteInfo {
}

enum EvidenceType {
UNKNOWN = 0;
DUPLICATE_VOTE = 1;
LIGHT_CLIENT_ATTACK = 2;
UNKNOWN = 0;
DUPLICATE_VOTE = 1;
LIGHT_CLIENT_ATTACK = 2;
}

message Evidence {
EvidenceType type = 1;
EvidenceType type = 1;
// The offending validator
Validator validator = 2 [(gogoproto.nullable) = false];
// The height when the offense occurred
int64 height = 3;
Validator validator = 2 [(gogoproto.nullable) = false];
// The height when the offense occurred
int64 height = 3;
// The corresponding time where the offense occurred
google.protobuf.Timestamp time = 4 [
google.protobuf.Timestamp time = 4 [
(gogoproto.nullable) = false,
(gogoproto.stdtime) = true
];
Expand Down
12 changes: 6 additions & 6 deletions third_party/proto/tendermint/types/evidence.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ 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/crypto/keys.proto";

// DuplicateVoteEvidence contains evidence a validator signed two conflicting
// votes.
message DuplicateVoteEvidence {
Vote vote_a = 1;
Vote vote_b = 2;
}

google.protobuf.Timestamp timestamp = 3
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
message LightClientAttackEvidence {
LightBlock conflicting_block = 1;
int64 common_height = 2;
}

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

// EvidenceData contains any evidence of malicious wrong-doing by validators
message EvidenceData {
repeated Evidence evidence = 1 [(gogoproto.nullable) = false];
bytes hash = 2;
}
9 changes: 4 additions & 5 deletions third_party/proto/tendermint/types/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ message EvidenceParams {
google.protobuf.Duration max_age_duration = 2
[(gogoproto.nullable) = false, (gogoproto.stdduration) = true];

// This sets the maximum number of evidence that can be committed in a single block.
// and should fall comfortably under the max block bytes when we consider the size of
// each evidence (See MaxEvidenceBytes). The maximum number is MaxEvidencePerBlock.
// Default is 50
uint32 max_num = 3;
// This sets the maximum size of total evidence in bytes that can be committed in a single block.
// and should fall comfortably under the max block bytes.
// Default is 1048576 or 1MB
int64 max_bytes = 3;
}

// ValidatorParams restrict the public key types validators can use.
Expand Down
11 changes: 3 additions & 8 deletions third_party/proto/tendermint/types/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";

import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
import "tendermint/libs/bits/types.proto";
import "tendermint/crypto/proof.proto";
import "tendermint/version/types.proto";
import "tendermint/types/validator.proto";
Expand All @@ -26,13 +25,13 @@ enum SignedMsgType {
option (gogoproto.goproto_enum_stringer) = true;
option (gogoproto.goproto_enum_prefix) = false;

SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"];
SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"];
// Votes
SIGNED_MSG_TYPE_PREVOTE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"];
SIGNED_MSG_TYPE_PRECOMMIT = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"];

// Proposals
SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"];
SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"];
}

// PartsetHeader
Expand Down Expand Up @@ -88,8 +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;
// Volatile
bytes hash = 2;
}

// Vote represents a prevote, precommit, or commit vote from validators for
Expand All @@ -113,8 +110,6 @@ message Commit {
int32 round = 2;
BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"];
repeated CommitSig signatures = 4 [(gogoproto.nullable) = false];
bytes hash = 5;
tendermint.libs.bits.BitArray bit_array = 6;
}

// CommitSig is a part of the Vote included in a Commit.
Expand Down Expand Up @@ -144,7 +139,7 @@ message SignedHeader {

message LightBlock {
SignedHeader signed_header = 1;
tendermint.types.ValidatorSet validator_set = 2;
tendermint.types.ValidatorSet validator_set = 2;
}

message BlockMeta {
Expand Down

0 comments on commit 2323f1a

Please sign in to comment.