Merge branch 'main' into wb/final-metric-impl

This commit is contained in:
William Banfield
2022-10-25 14:09:49 -04:00
committed by GitHub
36 changed files with 366 additions and 206 deletions
+1 -1
View File
@@ -271,7 +271,7 @@ format:
lint:
@echo "--> Running linter"
@golangci-lint run
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run
.PHONY: lint
DESTINATION = ./index.html.md
+18 -17
View File
@@ -7,9 +7,10 @@ import (
context "context"
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
_ "github.com/cosmos/gogoproto/types"
proto "github.com/gogo/protobuf/proto"
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
crypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
types1 "github.com/tendermint/tendermint/proto/tendermint/types"
grpc "google.golang.org/grpc"
@@ -3681,10 +3682,10 @@ type ABCIApplicationClient interface {
}
type aBCIApplicationClient struct {
cc *grpc.ClientConn
cc grpc1.ClientConn
}
func NewABCIApplicationClient(cc *grpc.ClientConn) ABCIApplicationClient {
func NewABCIApplicationClient(cc grpc1.ClientConn) ABCIApplicationClient {
return &aBCIApplicationClient{cc}
}
@@ -3905,7 +3906,7 @@ func (*UnimplementedABCIApplicationServer) ProcessProposal(ctx context.Context,
return nil, status.Errorf(codes.Unimplemented, "method ProcessProposal not implemented")
}
func RegisterABCIApplicationServer(s *grpc.Server, srv ABCIApplicationServer) {
func RegisterABCIApplicationServer(s grpc1.Server, srv ABCIApplicationServer) {
s.RegisterService(&_ABCIApplication_serviceDesc, srv)
}
@@ -4807,7 +4808,7 @@ func (m *RequestInitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x12
}
n18, err18 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):])
n18, err18 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):])
if err18 != nil {
return 0, err18
}
@@ -5229,7 +5230,7 @@ func (m *RequestPrepareProposal) MarshalToSizedBuffer(dAtA []byte) (int, error)
i--
dAtA[i] = 0x3a
}
n22, err22 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):])
n22, err22 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):])
if err22 != nil {
return 0, err22
}
@@ -5317,7 +5318,7 @@ func (m *RequestProcessProposal) MarshalToSizedBuffer(dAtA []byte) (int, error)
i--
dAtA[i] = 0x3a
}
n24, err24 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):])
n24, err24 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):])
if err24 != nil {
return 0, err24
}
@@ -6986,7 +6987,7 @@ func (m *Misbehavior) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x28
}
n52, err52 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):])
n52, err52 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):])
if err52 != nil {
return 0, err52
}
@@ -7335,7 +7336,7 @@ func (m *RequestInitChain) Size() (n int) {
}
var l int
_ = l
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time)
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time)
n += 1 + l + sovTypes(uint64(l))
l = len(m.ChainId)
if l > 0 {
@@ -7547,7 +7548,7 @@ func (m *RequestPrepareProposal) Size() (n int) {
if m.Height != 0 {
n += 1 + sovTypes(uint64(m.Height))
}
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time)
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time)
n += 1 + l + sovTypes(uint64(l))
l = len(m.NextValidatorsHash)
if l > 0 {
@@ -7587,7 +7588,7 @@ func (m *RequestProcessProposal) Size() (n int) {
if m.Height != 0 {
n += 1 + sovTypes(uint64(m.Height))
}
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time)
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time)
n += 1 + l + sovTypes(uint64(l))
l = len(m.NextValidatorsHash)
if l > 0 {
@@ -8354,7 +8355,7 @@ func (m *Misbehavior) Size() (n int) {
if m.Height != 0 {
n += 1 + sovTypes(uint64(m.Height))
}
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time)
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time)
n += 1 + l + sovTypes(uint64(l))
if m.TotalVotingPower != 0 {
n += 1 + sovTypes(uint64(m.TotalVotingPower))
@@ -9346,7 +9347,7 @@ func (m *RequestInitChain) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -10778,7 +10779,7 @@ func (m *RequestPrepareProposal) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -11081,7 +11082,7 @@ func (m *RequestProcessProposal) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -15396,7 +15397,7 @@ func (m *Misbehavior) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
+3 -3
View File
@@ -3,7 +3,7 @@ module github.com/tendermint/tendermint
go 1.18
require (
github.com/BurntSushi/toml v1.2.0
github.com/BurntSushi/toml v1.2.1
github.com/adlio/schema v1.3.3
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/fortytw2/leaktest v1.3.0
@@ -30,7 +30,7 @@ require (
github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa
github.com/spf13/cobra v1.6.0
github.com/spf13/viper v1.13.0
github.com/stretchr/testify v1.8.0
github.com/stretchr/testify v1.8.1
github.com/tendermint/tm-db v0.6.6
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa
golang.org/x/net v0.0.0-20220812174116-3211cb980234
@@ -226,7 +226,7 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect
github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect
github.com/stretchr/objx v0.4.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/sylvia7788/contextcheck v1.0.6 // indirect
github.com/tdakkota/asciicheck v0.1.1 // indirect
+6 -4
View File
@@ -53,8 +53,8 @@ github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0=
github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
@@ -1069,8 +1069,9 @@ github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5J
github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
@@ -1079,8 +1080,9 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs=
github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
+1 -1
View File
@@ -5,7 +5,7 @@ package blocksync
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
types "github.com/tendermint/tendermint/proto/tendermint/types"
io "io"
math "math"
+1 -1
View File
@@ -6,7 +6,7 @@ package consensus
import (
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
bits "github.com/tendermint/tendermint/proto/tendermint/libs/bits"
types "github.com/tendermint/tendermint/proto/tendermint/types"
io "io"
+8 -8
View File
@@ -6,9 +6,9 @@ package consensus
import (
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
_ "github.com/cosmos/gogoproto/types"
proto "github.com/gogo/protobuf/proto"
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
_ "github.com/golang/protobuf/ptypes/duration"
types "github.com/tendermint/tendermint/proto/tendermint/types"
io "io"
@@ -484,7 +484,7 @@ func (m *TimeoutInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x10
}
n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):])
n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration):])
if err2 != nil {
return 0, err2
}
@@ -671,7 +671,7 @@ func (m *TimedWALMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x12
}
n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):])
n8, err8 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):])
if err8 != nil {
return 0, err8
}
@@ -714,7 +714,7 @@ func (m *TimeoutInfo) Size() (n int) {
}
var l int
_ = l
l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration)
l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration)
n += 1 + l + sovWal(uint64(l))
if m.Height != 0 {
n += 1 + sovWal(uint64(m.Height))
@@ -806,7 +806,7 @@ func (m *TimedWALMessage) Size() (n int) {
}
var l int
_ = l
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time)
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time)
n += 1 + l + sovWal(uint64(l))
if m.Msg != nil {
l = m.Msg.Size()
@@ -994,7 +994,7 @@ func (m *TimeoutInfo) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -1393,7 +1393,7 @@ func (m *TimedWALMessage) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
+1 -1
View File
@@ -7,7 +7,7 @@ import (
bytes "bytes"
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
+1 -1
View File
@@ -6,7 +6,7 @@ package crypto
import (
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
+1 -1
View File
@@ -5,7 +5,7 @@ package bits
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
+1 -1
View File
@@ -5,7 +5,7 @@ package mempool
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
+1 -1
View File
@@ -6,7 +6,7 @@ package p2p
import (
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
crypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
io "io"
math "math"
+1 -1
View File
@@ -6,7 +6,7 @@ package p2p
import (
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
+1 -1
View File
@@ -6,7 +6,7 @@ package p2p
import (
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
+1 -1
View File
@@ -6,7 +6,7 @@ package privval
import (
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
crypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
types "github.com/tendermint/tendermint/proto/tendermint/types"
io "io"
+5 -4
View File
@@ -6,7 +6,8 @@ package coregrpc
import (
context "context"
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
types "github.com/tendermint/tendermint/abci/types"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -245,10 +246,10 @@ type BroadcastAPIClient interface {
}
type broadcastAPIClient struct {
cc *grpc.ClientConn
cc grpc1.ClientConn
}
func NewBroadcastAPIClient(cc *grpc.ClientConn) BroadcastAPIClient {
func NewBroadcastAPIClient(cc grpc1.ClientConn) BroadcastAPIClient {
return &broadcastAPIClient{cc}
}
@@ -287,7 +288,7 @@ func (*UnimplementedBroadcastAPIServer) BroadcastTx(ctx context.Context, req *Re
return nil, status.Errorf(codes.Unimplemented, "method BroadcastTx not implemented")
}
func RegisterBroadcastAPIServer(s *grpc.Server, srv BroadcastAPIServer) {
func RegisterBroadcastAPIServer(s grpc1.Server, srv BroadcastAPIServer) {
s.RegisterService(&_BroadcastAPI_serviceDesc, srv)
}
+5 -5
View File
@@ -6,9 +6,9 @@ package state
import (
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
_ "github.com/cosmos/gogoproto/types"
proto "github.com/gogo/protobuf/proto"
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
types "github.com/tendermint/tendermint/abci/types"
types1 "github.com/tendermint/tendermint/proto/tendermint/types"
version "github.com/tendermint/tendermint/proto/tendermint/version"
@@ -843,7 +843,7 @@ func (m *State) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x32
}
n11, err11 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastBlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastBlockTime):])
n11, err11 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.LastBlockTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastBlockTime):])
if err11 != nil {
return 0, err11
}
@@ -998,7 +998,7 @@ func (m *State) Size() (n int) {
}
l = m.LastBlockID.Size()
n += 1 + l + sovTypes(uint64(l))
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastBlockTime)
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastBlockTime)
n += 1 + l + sovTypes(uint64(l))
if m.NextValidators != nil {
l = m.NextValidators.Size()
@@ -1798,7 +1798,7 @@ func (m *State) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LastBlockTime, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.LastBlockTime, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
+1 -1
View File
@@ -5,7 +5,7 @@ package statesync
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
+1 -1
View File
@@ -5,7 +5,7 @@ package store
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
+1 -1
View File
@@ -6,7 +6,7 @@ package types
import (
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
+8 -8
View File
@@ -7,9 +7,9 @@ import (
encoding_binary "encoding/binary"
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
_ "github.com/cosmos/gogoproto/types"
proto "github.com/gogo/protobuf/proto"
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
io "io"
math "math"
math_bits "math/bits"
@@ -454,7 +454,7 @@ func (m *CanonicalProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x3a
}
n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp):])
if err2 != nil {
return 0, err2
}
@@ -526,7 +526,7 @@ func (m *CanonicalVote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x32
}
n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp):])
if err4 != nil {
return 0, err4
}
@@ -630,7 +630,7 @@ func (m *CanonicalProposal) Size() (n int) {
l = m.BlockID.Size()
n += 1 + l + sovCanonical(uint64(l))
}
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp)
n += 1 + l + sovCanonical(uint64(l))
l = len(m.ChainID)
if l > 0 {
@@ -658,7 +658,7 @@ func (m *CanonicalVote) Size() (n int) {
l = m.BlockID.Size()
n += 1 + l + sovCanonical(uint64(l))
}
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp)
n += 1 + l + sovCanonical(uint64(l))
l = len(m.ChainID)
if l > 0 {
@@ -1045,7 +1045,7 @@ func (m *CanonicalProposal) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -1235,7 +1235,7 @@ func (m *CanonicalVote) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
+1 -1
View File
@@ -5,7 +5,7 @@ package types
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
+8 -8
View File
@@ -6,9 +6,9 @@ package types
import (
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
_ "github.com/cosmos/gogoproto/types"
proto "github.com/gogo/protobuf/proto"
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
io "io"
math "math"
math_bits "math/bits"
@@ -451,7 +451,7 @@ func (m *DuplicateVoteEvidence) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp):])
if err3 != nil {
return 0, err3
}
@@ -516,7 +516,7 @@ func (m *LightClientAttackEvidence) MarshalToSizedBuffer(dAtA []byte) (int, erro
_ = i
var l int
_ = l
n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp):])
if err6 != nil {
return 0, err6
}
@@ -667,7 +667,7 @@ func (m *DuplicateVoteEvidence) Size() (n int) {
if m.ValidatorPower != 0 {
n += 1 + sovEvidence(uint64(m.ValidatorPower))
}
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp)
n += 1 + l + sovEvidence(uint64(l))
return n
}
@@ -694,7 +694,7 @@ func (m *LightClientAttackEvidence) Size() (n int) {
if m.TotalVotingPower != 0 {
n += 1 + sovEvidence(uint64(m.TotalVotingPower))
}
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp)
n += 1 + l + sovEvidence(uint64(l))
return n
}
@@ -1008,7 +1008,7 @@ func (m *DuplicateVoteEvidence) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -1199,7 +1199,7 @@ func (m *LightClientAttackEvidence) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
+5 -5
View File
@@ -6,8 +6,8 @@ package types
import (
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/gogo/protobuf/proto"
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
proto "github.com/cosmos/gogoproto/proto"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
_ "github.com/golang/protobuf/ptypes/duration"
io "io"
math "math"
@@ -720,7 +720,7 @@ func (m *EvidenceParams) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x18
}
n5, err5 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxAgeDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxAgeDuration):])
n5, err5 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.MaxAgeDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MaxAgeDuration):])
if err5 != nil {
return 0, err5
}
@@ -981,7 +981,7 @@ func (m *EvidenceParams) Size() (n int) {
if m.MaxAgeNumBlocks != 0 {
n += 1 + sovParams(uint64(m.MaxAgeNumBlocks))
}
l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxAgeDuration)
l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MaxAgeDuration)
n += 1 + l + sovParams(uint64(l))
if m.MaxBytes != 0 {
n += 1 + sovParams(uint64(m.MaxBytes))
@@ -1396,7 +1396,7 @@ func (m *EvidenceParams) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.MaxAgeDuration, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.MaxAgeDuration, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
+14 -14
View File
@@ -6,9 +6,9 @@ package types
import (
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
_ "github.com/cosmos/gogoproto/types"
proto "github.com/gogo/protobuf/proto"
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
crypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
version "github.com/tendermint/tendermint/proto/tendermint/version"
io "io"
@@ -1348,7 +1348,7 @@ func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) {
}
i--
dAtA[i] = 0x2a
n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):])
n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):])
if err4 != nil {
return 0, err4
}
@@ -1452,7 +1452,7 @@ func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x32
}
n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp):])
if err6 != nil {
return 0, err6
}
@@ -1572,7 +1572,7 @@ func (m *CommitSig) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x22
}
n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
n9, err9 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp):])
if err9 != nil {
return 0, err9
}
@@ -1622,7 +1622,7 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x3a
}
n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
n10, err10 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp):])
if err10 != nil {
return 0, err10
}
@@ -1934,7 +1934,7 @@ func (m *Header) Size() (n int) {
if m.Height != 0 {
n += 1 + sovTypes(uint64(m.Height))
}
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time)
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time)
n += 1 + l + sovTypes(uint64(l))
l = m.LastBlockId.Size()
n += 1 + l + sovTypes(uint64(l))
@@ -2009,7 +2009,7 @@ func (m *Vote) Size() (n int) {
}
l = m.BlockID.Size()
n += 1 + l + sovTypes(uint64(l))
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp)
n += 1 + l + sovTypes(uint64(l))
l = len(m.ValidatorAddress)
if l > 0 {
@@ -2061,7 +2061,7 @@ func (m *CommitSig) Size() (n int) {
if l > 0 {
n += 1 + l + sovTypes(uint64(l))
}
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp)
n += 1 + l + sovTypes(uint64(l))
l = len(m.Signature)
if l > 0 {
@@ -2090,7 +2090,7 @@ func (m *Proposal) Size() (n int) {
}
l = m.BlockID.Size()
n += 1 + l + sovTypes(uint64(l))
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp)
n += 1 + l + sovTypes(uint64(l))
l = len(m.Signature)
if l > 0 {
@@ -2677,7 +2677,7 @@ func (m *Header) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -3271,7 +3271,7 @@ func (m *Vote) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -3649,7 +3649,7 @@ func (m *CommitSig) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -3875,7 +3875,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
+1 -1
View File
@@ -6,7 +6,7 @@ package types
import (
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
crypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
io "io"
math "math"
+1 -1
View File
@@ -6,7 +6,7 @@ package version
import (
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/gogo/protobuf/proto"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
+5 -4
View File
@@ -6,7 +6,8 @@ package coregrpc
import (
context "context"
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
types "github.com/tendermint/tendermint/abci/types"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -245,10 +246,10 @@ type BroadcastAPIClient interface {
}
type broadcastAPIClient struct {
cc *grpc.ClientConn
cc grpc1.ClientConn
}
func NewBroadcastAPIClient(cc *grpc.ClientConn) BroadcastAPIClient {
func NewBroadcastAPIClient(cc grpc1.ClientConn) BroadcastAPIClient {
return &broadcastAPIClient{cc}
}
@@ -287,7 +288,7 @@ func (*UnimplementedBroadcastAPIServer) BroadcastTx(ctx context.Context, req *Re
return nil, status.Errorf(codes.Unimplemented, "method BroadcastTx not implemented")
}
func RegisterBroadcastAPIServer(s *grpc.Server, srv BroadcastAPIServer) {
func RegisterBroadcastAPIServer(s grpc1.Server, srv BroadcastAPIServer) {
s.RegisterService(&_BroadcastAPI_serviceDesc, srv)
}
-1
View File
@@ -23,7 +23,6 @@ type Config struct {
PrivValServer string `toml:"privval_server"`
PrivValKey string `toml:"privval_key"`
PrivValState string `toml:"privval_state"`
Misbehaviors map[string]string `toml:"misbehaviors"`
KeyType string `toml:"key_type"`
}
+85
View File
@@ -0,0 +1,85 @@
package docker
import (
"bytes"
"os"
"path/filepath"
"text/template"
e2e "github.com/tendermint/tendermint/test/e2e/pkg"
"github.com/tendermint/tendermint/test/e2e/pkg/infra"
)
var _ infra.Provider = &Provider{}
// Provider implements a docker-compose backed infrastructure provider.
type Provider struct {
Testnet *e2e.Testnet
}
// Setup generates the docker-compose file and write it to disk, erroring if
// any of these operations fail.
func (p *Provider) Setup() error {
compose, err := dockerComposeBytes(p.Testnet)
if err != nil {
return err
}
//nolint: gosec
// G306: Expect WriteFile permissions to be 0600 or less
err = os.WriteFile(filepath.Join(p.Testnet.Dir, "docker-compose.yml"), compose, 0644)
if err != nil {
return err
}
return nil
}
// dockerComposeBytes generates a Docker Compose config file for a testnet and returns the
// file as bytes to be written out to disk.
func dockerComposeBytes(testnet *e2e.Testnet) ([]byte, error) {
// Must use version 2 Docker Compose format, to support IPv6.
tmpl, err := template.New("docker-compose").Parse(`version: '2.4'
networks:
{{ .Name }}:
labels:
e2e: true
driver: bridge
{{- if .IPv6 }}
enable_ipv6: true
{{- end }}
ipam:
driver: default
config:
- subnet: {{ .IP }}
services:
{{- range .Nodes }}
{{ .Name }}:
labels:
e2e: true
container_name: {{ .Name }}
image: tendermint/e2e-node
{{- if eq .ABCIProtocol "builtin" }}
entrypoint: /usr/bin/entrypoint-builtin
{{- end }}
init: true
ports:
- 26656
- {{ if .ProxyPort }}{{ .ProxyPort }}:{{ end }}26657
- 6060
volumes:
- ./{{ .Name }}:/tendermint
networks:
{{ $.Name }}:
ipv{{ if $.IPv6 }}6{{ else }}4{{ end}}_address: {{ .IP }}
{{end}}`)
if err != nil {
return nil, err
}
var buf bytes.Buffer
err = tmpl.Execute(&buf, testnet)
if err != nil {
return nil, err
}
return buf.Bytes(), nil
}
+20
View File
@@ -0,0 +1,20 @@
package infra
// Provider defines an API for manipulating the infrastructure of a
// specific set of testnet infrastructure.
type Provider interface {
// Setup generates any necessary configuration for the infrastructure
// provider during testnet setup.
Setup() error
}
// NoopProvider implements the provider interface by performing noops for every
// interface method. This may be useful if the infrastructure is managed by a
// separate process.
type NoopProvider struct {
}
func (NoopProvider) Setup() error { return nil }
var _ Provider = NoopProvider{}
+80
View File
@@ -0,0 +1,80 @@
package e2e
import (
"encoding/json"
"fmt"
"net"
"os"
)
const (
dockerIPv4CIDR = "10.186.73.0/24"
dockerIPv6CIDR = "fd80:b10c::/48"
globalIPv4CIDR = "0.0.0.0/0"
)
// InfrastructureData contains the relevant information for a set of existing
// infrastructure that is to be used for running a testnet.
type InfrastructureData struct {
// Provider is the name of infrastructure provider backing the testnet.
// For example, 'docker' if it is running locally in a docker network or
// 'digital-ocean', 'aws', 'google', etc. if it is from a cloud provider.
Provider string `json:"provider"`
// Instances is a map of all of the machine instances on which to run
// processes for a testnet.
// The key of the map is the name of the instance, which each must correspond
// to the names of one of the testnet nodes defined in the testnet manifest.
Instances map[string]InstanceData `json:"instances"`
// Network is the CIDR notation range of IP addresses that all of the instances'
// IP addresses are expected to be within.
Network string `json:"network"`
}
// InstanceData contains the relevant information for a machine instance backing
// one of the nodes in the testnet.
type InstanceData struct {
IPAddress net.IP `json:"ip_address"`
}
func NewDockerInfrastructureData(m Manifest) (InfrastructureData, error) {
netAddress := dockerIPv4CIDR
if m.IPv6 {
netAddress = dockerIPv6CIDR
}
_, ipNet, err := net.ParseCIDR(netAddress)
if err != nil {
return InfrastructureData{}, fmt.Errorf("invalid IP network address %q: %w", netAddress, err)
}
ipGen := newIPGenerator(ipNet)
ifd := InfrastructureData{
Provider: "docker",
Instances: make(map[string]InstanceData),
Network: netAddress,
}
for name := range m.Nodes {
ifd.Instances[name] = InstanceData{
IPAddress: ipGen.Next(),
}
}
return ifd, nil
}
func InfrastructureDataFromFile(p string) (InfrastructureData, error) {
ifd := InfrastructureData{}
b, err := os.ReadFile(p)
if err != nil {
return InfrastructureData{}, err
}
err = json.Unmarshal(b, &ifd)
if err != nil {
return InfrastructureData{}, err
}
if ifd.Network == "" {
ifd.Network = globalIPv4CIDR
}
return ifd, nil
}
+13 -23
View File
@@ -21,8 +21,6 @@ import (
const (
randomSeed int64 = 2308084734268
proxyPortFirst uint32 = 5701
networkIPv4 = "10.186.73.0/24"
networkIPv6 = "fd80:b10c::/48"
)
type (
@@ -100,32 +98,20 @@ type Node struct {
// The testnet generation must be deterministic, since it is generated
// separately by the runner and the test cases. For this reason, testnets use a
// random seed to generate e.g. keys.
func LoadTestnet(file string) (*Testnet, error) {
manifest, err := LoadManifest(file)
if err != nil {
return nil, err
}
dir := strings.TrimSuffix(file, filepath.Ext(file))
// Set up resource generators. These must be deterministic.
netAddress := networkIPv4
if manifest.IPv6 {
netAddress = networkIPv6
}
_, ipNet, err := net.ParseCIDR(netAddress)
if err != nil {
return nil, fmt.Errorf("invalid IP network address %q: %w", netAddress, err)
}
ipGen := newIPGenerator(ipNet)
func LoadTestnet(manifest Manifest, fname string, ifd InfrastructureData) (*Testnet, error) {
dir := strings.TrimSuffix(fname, filepath.Ext(fname))
keyGen := newKeyGenerator(randomSeed)
proxyPortGen := newPortGenerator(proxyPortFirst)
_, ipNet, err := net.ParseCIDR(ifd.Network)
if err != nil {
return nil, fmt.Errorf("invalid IP network address %q: %w", ifd.Network, err)
}
testnet := &Testnet{
Name: filepath.Base(dir),
File: file,
File: fname,
Dir: dir,
IP: ipGen.Network(),
IP: ipNet,
InitialHeight: 1,
InitialState: manifest.InitialState,
Validators: map[*Node]int64{},
@@ -156,12 +142,16 @@ func LoadTestnet(file string) (*Testnet, error) {
for _, name := range nodeNames {
nodeManifest := manifest.Nodes[name]
ind, ok := ifd.Instances[name]
if !ok {
return nil, fmt.Errorf("information for node '%s' missing from infrastucture data", name)
}
node := &Node{
Name: name,
Testnet: testnet,
PrivvalKey: keyGen.Generate(manifest.KeyType),
NodeKey: keyGen.Generate("ed25519"),
IP: ipGen.Next(),
IP: ind.IPAddress,
ProxyPort: proxyPortGen.Next(),
Mode: ModeValidator,
Database: "goleveldb",
+51 -5
View File
@@ -2,6 +2,7 @@ package main
import (
"context"
"errors"
"fmt"
"math/rand"
"os"
@@ -11,6 +12,8 @@ import (
"github.com/tendermint/tendermint/libs/log"
e2e "github.com/tendermint/tendermint/test/e2e/pkg"
"github.com/tendermint/tendermint/test/e2e/pkg/infra"
"github.com/tendermint/tendermint/test/e2e/pkg/infra/docker"
)
const randomSeed = 2308084734268
@@ -26,6 +29,7 @@ type CLI struct {
root *cobra.Command
testnet *e2e.Testnet
preserve bool
infp infra.Provider
}
// NewCLI sets up the CLI.
@@ -41,19 +45,57 @@ func NewCLI() *CLI {
if err != nil {
return err
}
testnet, err := e2e.LoadTestnet(file)
m, err := e2e.LoadManifest(file)
if err != nil {
return err
}
inft, err := cmd.Flags().GetString("infrastructure-type")
if err != nil {
return err
}
var ifd e2e.InfrastructureData
switch inft {
case "docker":
var err error
ifd, err = e2e.NewDockerInfrastructureData(m)
if err != nil {
return err
}
case "digital-ocean":
p, err := cmd.Flags().GetString("infrastructure-data")
if err != nil {
return err
}
if p == "" {
return errors.New("'--infrastructure-data' must be set when using the 'digital-ocean' infrastructure-type")
}
ifd, err = e2e.InfrastructureDataFromFile(p)
if err != nil {
return fmt.Errorf("parsing infrastructure data: %s", err)
}
default:
return fmt.Errorf("unknown infrastructure type '%s'", inft)
}
testnet, err := e2e.LoadTestnet(m, file, ifd)
if err != nil {
return fmt.Errorf("loading testnet: %s", err)
}
cli.testnet = testnet
cli.infp = &infra.NoopProvider{}
if inft == "docker" {
cli.infp = &docker.Provider{Testnet: testnet}
}
return nil
},
RunE: func(cmd *cobra.Command, args []string) error {
if err := Cleanup(cli.testnet); err != nil {
return err
}
if err := Setup(cli.testnet); err != nil {
if err := Setup(cli.testnet, cli.infp); err != nil {
return err
}
@@ -118,6 +160,10 @@ func NewCLI() *CLI {
cli.root.PersistentFlags().StringP("file", "f", "", "Testnet TOML manifest")
_ = cli.root.MarkPersistentFlagRequired("file")
cli.root.PersistentFlags().StringP("infrastructure-type", "", "docker", "Backing infrastructure used to run the testnet. Either 'digital-ocean' or 'docker'")
cli.root.PersistentFlags().StringP("infrastructure-data", "", "", "path to the json file containing the infrastructure data. Only used if the 'infrastructure-type' is set to a value other than 'docker'")
cli.root.Flags().BoolVarP(&cli.preserve, "preserve", "p", false,
"Preserves the running of the test net after tests are completed")
@@ -125,7 +171,7 @@ func NewCLI() *CLI {
Use: "setup",
Short: "Generates the testnet directory and configuration",
RunE: func(cmd *cobra.Command, args []string) error {
return Setup(cli.testnet)
return Setup(cli.testnet, cli.infp)
},
})
@@ -135,7 +181,7 @@ func NewCLI() *CLI {
RunE: func(cmd *cobra.Command, args []string) error {
_, err := os.Stat(cli.testnet.Dir)
if os.IsNotExist(err) {
err = Setup(cli.testnet)
err = Setup(cli.testnet, cli.infp)
}
if err != nil {
return err
@@ -258,7 +304,7 @@ Does not run any perbutations.
if err := Cleanup(cli.testnet); err != nil {
return err
}
if err := Setup(cli.testnet); err != nil {
if err := Setup(cli.testnet, cli.infp); err != nil {
return err
}
+3 -72
View File
@@ -10,9 +10,7 @@ import (
"path/filepath"
"regexp"
"sort"
"strconv"
"strings"
"text/template"
"time"
"github.com/BurntSushi/toml"
@@ -23,6 +21,7 @@ import (
"github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/privval"
e2e "github.com/tendermint/tendermint/test/e2e/pkg"
"github.com/tendermint/tendermint/test/e2e/pkg/infra"
"github.com/tendermint/tendermint/types"
)
@@ -39,7 +38,7 @@ const (
)
// Setup sets up the testnet configuration.
func Setup(testnet *e2e.Testnet) error {
func Setup(testnet *e2e.Testnet, infp infra.Provider) error {
logger.Info("setup", "msg", log.NewLazySprintf("Generating testnet files in %q", testnet.Dir))
err := os.MkdirAll(testnet.Dir, os.ModePerm)
@@ -47,11 +46,7 @@ func Setup(testnet *e2e.Testnet) error {
return err
}
compose, err := MakeDockerCompose(testnet)
if err != nil {
return err
}
err = os.WriteFile(filepath.Join(testnet.Dir, "docker-compose.yml"), compose, 0o644) //nolint:gosec
err = infp.Setup()
if err != nil {
return err
}
@@ -126,70 +121,6 @@ func Setup(testnet *e2e.Testnet) error {
return nil
}
// MakeDockerCompose generates a Docker Compose config for a testnet.
func MakeDockerCompose(testnet *e2e.Testnet) ([]byte, error) {
// Must use version 2 Docker Compose format, to support IPv6.
tmpl, err := template.New("docker-compose").Funcs(template.FuncMap{
"misbehaviorsToString": func(misbehaviors map[int64]string) string {
str := ""
for height, misbehavior := range misbehaviors {
// after the first behavior set, a comma must be prepended
if str != "" {
str += ","
}
heightString := strconv.Itoa(int(height))
str += misbehavior + "," + heightString
}
return str
},
}).Parse(`version: '2.4'
networks:
{{ .Name }}:
labels:
e2e: true
driver: bridge
{{- if .IPv6 }}
enable_ipv6: true
{{- end }}
ipam:
driver: default
config:
- subnet: {{ .IP }}
services:
{{- range .Nodes }}
{{ .Name }}:
labels:
e2e: true
container_name: {{ .Name }}
image: tendermint/e2e-node
{{- if eq .ABCIProtocol "builtin" }}
entrypoint: /usr/bin/entrypoint-builtin
{{- end }}
init: true
ports:
- 26656
- {{ if .ProxyPort }}{{ .ProxyPort }}:{{ end }}26657
- 6060
volumes:
- ./{{ .Name }}:/tendermint
networks:
{{ $.Name }}:
ipv{{ if $.IPv6 }}6{{ else }}4{{ end}}_address: {{ .IP }}
{{end}}`)
if err != nil {
return nil, err
}
var buf bytes.Buffer
err = tmpl.Execute(&buf, testnet)
if err != nil {
return nil, err
}
return buf.Bytes(), nil
}
// MakeGenesis generates a genesis document.
func MakeGenesis(testnet *e2e.Testnet) (types.GenesisDoc, error) {
genesis := types.GenesisDoc{
+12 -8
View File
@@ -66,23 +66,27 @@ func testNode(t *testing.T, testFunc func(*testing.T, e2e.Node)) {
func loadTestnet(t *testing.T) e2e.Testnet {
t.Helper()
manifest := os.Getenv("E2E_MANIFEST")
if manifest == "" {
manifestFile := os.Getenv("E2E_MANIFEST")
if manifestFile == "" {
t.Skip("E2E_MANIFEST not set, not an end-to-end test run")
}
if !filepath.IsAbs(manifest) {
manifest = filepath.Join("..", manifest)
if !filepath.IsAbs(manifestFile) {
manifestFile = filepath.Join("..", manifestFile)
}
testnetCacheMtx.Lock()
defer testnetCacheMtx.Unlock()
if testnet, ok := testnetCache[manifest]; ok {
if testnet, ok := testnetCache[manifestFile]; ok {
return testnet
}
testnet, err := e2e.LoadTestnet(manifest)
m, err := e2e.LoadManifest(manifestFile)
require.NoError(t, err)
testnetCache[manifest] = *testnet
ifd, err := e2e.NewDockerInfrastructureData(m)
require.NoError(t, err)
testnet, err := e2e.LoadTestnet(m, manifestFile, ifd)
require.NoError(t, err)
testnetCache[manifestFile] = *testnet
return *testnet
}