diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 40fd2644a..ac381c806 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -14,6 +14,10 @@ BREAKING CHANGES: - [crypto] Rename AminoRoute variables to no longer be prefixed by signature type. - [config] Replace MaxNumPeers with MaxNumInboundPeers and MaxNumOutboundPeers - [node] NewNode now accepts a `*p2p.NodeKey` +- [abci] \#2159 Update use of `Validator` ala ADR-018: + - Remove PubKey from `Validator` and introduce `ValidatorUpdate` + - InitChain and EndBlock use ValidatorUpdate + - Update field names and types in BeginBlock FEATURES: - [types] allow genesis file to have 0 validators ([#2015](https://github.com/tendermint/tendermint/issues/2015)) diff --git a/Makefile b/Makefile index ff1232d02..1fb3eacb3 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,8 @@ INCLUDE = -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protob BUILD_TAGS?='tendermint' BUILD_FLAGS = -ldflags "-X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD`" +LINT_FLAGS = --exclude '.*\.pb\.go' --vendor --deadline=600s + all: check build test install check: check_tools get_vendor_deps @@ -36,13 +38,14 @@ protoc_all: protoc_libs protoc_abci protoc_grpc ## If you get the following error, ## "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory" ## See https://stackoverflow.com/a/25518702 + ## Note the $< here is substituted for the %.proto + ## Note the $@ here is substituted for the %.pb.go protoc $(INCLUDE) $< --gogo_out=Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp,plugins=grpc:. - @echo "--> adding nolint declarations to protobuf generated files" - @awk -i inplace '/^\s*package \w+/ { print "//nolint" }1' $@ ######################################## ### Build ABCI +# see protobuf section above protoc_abci: abci/types/types.pb.go build_abci: @@ -216,7 +219,7 @@ fmt: metalinter: @echo "--> Running linter" - @gometalinter.v2 --vendor --deadline=600s --disable-all \ + @gometalinter.v2 $(LINT_FLAGS) --disable-all \ --enable=deadcode \ --enable=gosimple \ --enable=misspell \ @@ -245,7 +248,7 @@ metalinter: metalinter_all: @echo "--> Running linter (all)" - gometalinter.v2 --vendor --deadline=600s --enable-all --disable=lll ./... + gometalinter.v2 $(LINT_FLAGS) --enable-all --disable=lll ./... DESTINATION = ./index.html.md diff --git a/abci/example/kvstore/helpers.go b/abci/example/kvstore/helpers.go index 0e69fab9f..bb086dec0 100644 --- a/abci/example/kvstore/helpers.go +++ b/abci/example/kvstore/helpers.go @@ -7,12 +7,10 @@ import ( // RandVal creates one random validator, with a key derived // from the input value -func RandVal(i int) types.Validator { - addr := cmn.RandBytes(20) +func RandVal(i int) types.ValidatorUpdate { pubkey := cmn.RandBytes(32) power := cmn.RandUint16() + 1 - v := types.Ed25519Validator(pubkey, int64(power)) - v.Address = addr + v := types.Ed25519ValidatorUpdate(pubkey, int64(power)) return v } @@ -20,8 +18,8 @@ func RandVal(i int) types.Validator { // the application. Note that the keys are deterministically // derived from the index in the array, while the power is // random (Change this if not desired) -func RandVals(cnt int) []types.Validator { - res := make([]types.Validator, cnt) +func RandVals(cnt int) []types.ValidatorUpdate { + res := make([]types.ValidatorUpdate, cnt) for i := 0; i < cnt; i++ { res[i] = RandVal(i) } diff --git a/abci/example/kvstore/kvstore_test.go b/abci/example/kvstore/kvstore_test.go index 33e67aaad..a18fb8d3c 100644 --- a/abci/example/kvstore/kvstore_test.go +++ b/abci/example/kvstore/kvstore_test.go @@ -122,11 +122,11 @@ func TestValUpdates(t *testing.T) { vals1, vals2 := vals[:nInit], kvstore.Validators() valsEqual(t, vals1, vals2) - var v1, v2, v3 types.Validator + var v1, v2, v3 types.ValidatorUpdate // add some validators v1, v2 = vals[nInit], vals[nInit+1] - diff := []types.Validator{v1, v2} + diff := []types.ValidatorUpdate{v1, v2} tx1 := MakeValSetChangeTx(v1.PubKey, v1.Power) tx2 := MakeValSetChangeTx(v2.PubKey, v2.Power) @@ -140,7 +140,7 @@ func TestValUpdates(t *testing.T) { v1.Power = 0 v2.Power = 0 v3.Power = 0 - diff = []types.Validator{v1, v2, v3} + diff = []types.ValidatorUpdate{v1, v2, v3} tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power) tx2 = MakeValSetChangeTx(v2.PubKey, v2.Power) tx3 := MakeValSetChangeTx(v3.PubKey, v3.Power) @@ -158,18 +158,18 @@ func TestValUpdates(t *testing.T) { } else { v1.Power = 5 } - diff = []types.Validator{v1} + diff = []types.ValidatorUpdate{v1} tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power) makeApplyBlock(t, kvstore, 3, diff, tx1) - vals1 = append([]types.Validator{v1}, vals1[1:]...) + vals1 = append([]types.ValidatorUpdate{v1}, vals1[1:]...) vals2 = kvstore.Validators() valsEqual(t, vals1, vals2) } -func makeApplyBlock(t *testing.T, kvstore types.Application, heightInt int, diff []types.Validator, txs ...[]byte) { +func makeApplyBlock(t *testing.T, kvstore types.Application, heightInt int, diff []types.ValidatorUpdate, txs ...[]byte) { // make and apply block height := int64(heightInt) hash := []byte("foo") @@ -191,12 +191,12 @@ func makeApplyBlock(t *testing.T, kvstore types.Application, heightInt int, diff } // order doesn't matter -func valsEqual(t *testing.T, vals1, vals2 []types.Validator) { +func valsEqual(t *testing.T, vals1, vals2 []types.ValidatorUpdate) { if len(vals1) != len(vals2) { t.Fatalf("vals dont match in len. got %d, expected %d", len(vals2), len(vals1)) } - sort.Sort(types.Validators(vals1)) - sort.Sort(types.Validators(vals2)) + sort.Sort(types.ValidatorUpdates(vals1)) + sort.Sort(types.ValidatorUpdates(vals2)) for i, v1 := range vals1 { v2 := vals2[i] if !bytes.Equal(v1.PubKey.Data, v2.PubKey.Data) || diff --git a/abci/example/kvstore/persistent_kvstore.go b/abci/example/kvstore/persistent_kvstore.go index b8a2299a6..f969eebfe 100644 --- a/abci/example/kvstore/persistent_kvstore.go +++ b/abci/example/kvstore/persistent_kvstore.go @@ -25,7 +25,7 @@ type PersistentKVStoreApplication struct { app *KVStoreApplication // validator set - ValUpdates []types.Validator + ValUpdates []types.ValidatorUpdate logger log.Logger } @@ -101,7 +101,7 @@ func (app *PersistentKVStoreApplication) InitChain(req types.RequestInitChain) t // Track the block hash and header information func (app *PersistentKVStoreApplication) BeginBlock(req types.RequestBeginBlock) types.ResponseBeginBlock { // reset valset changes - app.ValUpdates = make([]types.Validator, 0) + app.ValUpdates = make([]types.ValidatorUpdate, 0) return types.ResponseBeginBlock{} } @@ -113,11 +113,11 @@ func (app *PersistentKVStoreApplication) EndBlock(req types.RequestEndBlock) typ //--------------------------------------------- // update validators -func (app *PersistentKVStoreApplication) Validators() (validators []types.Validator) { +func (app *PersistentKVStoreApplication) Validators() (validators []types.ValidatorUpdate) { itr := app.app.state.db.Iterator(nil, nil) for ; itr.Valid(); itr.Next() { if isValidatorTx(itr.Key()) { - validator := new(types.Validator) + validator := new(types.ValidatorUpdate) err := types.ReadMessage(bytes.NewBuffer(itr.Value()), validator) if err != nil { panic(err) @@ -167,11 +167,11 @@ func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) types.Respon } // update - return app.updateValidator(types.Ed25519Validator(pubkey, int64(power))) + return app.updateValidator(types.Ed25519ValidatorUpdate(pubkey, int64(power))) } // add, update, or remove a validator -func (app *PersistentKVStoreApplication) updateValidator(v types.Validator) types.ResponseDeliverTx { +func (app *PersistentKVStoreApplication) updateValidator(v types.ValidatorUpdate) types.ResponseDeliverTx { key := []byte("val:" + string(v.PubKey.Data)) if v.Power == 0 { // remove validator diff --git a/abci/tests/server/client.go b/abci/tests/server/client.go index f67297cd7..5daa1e6af 100644 --- a/abci/tests/server/client.go +++ b/abci/tests/server/client.go @@ -12,11 +12,11 @@ import ( func InitChain(client abcicli.Client) error { total := 10 - vals := make([]types.Validator, total) + vals := make([]types.ValidatorUpdate, total) for i := 0; i < total; i++ { pubkey := cmn.RandBytes(33) power := cmn.RandInt() - vals[i] = types.Ed25519Validator(pubkey, int64(power)) + vals[i] = types.Ed25519ValidatorUpdate(pubkey, int64(power)) } _, err := client.InitChainSync(types.RequestInitChain{ Validators: vals, diff --git a/abci/types/pubkey.go b/abci/types/pubkey.go index e5cd5fbf3..46cd8c5e8 100644 --- a/abci/types/pubkey.go +++ b/abci/types/pubkey.go @@ -4,8 +4,8 @@ const ( PubKeyEd25519 = "ed25519" ) -func Ed25519Validator(pubkey []byte, power int64) Validator { - return Validator{ +func Ed25519ValidatorUpdate(pubkey []byte, power int64) ValidatorUpdate { + return ValidatorUpdate{ // Address: PubKey: PubKey{ Type: PubKeyEd25519, diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index ae619ecc8..79e160065 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -1,7 +1,6 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: abci/types/types.proto -//nolint package types import proto "github.com/gogo/protobuf/proto" @@ -61,7 +60,7 @@ func (m *Request) Reset() { *m = Request{} } func (m *Request) String() string { return proto.CompactTextString(m) } func (*Request) ProtoMessage() {} func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{0} + return fileDescriptor_types_bafb6deff4c77e13, []int{0} } func (m *Request) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -483,7 +482,7 @@ func (m *RequestEcho) Reset() { *m = RequestEcho{} } func (m *RequestEcho) String() string { return proto.CompactTextString(m) } func (*RequestEcho) ProtoMessage() {} func (*RequestEcho) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{1} + return fileDescriptor_types_bafb6deff4c77e13, []int{1} } func (m *RequestEcho) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -529,7 +528,7 @@ func (m *RequestFlush) Reset() { *m = RequestFlush{} } func (m *RequestFlush) String() string { return proto.CompactTextString(m) } func (*RequestFlush) ProtoMessage() {} func (*RequestFlush) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{2} + return fileDescriptor_types_bafb6deff4c77e13, []int{2} } func (m *RequestFlush) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -569,7 +568,7 @@ func (m *RequestInfo) Reset() { *m = RequestInfo{} } func (m *RequestInfo) String() string { return proto.CompactTextString(m) } func (*RequestInfo) ProtoMessage() {} func (*RequestInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{3} + return fileDescriptor_types_bafb6deff4c77e13, []int{3} } func (m *RequestInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -618,7 +617,7 @@ func (m *RequestSetOption) Reset() { *m = RequestSetOption{} } func (m *RequestSetOption) String() string { return proto.CompactTextString(m) } func (*RequestSetOption) ProtoMessage() {} func (*RequestSetOption) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{4} + return fileDescriptor_types_bafb6deff4c77e13, []int{4} } func (m *RequestSetOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -662,21 +661,21 @@ func (m *RequestSetOption) GetValue() string { } type RequestInitChain struct { - Time time.Time `protobuf:"bytes,1,opt,name=time,stdtime" json:"time"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - ConsensusParams *ConsensusParams `protobuf:"bytes,3,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` - Validators []Validator `protobuf:"bytes,4,rep,name=validators" json:"validators"` - AppStateBytes []byte `protobuf:"bytes,5,opt,name=app_state_bytes,json=appStateBytes,proto3" json:"app_state_bytes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Time time.Time `protobuf:"bytes,1,opt,name=time,stdtime" json:"time"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ConsensusParams *ConsensusParams `protobuf:"bytes,3,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` + Validators []ValidatorUpdate `protobuf:"bytes,4,rep,name=validators" json:"validators"` + AppStateBytes []byte `protobuf:"bytes,5,opt,name=app_state_bytes,json=appStateBytes,proto3" json:"app_state_bytes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *RequestInitChain) Reset() { *m = RequestInitChain{} } func (m *RequestInitChain) String() string { return proto.CompactTextString(m) } func (*RequestInitChain) ProtoMessage() {} func (*RequestInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{5} + return fileDescriptor_types_bafb6deff4c77e13, []int{5} } func (m *RequestInitChain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -726,7 +725,7 @@ func (m *RequestInitChain) GetConsensusParams() *ConsensusParams { return nil } -func (m *RequestInitChain) GetValidators() []Validator { +func (m *RequestInitChain) GetValidators() []ValidatorUpdate { if m != nil { return m.Validators } @@ -754,7 +753,7 @@ func (m *RequestQuery) Reset() { *m = RequestQuery{} } func (m *RequestQuery) String() string { return proto.CompactTextString(m) } func (*RequestQuery) ProtoMessage() {} func (*RequestQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{6} + return fileDescriptor_types_bafb6deff4c77e13, []int{6} } func (m *RequestQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -826,7 +825,7 @@ func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } func (m *RequestBeginBlock) String() string { return proto.CompactTextString(m) } func (*RequestBeginBlock) ProtoMessage() {} func (*RequestBeginBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{7} + return fileDescriptor_types_bafb6deff4c77e13, []int{7} } func (m *RequestBeginBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -894,7 +893,7 @@ func (m *RequestCheckTx) Reset() { *m = RequestCheckTx{} } func (m *RequestCheckTx) String() string { return proto.CompactTextString(m) } func (*RequestCheckTx) ProtoMessage() {} func (*RequestCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{8} + return fileDescriptor_types_bafb6deff4c77e13, []int{8} } func (m *RequestCheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -941,7 +940,7 @@ func (m *RequestDeliverTx) Reset() { *m = RequestDeliverTx{} } func (m *RequestDeliverTx) String() string { return proto.CompactTextString(m) } func (*RequestDeliverTx) ProtoMessage() {} func (*RequestDeliverTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{9} + return fileDescriptor_types_bafb6deff4c77e13, []int{9} } func (m *RequestDeliverTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -988,7 +987,7 @@ func (m *RequestEndBlock) Reset() { *m = RequestEndBlock{} } func (m *RequestEndBlock) String() string { return proto.CompactTextString(m) } func (*RequestEndBlock) ProtoMessage() {} func (*RequestEndBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{10} + return fileDescriptor_types_bafb6deff4c77e13, []int{10} } func (m *RequestEndBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1034,7 +1033,7 @@ func (m *RequestCommit) Reset() { *m = RequestCommit{} } func (m *RequestCommit) String() string { return proto.CompactTextString(m) } func (*RequestCommit) ProtoMessage() {} func (*RequestCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{11} + return fileDescriptor_types_bafb6deff4c77e13, []int{11} } func (m *RequestCommit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1087,7 +1086,7 @@ func (m *Response) Reset() { *m = Response{} } func (m *Response) String() string { return proto.CompactTextString(m) } func (*Response) ProtoMessage() {} func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{12} + return fileDescriptor_types_bafb6deff4c77e13, []int{12} } func (m *Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1540,7 +1539,7 @@ func (m *ResponseException) Reset() { *m = ResponseException{} } func (m *ResponseException) String() string { return proto.CompactTextString(m) } func (*ResponseException) ProtoMessage() {} func (*ResponseException) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{13} + return fileDescriptor_types_bafb6deff4c77e13, []int{13} } func (m *ResponseException) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1587,7 +1586,7 @@ func (m *ResponseEcho) Reset() { *m = ResponseEcho{} } func (m *ResponseEcho) String() string { return proto.CompactTextString(m) } func (*ResponseEcho) ProtoMessage() {} func (*ResponseEcho) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{14} + return fileDescriptor_types_bafb6deff4c77e13, []int{14} } func (m *ResponseEcho) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1633,7 +1632,7 @@ func (m *ResponseFlush) Reset() { *m = ResponseFlush{} } func (m *ResponseFlush) String() string { return proto.CompactTextString(m) } func (*ResponseFlush) ProtoMessage() {} func (*ResponseFlush) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{15} + return fileDescriptor_types_bafb6deff4c77e13, []int{15} } func (m *ResponseFlush) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1676,7 +1675,7 @@ func (m *ResponseInfo) Reset() { *m = ResponseInfo{} } func (m *ResponseInfo) String() string { return proto.CompactTextString(m) } func (*ResponseInfo) ProtoMessage() {} func (*ResponseInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{16} + return fileDescriptor_types_bafb6deff4c77e13, []int{16} } func (m *ResponseInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1748,7 +1747,7 @@ func (m *ResponseSetOption) Reset() { *m = ResponseSetOption{} } func (m *ResponseSetOption) String() string { return proto.CompactTextString(m) } func (*ResponseSetOption) ProtoMessage() {} func (*ResponseSetOption) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{17} + return fileDescriptor_types_bafb6deff4c77e13, []int{17} } func (m *ResponseSetOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1799,18 +1798,18 @@ func (m *ResponseSetOption) GetInfo() string { } type ResponseInitChain struct { - ConsensusParams *ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` - Validators []Validator `protobuf:"bytes,2,rep,name=validators" json:"validators"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + ConsensusParams *ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` + Validators []ValidatorUpdate `protobuf:"bytes,2,rep,name=validators" json:"validators"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } func (m *ResponseInitChain) String() string { return proto.CompactTextString(m) } func (*ResponseInitChain) ProtoMessage() {} func (*ResponseInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{18} + return fileDescriptor_types_bafb6deff4c77e13, []int{18} } func (m *ResponseInitChain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1846,7 +1845,7 @@ func (m *ResponseInitChain) GetConsensusParams() *ConsensusParams { return nil } -func (m *ResponseInitChain) GetValidators() []Validator { +func (m *ResponseInitChain) GetValidators() []ValidatorUpdate { if m != nil { return m.Validators } @@ -1872,7 +1871,7 @@ func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } func (m *ResponseQuery) String() string { return proto.CompactTextString(m) } func (*ResponseQuery) ProtoMessage() {} func (*ResponseQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{19} + return fileDescriptor_types_bafb6deff4c77e13, []int{19} } func (m *ResponseQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1968,7 +1967,7 @@ func (m *ResponseBeginBlock) Reset() { *m = ResponseBeginBlock{} } func (m *ResponseBeginBlock) String() string { return proto.CompactTextString(m) } func (*ResponseBeginBlock) ProtoMessage() {} func (*ResponseBeginBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{20} + return fileDescriptor_types_bafb6deff4c77e13, []int{20} } func (m *ResponseBeginBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2021,7 +2020,7 @@ func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } func (m *ResponseCheckTx) String() string { return proto.CompactTextString(m) } func (*ResponseCheckTx) ProtoMessage() {} func (*ResponseCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{21} + return fileDescriptor_types_bafb6deff4c77e13, []int{21} } func (m *ResponseCheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2116,7 +2115,7 @@ func (m *ResponseDeliverTx) Reset() { *m = ResponseDeliverTx{} } func (m *ResponseDeliverTx) String() string { return proto.CompactTextString(m) } func (*ResponseDeliverTx) ProtoMessage() {} func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{22} + return fileDescriptor_types_bafb6deff4c77e13, []int{22} } func (m *ResponseDeliverTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2195,19 +2194,19 @@ func (m *ResponseDeliverTx) GetTags() []common.KVPair { } type ResponseEndBlock struct { - ValidatorUpdates []Validator `protobuf:"bytes,1,rep,name=validator_updates,json=validatorUpdates" json:"validator_updates"` - ConsensusParamUpdates *ConsensusParams `protobuf:"bytes,2,opt,name=consensus_param_updates,json=consensusParamUpdates" json:"consensus_param_updates,omitempty"` - Tags []common.KVPair `protobuf:"bytes,3,rep,name=tags" json:"tags,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + ValidatorUpdates []ValidatorUpdate `protobuf:"bytes,1,rep,name=validator_updates,json=validatorUpdates" json:"validator_updates"` + ConsensusParamUpdates *ConsensusParams `protobuf:"bytes,2,opt,name=consensus_param_updates,json=consensusParamUpdates" json:"consensus_param_updates,omitempty"` + Tags []common.KVPair `protobuf:"bytes,3,rep,name=tags" json:"tags,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ResponseEndBlock) Reset() { *m = ResponseEndBlock{} } func (m *ResponseEndBlock) String() string { return proto.CompactTextString(m) } func (*ResponseEndBlock) ProtoMessage() {} func (*ResponseEndBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{23} + return fileDescriptor_types_bafb6deff4c77e13, []int{23} } func (m *ResponseEndBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2236,7 +2235,7 @@ func (m *ResponseEndBlock) XXX_DiscardUnknown() { var xxx_messageInfo_ResponseEndBlock proto.InternalMessageInfo -func (m *ResponseEndBlock) GetValidatorUpdates() []Validator { +func (m *ResponseEndBlock) GetValidatorUpdates() []ValidatorUpdate { if m != nil { return m.ValidatorUpdates } @@ -2269,7 +2268,7 @@ func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } func (m *ResponseCommit) String() string { return proto.CompactTextString(m) } func (*ResponseCommit) ProtoMessage() {} func (*ResponseCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{24} + return fileDescriptor_types_bafb6deff4c77e13, []int{24} } func (m *ResponseCommit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2320,7 +2319,7 @@ func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } func (m *ConsensusParams) String() string { return proto.CompactTextString(m) } func (*ConsensusParams) ProtoMessage() {} func (*ConsensusParams) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{25} + return fileDescriptor_types_bafb6deff4c77e13, []int{25} } func (m *ConsensusParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2384,7 +2383,7 @@ func (m *BlockSize) Reset() { *m = BlockSize{} } func (m *BlockSize) String() string { return proto.CompactTextString(m) } func (*BlockSize) ProtoMessage() {} func (*BlockSize) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{26} + return fileDescriptor_types_bafb6deff4c77e13, []int{26} } func (m *BlockSize) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2447,7 +2446,7 @@ func (m *TxSize) Reset() { *m = TxSize{} } func (m *TxSize) String() string { return proto.CompactTextString(m) } func (*TxSize) ProtoMessage() {} func (*TxSize) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{27} + return fileDescriptor_types_bafb6deff4c77e13, []int{27} } func (m *TxSize) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2504,7 +2503,7 @@ func (m *BlockGossip) Reset() { *m = BlockGossip{} } func (m *BlockGossip) String() string { return proto.CompactTextString(m) } func (*BlockGossip) ProtoMessage() {} func (*BlockGossip) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{28} + return fileDescriptor_types_bafb6deff4c77e13, []int{28} } func (m *BlockGossip) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2541,18 +2540,18 @@ func (m *BlockGossip) GetBlockPartSizeBytes() int32 { } type LastCommitInfo struct { - CommitRound int32 `protobuf:"varint,1,opt,name=commit_round,json=commitRound,proto3" json:"commit_round,omitempty"` - Validators []SigningValidator `protobuf:"bytes,2,rep,name=validators" json:"validators"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Round int32 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"` + Votes []VoteInfo `protobuf:"bytes,2,rep,name=votes" json:"votes"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *LastCommitInfo) Reset() { *m = LastCommitInfo{} } func (m *LastCommitInfo) String() string { return proto.CompactTextString(m) } func (*LastCommitInfo) ProtoMessage() {} func (*LastCommitInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{29} + return fileDescriptor_types_bafb6deff4c77e13, []int{29} } func (m *LastCommitInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2581,16 +2580,16 @@ func (m *LastCommitInfo) XXX_DiscardUnknown() { var xxx_messageInfo_LastCommitInfo proto.InternalMessageInfo -func (m *LastCommitInfo) GetCommitRound() int32 { +func (m *LastCommitInfo) GetRound() int32 { if m != nil { - return m.CommitRound + return m.Round } return 0 } -func (m *LastCommitInfo) GetValidators() []SigningValidator { +func (m *LastCommitInfo) GetVotes() []VoteInfo { if m != nil { - return m.Validators + return m.Votes } return nil } @@ -2608,13 +2607,14 @@ type Header struct { LastCommitHash []byte `protobuf:"bytes,7,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` DataHash []byte `protobuf:"bytes,8,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` // hashes from the app output from the prev block - ValidatorsHash []byte `protobuf:"bytes,9,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` - ConsensusHash []byte `protobuf:"bytes,10,opt,name=consensus_hash,json=consensusHash,proto3" json:"consensus_hash,omitempty"` - AppHash []byte `protobuf:"bytes,11,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` - LastResultsHash []byte `protobuf:"bytes,12,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` + ValidatorsHash []byte `protobuf:"bytes,9,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` + NextValidatorsHash []byte `protobuf:"bytes,10,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` + ConsensusHash []byte `protobuf:"bytes,11,opt,name=consensus_hash,json=consensusHash,proto3" json:"consensus_hash,omitempty"` + AppHash []byte `protobuf:"bytes,12,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + LastResultsHash []byte `protobuf:"bytes,13,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` // consensus info - EvidenceHash []byte `protobuf:"bytes,13,opt,name=evidence_hash,json=evidenceHash,proto3" json:"evidence_hash,omitempty"` - ProposerAddress []byte `protobuf:"bytes,14,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` + EvidenceHash []byte `protobuf:"bytes,14,opt,name=evidence_hash,json=evidenceHash,proto3" json:"evidence_hash,omitempty"` + ProposerAddress []byte `protobuf:"bytes,15,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -2624,7 +2624,7 @@ func (m *Header) Reset() { *m = Header{} } func (m *Header) String() string { return proto.CompactTextString(m) } func (*Header) ProtoMessage() {} func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{30} + return fileDescriptor_types_bafb6deff4c77e13, []int{30} } func (m *Header) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2716,6 +2716,13 @@ func (m *Header) GetValidatorsHash() []byte { return nil } +func (m *Header) GetNextValidatorsHash() []byte { + if m != nil { + return m.NextValidatorsHash + } + return nil +} + func (m *Header) GetConsensusHash() []byte { if m != nil { return m.ConsensusHash @@ -2763,7 +2770,7 @@ func (m *BlockID) Reset() { *m = BlockID{} } func (m *BlockID) String() string { return proto.CompactTextString(m) } func (*BlockID) ProtoMessage() {} func (*BlockID) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{31} + return fileDescriptor_types_bafb6deff4c77e13, []int{31} } func (m *BlockID) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2818,7 +2825,7 @@ func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } func (*PartSetHeader) ProtoMessage() {} func (*PartSetHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{32} + return fileDescriptor_types_bafb6deff4c77e13, []int{32} } func (m *PartSetHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2863,8 +2870,8 @@ func (m *PartSetHeader) GetHash() []byte { // Validator type Validator struct { - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - PubKey PubKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey" json:"pub_key"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // PubKey pub_key = 2 [(gogoproto.nullable)=false]; Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -2875,7 +2882,7 @@ func (m *Validator) Reset() { *m = Validator{} } func (m *Validator) String() string { return proto.CompactTextString(m) } func (*Validator) ProtoMessage() {} func (*Validator) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{33} + return fileDescriptor_types_bafb6deff4c77e13, []int{33} } func (m *Validator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2911,13 +2918,6 @@ func (m *Validator) GetAddress() []byte { return nil } -func (m *Validator) GetPubKey() PubKey { - if m != nil { - return m.PubKey - } - return PubKey{} -} - func (m *Validator) GetPower() int64 { if m != nil { return m.Power @@ -2925,27 +2925,27 @@ func (m *Validator) GetPower() int64 { return 0 } -// Validator with an extra bool -type SigningValidator struct { - Validator Validator `protobuf:"bytes,1,opt,name=validator" json:"validator"` - SignedLastBlock bool `protobuf:"varint,2,opt,name=signed_last_block,json=signedLastBlock,proto3" json:"signed_last_block,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +// ValidatorUpdate +type ValidatorUpdate struct { + PubKey PubKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey" json:"pub_key"` + Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *SigningValidator) Reset() { *m = SigningValidator{} } -func (m *SigningValidator) String() string { return proto.CompactTextString(m) } -func (*SigningValidator) ProtoMessage() {} -func (*SigningValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{34} +func (m *ValidatorUpdate) Reset() { *m = ValidatorUpdate{} } +func (m *ValidatorUpdate) String() string { return proto.CompactTextString(m) } +func (*ValidatorUpdate) ProtoMessage() {} +func (*ValidatorUpdate) Descriptor() ([]byte, []int) { + return fileDescriptor_types_bafb6deff4c77e13, []int{34} } -func (m *SigningValidator) XXX_Unmarshal(b []byte) error { +func (m *ValidatorUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SigningValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ValidatorUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SigningValidator.Marshal(b, m, deterministic) + return xxx_messageInfo_ValidatorUpdate.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalTo(b) @@ -2955,26 +2955,82 @@ func (m *SigningValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (dst *SigningValidator) XXX_Merge(src proto.Message) { - xxx_messageInfo_SigningValidator.Merge(dst, src) +func (dst *ValidatorUpdate) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorUpdate.Merge(dst, src) } -func (m *SigningValidator) XXX_Size() int { +func (m *ValidatorUpdate) XXX_Size() int { return m.Size() } -func (m *SigningValidator) XXX_DiscardUnknown() { - xxx_messageInfo_SigningValidator.DiscardUnknown(m) +func (m *ValidatorUpdate) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorUpdate.DiscardUnknown(m) } -var xxx_messageInfo_SigningValidator proto.InternalMessageInfo +var xxx_messageInfo_ValidatorUpdate proto.InternalMessageInfo -func (m *SigningValidator) GetValidator() Validator { +func (m *ValidatorUpdate) GetPubKey() PubKey { + if m != nil { + return m.PubKey + } + return PubKey{} +} + +func (m *ValidatorUpdate) GetPower() int64 { + if m != nil { + return m.Power + } + return 0 +} + +// VoteInfo +type VoteInfo struct { + Validator Validator `protobuf:"bytes,1,opt,name=validator" json:"validator"` + SignedLastBlock bool `protobuf:"varint,2,opt,name=signed_last_block,json=signedLastBlock,proto3" json:"signed_last_block,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VoteInfo) Reset() { *m = VoteInfo{} } +func (m *VoteInfo) String() string { return proto.CompactTextString(m) } +func (*VoteInfo) ProtoMessage() {} +func (*VoteInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_types_bafb6deff4c77e13, []int{35} +} +func (m *VoteInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VoteInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *VoteInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_VoteInfo.Merge(dst, src) +} +func (m *VoteInfo) XXX_Size() int { + return m.Size() +} +func (m *VoteInfo) XXX_DiscardUnknown() { + xxx_messageInfo_VoteInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_VoteInfo proto.InternalMessageInfo + +func (m *VoteInfo) GetValidator() Validator { if m != nil { return m.Validator } return Validator{} } -func (m *SigningValidator) GetSignedLastBlock() bool { +func (m *VoteInfo) GetSignedLastBlock() bool { if m != nil { return m.SignedLastBlock } @@ -2993,7 +3049,7 @@ func (m *PubKey) Reset() { *m = PubKey{} } func (m *PubKey) String() string { return proto.CompactTextString(m) } func (*PubKey) ProtoMessage() {} func (*PubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{35} + return fileDescriptor_types_bafb6deff4c77e13, []int{36} } func (m *PubKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3051,7 +3107,7 @@ func (m *Evidence) Reset() { *m = Evidence{} } func (m *Evidence) String() string { return proto.CompactTextString(m) } func (*Evidence) ProtoMessage() {} func (*Evidence) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{36} + return fileDescriptor_types_bafb6deff4c77e13, []int{37} } func (m *Evidence) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3184,8 +3240,10 @@ func init() { golang_proto.RegisterType((*PartSetHeader)(nil), "types.PartSetHeader") proto.RegisterType((*Validator)(nil), "types.Validator") golang_proto.RegisterType((*Validator)(nil), "types.Validator") - proto.RegisterType((*SigningValidator)(nil), "types.SigningValidator") - golang_proto.RegisterType((*SigningValidator)(nil), "types.SigningValidator") + proto.RegisterType((*ValidatorUpdate)(nil), "types.ValidatorUpdate") + golang_proto.RegisterType((*ValidatorUpdate)(nil), "types.ValidatorUpdate") + proto.RegisterType((*VoteInfo)(nil), "types.VoteInfo") + golang_proto.RegisterType((*VoteInfo)(nil), "types.VoteInfo") proto.RegisterType((*PubKey)(nil), "types.PubKey") golang_proto.RegisterType((*PubKey)(nil), "types.PubKey") proto.RegisterType((*Evidence)(nil), "types.Evidence") @@ -4717,14 +4775,14 @@ func (this *LastCommitInfo) Equal(that interface{}) bool { } else if this == nil { return false } - if this.CommitRound != that1.CommitRound { + if this.Round != that1.Round { return false } - if len(this.Validators) != len(that1.Validators) { + if len(this.Votes) != len(that1.Votes) { return false } - for i := range this.Validators { - if !this.Validators[i].Equal(&that1.Validators[i]) { + for i := range this.Votes { + if !this.Votes[i].Equal(&that1.Votes[i]) { return false } } @@ -4779,6 +4837,9 @@ func (this *Header) Equal(that interface{}) bool { if !bytes.Equal(this.ValidatorsHash, that1.ValidatorsHash) { return false } + if !bytes.Equal(this.NextValidatorsHash, that1.NextValidatorsHash) { + return false + } if !bytes.Equal(this.ConsensusHash, that1.ConsensusHash) { return false } @@ -4881,6 +4942,33 @@ func (this *Validator) Equal(that interface{}) bool { if !bytes.Equal(this.Address, that1.Address) { return false } + if this.Power != that1.Power { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ValidatorUpdate) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ValidatorUpdate) + if !ok { + that2, ok := that.(ValidatorUpdate) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } if !this.PubKey.Equal(&that1.PubKey) { return false } @@ -4892,14 +4980,14 @@ func (this *Validator) Equal(that interface{}) bool { } return true } -func (this *SigningValidator) Equal(that interface{}) bool { +func (this *VoteInfo) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*SigningValidator) + that1, ok := that.(*VoteInfo) if !ok { - that2, ok := that.(SigningValidator) + that2, ok := that.(VoteInfo) if ok { that1 = &that2 } else { @@ -5124,8 +5212,7 @@ func (c *aBCIApplicationClient) EndBlock(ctx context.Context, in *RequestEndBloc return out, nil } -// Server API for ABCIApplication service - +// ABCIApplicationServer is the server API for ABCIApplication service. type ABCIApplicationServer interface { Echo(context.Context, *RequestEcho) (*ResponseEcho, error) Flush(context.Context, *RequestFlush) (*ResponseFlush, error) @@ -6822,13 +6909,13 @@ func (m *LastCommitInfo) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.CommitRound != 0 { + if m.Round != 0 { dAtA[i] = 0x8 i++ - i = encodeVarintTypes(dAtA, i, uint64(m.CommitRound)) + i = encodeVarintTypes(dAtA, i, uint64(m.Round)) } - if len(m.Validators) > 0 { - for _, msg := range m.Validators { + if len(m.Votes) > 0 { + for _, msg := range m.Votes { dAtA[i] = 0x12 i++ i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) @@ -6915,32 +7002,38 @@ func (m *Header) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidatorsHash))) i += copy(dAtA[i:], m.ValidatorsHash) } - if len(m.ConsensusHash) > 0 { + if len(m.NextValidatorsHash) > 0 { dAtA[i] = 0x52 i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.NextValidatorsHash))) + i += copy(dAtA[i:], m.NextValidatorsHash) + } + if len(m.ConsensusHash) > 0 { + dAtA[i] = 0x5a + i++ i = encodeVarintTypes(dAtA, i, uint64(len(m.ConsensusHash))) i += copy(dAtA[i:], m.ConsensusHash) } if len(m.AppHash) > 0 { - dAtA[i] = 0x5a + dAtA[i] = 0x62 i++ i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash))) i += copy(dAtA[i:], m.AppHash) } if len(m.LastResultsHash) > 0 { - dAtA[i] = 0x62 + dAtA[i] = 0x6a i++ i = encodeVarintTypes(dAtA, i, uint64(len(m.LastResultsHash))) i += copy(dAtA[i:], m.LastResultsHash) } if len(m.EvidenceHash) > 0 { - dAtA[i] = 0x6a + dAtA[i] = 0x72 i++ i = encodeVarintTypes(dAtA, i, uint64(len(m.EvidenceHash))) i += copy(dAtA[i:], m.EvidenceHash) } if len(m.ProposerAddress) > 0 { - dAtA[i] = 0x72 + dAtA[i] = 0x7a i++ i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) i += copy(dAtA[i:], m.ProposerAddress) @@ -7039,14 +7132,6 @@ func (m *Validator) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) i += copy(dAtA[i:], m.Address) } - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.PubKey.Size())) - n38, err := m.PubKey.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n38 if m.Power != 0 { dAtA[i] = 0x18 i++ @@ -7058,7 +7143,7 @@ func (m *Validator) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *SigningValidator) Marshal() (dAtA []byte, err error) { +func (m *ValidatorUpdate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -7068,7 +7153,41 @@ func (m *SigningValidator) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SigningValidator) MarshalTo(dAtA []byte) (int, error) { +func (m *ValidatorUpdate) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.PubKey.Size())) + n38, err := m.PubKey.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n38 + if m.Power != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Power)) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *VoteInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VoteInfo) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int @@ -7326,9 +7445,9 @@ func NewPopulatedRequestInitChain(r randyTypes, easy bool) *RequestInitChain { } if r.Intn(10) != 0 { v2 := r.Intn(5) - this.Validators = make([]Validator, v2) + this.Validators = make([]ValidatorUpdate, v2) for i := 0; i < v2; i++ { - v3 := NewPopulatedValidator(r, easy) + v3 := NewPopulatedValidatorUpdate(r, easy) this.Validators[i] = *v3 } } @@ -7591,9 +7710,9 @@ func NewPopulatedResponseInitChain(r randyTypes, easy bool) *ResponseInitChain { } if r.Intn(10) != 0 { v14 := r.Intn(5) - this.Validators = make([]Validator, v14) + this.Validators = make([]ValidatorUpdate, v14) for i := 0; i < v14; i++ { - v15 := NewPopulatedValidator(r, easy) + v15 := NewPopulatedValidatorUpdate(r, easy) this.Validators[i] = *v15 } } @@ -7721,9 +7840,9 @@ func NewPopulatedResponseEndBlock(r randyTypes, easy bool) *ResponseEndBlock { this := &ResponseEndBlock{} if r.Intn(10) != 0 { v27 := r.Intn(5) - this.ValidatorUpdates = make([]Validator, v27) + this.ValidatorUpdates = make([]ValidatorUpdate, v27) for i := 0; i < v27; i++ { - v28 := NewPopulatedValidator(r, easy) + v28 := NewPopulatedValidatorUpdate(r, easy) this.ValidatorUpdates[i] = *v28 } } @@ -7824,16 +7943,16 @@ func NewPopulatedBlockGossip(r randyTypes, easy bool) *BlockGossip { func NewPopulatedLastCommitInfo(r randyTypes, easy bool) *LastCommitInfo { this := &LastCommitInfo{} - this.CommitRound = int32(r.Int31()) + this.Round = int32(r.Int31()) if r.Intn(2) == 0 { - this.CommitRound *= -1 + this.Round *= -1 } if r.Intn(10) != 0 { v32 := r.Intn(5) - this.Validators = make([]SigningValidator, v32) + this.Votes = make([]VoteInfo, v32) for i := 0; i < v32; i++ { - v33 := NewPopulatedSigningValidator(r, easy) - this.Validators[i] = *v33 + v33 := NewPopulatedVoteInfo(r, easy) + this.Votes[i] = *v33 } } if !easy && r.Intn(10) != 0 { @@ -7877,45 +7996,50 @@ func NewPopulatedHeader(r randyTypes, easy bool) *Header { this.ValidatorsHash[i] = byte(r.Intn(256)) } v39 := r.Intn(100) - this.ConsensusHash = make([]byte, v39) + this.NextValidatorsHash = make([]byte, v39) for i := 0; i < v39; i++ { - this.ConsensusHash[i] = byte(r.Intn(256)) + this.NextValidatorsHash[i] = byte(r.Intn(256)) } v40 := r.Intn(100) - this.AppHash = make([]byte, v40) + this.ConsensusHash = make([]byte, v40) for i := 0; i < v40; i++ { - this.AppHash[i] = byte(r.Intn(256)) + this.ConsensusHash[i] = byte(r.Intn(256)) } v41 := r.Intn(100) - this.LastResultsHash = make([]byte, v41) + this.AppHash = make([]byte, v41) for i := 0; i < v41; i++ { - this.LastResultsHash[i] = byte(r.Intn(256)) + this.AppHash[i] = byte(r.Intn(256)) } v42 := r.Intn(100) - this.EvidenceHash = make([]byte, v42) + this.LastResultsHash = make([]byte, v42) for i := 0; i < v42; i++ { - this.EvidenceHash[i] = byte(r.Intn(256)) + this.LastResultsHash[i] = byte(r.Intn(256)) } v43 := r.Intn(100) - this.ProposerAddress = make([]byte, v43) + this.EvidenceHash = make([]byte, v43) for i := 0; i < v43; i++ { + this.EvidenceHash[i] = byte(r.Intn(256)) + } + v44 := r.Intn(100) + this.ProposerAddress = make([]byte, v44) + for i := 0; i < v44; i++ { this.ProposerAddress[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 15) + this.XXX_unrecognized = randUnrecognizedTypes(r, 16) } return this } func NewPopulatedBlockID(r randyTypes, easy bool) *BlockID { this := &BlockID{} - v44 := r.Intn(100) - this.Hash = make([]byte, v44) - for i := 0; i < v44; i++ { + v45 := r.Intn(100) + this.Hash = make([]byte, v45) + for i := 0; i < v45; i++ { this.Hash[i] = byte(r.Intn(256)) } - v45 := NewPopulatedPartSetHeader(r, easy) - this.PartsHeader = *v45 + v46 := NewPopulatedPartSetHeader(r, easy) + this.PartsHeader = *v46 if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } @@ -7928,9 +8052,9 @@ func NewPopulatedPartSetHeader(r randyTypes, easy bool) *PartSetHeader { if r.Intn(2) == 0 { this.Total *= -1 } - v46 := r.Intn(100) - this.Hash = make([]byte, v46) - for i := 0; i < v46; i++ { + v47 := r.Intn(100) + this.Hash = make([]byte, v47) + for i := 0; i < v47; i++ { this.Hash[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { @@ -7941,13 +8065,11 @@ func NewPopulatedPartSetHeader(r randyTypes, easy bool) *PartSetHeader { func NewPopulatedValidator(r randyTypes, easy bool) *Validator { this := &Validator{} - v47 := r.Intn(100) - this.Address = make([]byte, v47) - for i := 0; i < v47; i++ { + v48 := r.Intn(100) + this.Address = make([]byte, v48) + for i := 0; i < v48; i++ { this.Address[i] = byte(r.Intn(256)) } - v48 := NewPopulatedPubKey(r, easy) - this.PubKey = *v48 this.Power = int64(r.Int63()) if r.Intn(2) == 0 { this.Power *= -1 @@ -7958,10 +8080,24 @@ func NewPopulatedValidator(r randyTypes, easy bool) *Validator { return this } -func NewPopulatedSigningValidator(r randyTypes, easy bool) *SigningValidator { - this := &SigningValidator{} - v49 := NewPopulatedValidator(r, easy) - this.Validator = *v49 +func NewPopulatedValidatorUpdate(r randyTypes, easy bool) *ValidatorUpdate { + this := &ValidatorUpdate{} + v49 := NewPopulatedPubKey(r, easy) + this.PubKey = *v49 + this.Power = int64(r.Int63()) + if r.Intn(2) == 0 { + this.Power *= -1 + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) + } + return this +} + +func NewPopulatedVoteInfo(r randyTypes, easy bool) *VoteInfo { + this := &VoteInfo{} + v50 := NewPopulatedValidator(r, easy) + this.Validator = *v50 this.SignedLastBlock = bool(bool(r.Intn(2) == 0)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedTypes(r, 3) @@ -7972,9 +8108,9 @@ func NewPopulatedSigningValidator(r randyTypes, easy bool) *SigningValidator { func NewPopulatedPubKey(r randyTypes, easy bool) *PubKey { this := &PubKey{} this.Type = string(randStringTypes(r)) - v50 := r.Intn(100) - this.Data = make([]byte, v50) - for i := 0; i < v50; i++ { + v51 := r.Intn(100) + this.Data = make([]byte, v51) + for i := 0; i < v51; i++ { this.Data[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { @@ -7986,14 +8122,14 @@ func NewPopulatedPubKey(r randyTypes, easy bool) *PubKey { func NewPopulatedEvidence(r randyTypes, easy bool) *Evidence { this := &Evidence{} this.Type = string(randStringTypes(r)) - v51 := NewPopulatedValidator(r, easy) - this.Validator = *v51 + v52 := NewPopulatedValidator(r, easy) + this.Validator = *v52 this.Height = int64(r.Int63()) if r.Intn(2) == 0 { this.Height *= -1 } - v52 := github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy) - this.Time = *v52 + v53 := github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy) + this.Time = *v53 this.TotalVotingPower = int64(r.Int63()) if r.Intn(2) == 0 { this.TotalVotingPower *= -1 @@ -8023,9 +8159,9 @@ func randUTF8RuneTypes(r randyTypes) rune { return rune(ru + 61) } func randStringTypes(r randyTypes) string { - v53 := r.Intn(100) - tmps := make([]rune, v53) - for i := 0; i < v53; i++ { + v54 := r.Intn(100) + tmps := make([]rune, v54) + for i := 0; i < v54; i++ { tmps[i] = randUTF8RuneTypes(r) } return string(tmps) @@ -8047,11 +8183,11 @@ func randFieldTypes(dAtA []byte, r randyTypes, fieldNumber int, wire int) []byte switch wire { case 0: dAtA = encodeVarintPopulateTypes(dAtA, uint64(key)) - v54 := r.Int63() + v55 := r.Int63() if r.Intn(2) == 0 { - v54 *= -1 + v55 *= -1 } - dAtA = encodeVarintPopulateTypes(dAtA, uint64(v54)) + dAtA = encodeVarintPopulateTypes(dAtA, uint64(v55)) case 1: dAtA = encodeVarintPopulateTypes(dAtA, uint64(key)) dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) @@ -8811,11 +8947,11 @@ func (m *BlockGossip) Size() (n int) { func (m *LastCommitInfo) Size() (n int) { var l int _ = l - if m.CommitRound != 0 { - n += 1 + sovTypes(uint64(m.CommitRound)) + if m.Round != 0 { + n += 1 + sovTypes(uint64(m.Round)) } - if len(m.Validators) > 0 { - for _, e := range m.Validators { + if len(m.Votes) > 0 { + for _, e := range m.Votes { l = e.Size() n += 1 + l + sovTypes(uint64(l)) } @@ -8858,6 +8994,10 @@ func (m *Header) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + l = len(m.NextValidatorsHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } l = len(m.ConsensusHash) if l > 0 { n += 1 + l + sovTypes(uint64(l)) @@ -8922,6 +9062,18 @@ func (m *Validator) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.Power != 0 { + n += 1 + sovTypes(uint64(m.Power)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ValidatorUpdate) Size() (n int) { + var l int + _ = l l = m.PubKey.Size() n += 1 + l + sovTypes(uint64(l)) if m.Power != 0 { @@ -8933,7 +9085,7 @@ func (m *Validator) Size() (n int) { return n } -func (m *SigningValidator) Size() (n int) { +func (m *VoteInfo) Size() (n int) { var l int _ = l l = m.Validator.Size() @@ -9870,7 +10022,7 @@ func (m *RequestInitChain) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Validators = append(m.Validators, Validator{}) + m.Validators = append(m.Validators, ValidatorUpdate{}) if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -11557,7 +11709,7 @@ func (m *ResponseInitChain) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Validators = append(m.Validators, Validator{}) + m.Validators = append(m.Validators, ValidatorUpdate{}) if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -12436,7 +12588,7 @@ func (m *ResponseEndBlock) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorUpdates = append(m.ValidatorUpdates, Validator{}) + m.ValidatorUpdates = append(m.ValidatorUpdates, ValidatorUpdate{}) if err := m.ValidatorUpdates[len(m.ValidatorUpdates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -13057,9 +13209,9 @@ func (m *LastCommitInfo) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CommitRound", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) } - m.CommitRound = 0 + m.Round = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -13069,14 +13221,14 @@ func (m *LastCommitInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.CommitRound |= (int32(b) & 0x7F) << shift + m.Round |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13100,8 +13252,8 @@ func (m *LastCommitInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Validators = append(m.Validators, SigningValidator{}) - if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Votes = append(m.Votes, VoteInfo{}) + if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -13396,6 +13548,37 @@ func (m *Header) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) + if m.NextValidatorsHash == nil { + m.NextValidatorsHash = []byte{} + } + iNdEx = postIndex + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHash", wireType) } @@ -13426,7 +13609,7 @@ func (m *Header) Unmarshal(dAtA []byte) error { m.ConsensusHash = []byte{} } iNdEx = postIndex - case 11: + case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) } @@ -13457,7 +13640,7 @@ func (m *Header) Unmarshal(dAtA []byte) error { m.AppHash = []byte{} } iNdEx = postIndex - case 12: + case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LastResultsHash", wireType) } @@ -13488,7 +13671,7 @@ func (m *Header) Unmarshal(dAtA []byte) error { m.LastResultsHash = []byte{} } iNdEx = postIndex - case 13: + case 14: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field EvidenceHash", wireType) } @@ -13519,7 +13702,7 @@ func (m *Header) Unmarshal(dAtA []byte) error { m.EvidenceHash = []byte{} } iNdEx = postIndex - case 14: + case 15: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) } @@ -13845,36 +14028,6 @@ func (m *Validator) Unmarshal(dAtA []byte) error { m.Address = []byte{} } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Power", wireType) @@ -13916,7 +14069,7 @@ func (m *Validator) Unmarshal(dAtA []byte) error { } return nil } -func (m *SigningValidator) Unmarshal(dAtA []byte) error { +func (m *ValidatorUpdate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13939,10 +14092,110 @@ func (m *SigningValidator) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SigningValidator: wiretype end group for non-group") + return fmt.Errorf("proto: ValidatorUpdate: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SigningValidator: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ValidatorUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Power", wireType) + } + m.Power = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Power |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VoteInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VoteInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VoteInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -14411,142 +14664,144 @@ var ( ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_7077ff64ad2a8940) } +func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_bafb6deff4c77e13) } func init() { - golang_proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_7077ff64ad2a8940) + golang_proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_bafb6deff4c77e13) } -var fileDescriptor_types_7077ff64ad2a8940 = []byte{ - // 2090 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x4f, 0x73, 0x23, 0x47, - 0x15, 0xf7, 0xc8, 0xb2, 0xa4, 0x79, 0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 0x97, 0xd1, 0x7a, 0x91, 0x96, 0xcb, 0xaf, 0xa0, 0xe5, 0x37, 0x64, 0x49, 0x92, 0x4e, - 0xd3, 0x45, 0xf7, 0x64, 0xfd, 0xd6, 0x80, 0x56, 0xee, 0x30, 0x64, 0x1f, 0x40, 0x65, 0x39, 0xee, - 0x3e, 0x8b, 0x0a, 0xe3, 0xc8, 0x06, 0x68, 0xac, 0x47, 0xee, 0x33, 0x66, 0x9b, 0x83, 0xe8, 0x93, - 0xdc, 0x85, 0xaa, 0x98, 0x2b, 0xee, 0x6c, 0xf1, 0xf6, 0x78, 0x8e, 0xac, 0x15, 0x81, 0xff, 0xe4, - 0x1e, 0x34, 0xd4, 0xc2, 0x23, 0x9f, 0x73, 0x37, 0xd0, 0x85, 0x03, 0x49, 0x2f, 0xfd, 0x01, 0x52, - 0xec, 0xfa, 0x20, 0x19, 0x58, 0x3f, 0x03, 0x33, 0xde, 0x96, 0xbc, 0x06, 0xe6, 0x94, 0xce, 0x75, - 0x65, 0x2b, 0xcf, 0xb6, 0x62, 0xd7, 0xa6, 0x74, 0x8e, 0x45, 0x2d, 0xd9, 0x80, 0xaa, 0x24, 0x8a, - 0xb9, 0xb2, 0xf7, 0x8a, 0x5d, 0x99, 0xd2, 0xf9, 0xe3, 0x79, 0x4c, 0x18, 0x51, 0x1e, 0x95, 0xad, - 0x53, 0x3a, 0xff, 0x80, 0x72, 0xeb, 0x7d, 0xa8, 0xa8, 0x43, 0xbe, 0xd4, 0xc2, 0x52, 0xbe, 0x94, - 0x91, 0xff, 0x3e, 0xd4, 0x53, 0xe7, 0x26, 0xdf, 0x81, 0x5b, 0x4a, 0xc3, 0x80, 0x86, 0x02, 0x2d, - 0x92, 0x59, 0x90, 0x20, 0xf1, 0x8c, 0x86, 0x42, 0x6e, 0xa9, 0x0a, 0xf1, 0x10, 0x9a, 0xd9, 0x62, - 0x95, 0x7c, 0x0d, 0x1a, 0xba, 0xb0, 0x0d, 0xfd, 0x99, 0xe7, 0x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 0xd4, 0x92, 0x97, - 0x95, 0xe2, 0x27, 0xd4, 0xee, 0xa2, 0xc6, 0xb8, 0xf7, 0x95, 0xff, 0xfc, 0x73, 0xd3, 0xf8, 0xdd, - 0xd5, 0xa6, 0xf1, 0x87, 0xab, 0x4d, 0xe3, 0xf3, 0xab, 0x4d, 0xe3, 0xcf, 0x57, 0x9b, 0xc6, 0x3f, - 0xae, 0x36, 0x8d, 0x3f, 0x7e, 0xb1, 0x69, 0x0c, 0x2a, 0xe8, 0xfe, 0x6f, 0xfd, 0x37, 0x00, 0x00, - 0xff, 0xff, 0x85, 0x43, 0xc2, 0x26, 0xf5, 0x17, 0x00, 0x00, +var fileDescriptor_types_bafb6deff4c77e13 = []byte{ + // 2115 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcf, 0x6e, 0x1b, 0xc9, + 0xd1, 0xd7, 0x50, 0x14, 0xc9, 0x29, 0x4a, 0xa4, 0xdc, 0xb6, 0x25, 0x9a, 0xfb, 0x7d, 0x92, 0x31, + 0x49, 0xbc, 0x52, 0x56, 0x2b, 0x6d, 0xb4, 0x71, 0x20, 0xaf, 0x37, 0x8b, 0x88, 0xb6, 0xb3, 0x12, + 0x76, 0x93, 0x28, 0x63, 0x5b, 0x01, 0x82, 0x00, 0x83, 0x26, 0xa7, 0x45, 0x0e, 0x4c, 0xce, 0xcc, + 0x4e, 0x37, 0xb5, 0x94, 0x9f, 0x61, 0x0f, 0x7b, 0x08, 0x90, 0x73, 0x6e, 0x79, 0x81, 0x00, 0x39, + 0xe6, 0x14, 0xec, 0x31, 0x08, 0x12, 0xe4, 0xe6, 0x24, 0x0a, 0x72, 0x48, 0x9e, 0x20, 0xc7, 0xa0, + 0xab, 0x7b, 0xfe, 0x6a, 0x68, 0xd8, 0xce, 0x2d, 0x17, 0x72, 0xba, 0xab, 0xaa, 0xbb, 0xab, 0xba, + 0xaa, 0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d, 0x9b, 0xf1, 0x50, 0x3a, 0x13, 0x39, 0x00, 0x93, + 0xcd, 0x06, 0x4c, 0x25, 0x52, 0xa3, 0x90, 0xa6, 0x14, 0xcf, 0xa3, 0x98, 0x2e, 0x03, 0x3a, 0x61, + 0x26, 0xdb, 0x39, 0x10, 0xb8, 0x5e, 0x14, 0xca, 0xa2, 0xc0, 0x4e, 0x1e, 0x05, 0x6e, 0x14, 0x78, + 0x0b, 0x30, 0xb0, 0x9d, 0x83, 0x81, 0xe2, 0xc2, 0x39, 0x1c, 0xb8, 0x57, 0x82, 0x03, 0xc5, 0xe3, + 0xcf, 0x01, 0x82, 0x7b, 0x25, 0x40, 0xd0, 0xb9, 0xb2, 0x57, 0x29, 0x12, 0xec, 0xe4, 0x91, 0xa0, + 0xa8, 0x4e, 0x01, 0x0a, 0x3e, 0x2c, 0x83, 0x82, 0x5b, 0x05, 0x99, 0xb9, 0x58, 0xf0, 0xfe, 0x15, + 0x2c, 0x58, 0x2b, 0x88, 0x96, 0x80, 0xc1, 0xbd, 0x5c, 0x96, 0x86, 0x52, 0xdd, 0xca, 0xd3, 0x34, + 0xf9, 0xce, 0x55, 0x1c, 0x59, 0x2f, 0x5e, 0x6d, 0x19, 0x90, 0xec, 0x15, 0x80, 0xe4, 0x66, 0xf1, + 0x94, 0x05, 0x24, 0x49, 0xf1, 0x60, 0x5b, 0xc6, 0x7d, 0xc1, 0xd3, 0x64, 0x8e, 0x60, 0x51, 0x14, + 0x44, 0x3a, 0x61, 0xab, 0x81, 0xb5, 0x25, 0x33, 0x51, 0xea, 0x5f, 0x2f, 0xc1, 0x0e, 0x74, 0xfa, + 0x8c, 0x77, 0x59, 0xbf, 0x30, 0x52, 0x59, 0x8c, 0xe8, 0x6c, 0x16, 0x33, 0x75, 0x16, 0xcb, 0x40, + 0x4a, 0x25, 0x07, 0x29, 0xe4, 0x9b, 0x70, 0x0d, 0xd3, 0x08, 0xda, 0xc5, 0xc9, 0xa5, 0xb5, 0xb6, + 0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diff --git a/abci/types/types.proto b/abci/types/types.proto index 45b62a779..ae550c0a5 100644 --- a/abci/types/types.proto +++ b/abci/types/types.proto @@ -60,7 +60,7 @@ message RequestInitChain { google.protobuf.Timestamp time = 1 [(gogoproto.nullable)=false, (gogoproto.stdtime)=true]; string chain_id = 2; ConsensusParams consensus_params = 3; - repeated Validator validators = 4 [(gogoproto.nullable)=false]; + repeated ValidatorUpdate validators = 4 [(gogoproto.nullable)=false]; bytes app_state_bytes = 5; } @@ -143,7 +143,7 @@ message ResponseSetOption { message ResponseInitChain { ConsensusParams consensus_params = 1; - repeated Validator validators = 2 [(gogoproto.nullable)=false]; + repeated ValidatorUpdate validators = 2 [(gogoproto.nullable)=false]; } message ResponseQuery { @@ -183,7 +183,7 @@ message ResponseDeliverTx { } message ResponseEndBlock { - repeated Validator validator_updates = 1 [(gogoproto.nullable)=false]; + repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable)=false]; ConsensusParams consensus_param_updates = 2; repeated common.KVPair tags = 3 [(gogoproto.nullable)=false, (gogoproto.jsontag)="tags,omitempty"]; } @@ -225,8 +225,8 @@ message BlockGossip { } message LastCommitInfo { - int32 commit_round = 1; - repeated SigningValidator validators = 2 [(gogoproto.nullable)=false]; + int32 round = 1; + repeated VoteInfo votes = 2 [(gogoproto.nullable)=false]; } //---------------------------------------- @@ -249,13 +249,14 @@ message Header { // hashes from the app output from the prev block bytes validators_hash = 9; // validators for the current block - bytes consensus_hash = 10; // consensus params for current block - bytes app_hash = 11; // state after txs from the previous block - bytes last_results_hash = 12;// root hash of all results from the txs from the previous block + bytes next_validators_hash = 10; // validators for the next block + bytes consensus_hash = 11; // consensus params for current block + bytes app_hash = 12; // state after txs from the previous block + bytes last_results_hash = 13;// root hash of all results from the txs from the previous block // consensus info - bytes evidence_hash = 13; // evidence included in the block - bytes proposer_address = 14; // original proposer of the block + bytes evidence_hash = 14; // evidence included in the block + bytes proposer_address = 15; // original proposer of the block } message BlockID { @@ -271,12 +272,18 @@ message PartSetHeader { // Validator message Validator { bytes address = 1; - PubKey pub_key = 2 [(gogoproto.nullable)=false]; + //PubKey pub_key = 2 [(gogoproto.nullable)=false]; int64 power = 3; } -// Validator with an extra bool -message SigningValidator { +// ValidatorUpdate +message ValidatorUpdate { + PubKey pub_key = 1 [(gogoproto.nullable)=false]; + int64 power = 2; +} + +// VoteInfo +message VoteInfo { Validator validator = 1 [(gogoproto.nullable)=false]; bool signed_last_block = 2; } diff --git a/abci/types/typespb_test.go b/abci/types/typespb_test.go index b32c827d1..0411afc84 100644 --- a/abci/types/typespb_test.go +++ b/abci/types/typespb_test.go @@ -1926,15 +1926,15 @@ func TestValidatorMarshalTo(t *testing.T) { } } -func TestSigningValidatorProto(t *testing.T) { +func TestValidatorUpdateProto(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSigningValidator(popr, false) + p := NewPopulatedValidatorUpdate(popr, false) dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &SigningValidator{} + msg := &ValidatorUpdate{} if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -1957,10 +1957,10 @@ func TestSigningValidatorProto(t *testing.T) { } } -func TestSigningValidatorMarshalTo(t *testing.T) { +func TestValidatorUpdateMarshalTo(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSigningValidator(popr, false) + p := NewPopulatedValidatorUpdate(popr, false) size := p.Size() dAtA := make([]byte, size) for i := range dAtA { @@ -1970,7 +1970,63 @@ func TestSigningValidatorMarshalTo(t *testing.T) { if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &SigningValidator{} + msg := &ValidatorUpdate{} + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + for i := range dAtA { + dAtA[i] = byte(popr.Intn(256)) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + +func TestVoteInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVoteInfo(popr, false) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &VoteInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(dAtA)) + copy(littlefuzz, dAtA) + for i := range dAtA { + dAtA[i] = byte(popr.Intn(256)) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + } +} + +func TestVoteInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVoteInfo(popr, false) + size := p.Size() + dAtA := make([]byte, size) + for i := range dAtA { + dAtA[i] = byte(popr.Intn(256)) + } + _, err := p.MarshalTo(dAtA) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &VoteInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2706,16 +2762,34 @@ func TestValidatorJSON(t *testing.T) { t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestSigningValidatorJSON(t *testing.T) { +func TestValidatorUpdateJSON(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSigningValidator(popr, true) + p := NewPopulatedValidatorUpdate(popr, true) marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &SigningValidator{} + msg := &ValidatorUpdate{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) + } +} +func TestVoteInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVoteInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &VoteInfo{} err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) @@ -3712,12 +3786,12 @@ func TestValidatorProtoCompactText(t *testing.T) { } } -func TestSigningValidatorProtoText(t *testing.T) { +func TestValidatorUpdateProtoText(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSigningValidator(popr, true) + p := NewPopulatedValidatorUpdate(popr, true) dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &SigningValidator{} + msg := &ValidatorUpdate{} if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -3726,12 +3800,40 @@ func TestSigningValidatorProtoText(t *testing.T) { } } -func TestSigningValidatorProtoCompactText(t *testing.T) { +func TestValidatorUpdateProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSigningValidator(popr, true) + p := NewPopulatedValidatorUpdate(popr, true) dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &SigningValidator{} + msg := &ValidatorUpdate{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + +func TestVoteInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVoteInfo(popr, true) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &VoteInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + +func TestVoteInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVoteInfo(popr, true) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &VoteInfo{} if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4544,10 +4646,32 @@ func TestValidatorSize(t *testing.T) { } } -func TestSigningValidatorSize(t *testing.T) { +func TestValidatorUpdateSize(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSigningValidator(popr, true) + p := NewPopulatedValidatorUpdate(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(dAtA) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func TestVoteInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVoteInfo(popr, true) size2 := github_com_gogo_protobuf_proto.Size(p) dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { diff --git a/abci/types/util.go b/abci/types/util.go index 458024c58..3cde88232 100644 --- a/abci/types/util.go +++ b/abci/types/util.go @@ -2,58 +2,33 @@ package types import ( "bytes" - "encoding/json" "sort" - - cmn "github.com/tendermint/tendermint/libs/common" ) //------------------------------------------------------------------------------ -// Validators is a list of validators that implements the Sort interface -type Validators []Validator +// ValidatorUpdates is a list of validators that implements the Sort interface +type ValidatorUpdates []ValidatorUpdate -var _ sort.Interface = (Validators)(nil) +var _ sort.Interface = (ValidatorUpdates)(nil) -// All these methods for Validators: +// All these methods for ValidatorUpdates: // Len, Less and Swap -// are for Validators to implement sort.Interface +// are for ValidatorUpdates to implement sort.Interface // which will be used by the sort package. // See Issue https://github.com/tendermint/abci/issues/212 -func (v Validators) Len() int { +func (v ValidatorUpdates) Len() int { return len(v) } // XXX: doesn't distinguish same validator with different power -func (v Validators) Less(i, j int) bool { +func (v ValidatorUpdates) Less(i, j int) bool { return bytes.Compare(v[i].PubKey.Data, v[j].PubKey.Data) <= 0 } -func (v Validators) Swap(i, j int) { +func (v ValidatorUpdates) Swap(i, j int) { v1 := v[i] v[i] = v[j] v[j] = v1 } - -func ValidatorsString(vs Validators) string { - s := make([]validatorPretty, len(vs)) - for i, v := range vs { - s[i] = validatorPretty{ - Address: v.Address, - PubKey: v.PubKey.Data, - Power: v.Power, - } - } - b, err := json.Marshal(s) - if err != nil { - panic(err.Error()) - } - return string(b) -} - -type validatorPretty struct { - Address cmn.HexBytes `json:"address"` - PubKey []byte `json:"pub_key"` - Power int64 `json:"power"` -} diff --git a/consensus/common_test.go b/consensus/common_test.go index 818946184..dc055959b 100644 --- a/consensus/common_test.go +++ b/consensus/common_test.go @@ -354,7 +354,7 @@ func randConsensusNet(nValidators int, testName string, tickerFunc func() Timeou } ensureDir(path.Dir(thisConfig.Consensus.WalFile()), 0700) // dir for wal app := appFunc() - vals := types.TM2PB.Validators(state.Validators) + vals := types.TM2PB.ValidatorUpdates(state.Validators) app.InitChain(abci.RequestInitChain{Validators: vals}) css[i] = newConsensusStateWithConfig(thisConfig, state, privVals[i], app) @@ -386,7 +386,7 @@ func randConsensusNetWithPeers(nValidators, nPeers int, testName string, tickerF } app := appFunc() - vals := types.TM2PB.Validators(state.Validators) + vals := types.TM2PB.ValidatorUpdates(state.Validators) app.InitChain(abci.RequestInitChain{Validators: vals}) css[i] = newConsensusStateWithConfig(thisConfig, state, privVal, app) diff --git a/consensus/reactor_test.go b/consensus/reactor_test.go index 35502fb1c..4a6d4b9dc 100644 --- a/consensus/reactor_test.go +++ b/consensus/reactor_test.go @@ -118,7 +118,7 @@ func TestReactorWithEvidence(t *testing.T) { thisConfig := ResetConfig(fmt.Sprintf("%s_%d", testName, i)) ensureDir(path.Dir(thisConfig.Consensus.WalFile()), 0700) // dir for wal app := appFunc() - vals := types.TM2PB.Validators(state.Validators) + vals := types.TM2PB.ValidatorUpdates(state.Validators) app.InitChain(abci.RequestInitChain{Validators: vals}) pv := privVals[i] diff --git a/consensus/replay.go b/consensus/replay.go index cff8344be..c92654f2c 100644 --- a/consensus/replay.go +++ b/consensus/replay.go @@ -266,7 +266,7 @@ func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight // If appBlockHeight == 0 it means that we are at genesis and hence should send InitChain. if appBlockHeight == 0 { - nextVals := types.TM2PB.Validators(state.NextValidators) // state.Validators would work too. + nextVals := types.TM2PB.ValidatorUpdates(state.NextValidators) // state.Validators would work too. csParams := types.TM2PB.ConsensusParams(h.genDoc.ConsensusParams) req := abci.RequestInitChain{ Time: h.genDoc.GenesisTime, @@ -282,7 +282,7 @@ func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight // If the app returned validators or consensus params, update the state. if len(res.Validators) > 0 { - vals, err := types.PB2TM.Validators(res.Validators) + vals, err := types.PB2TM.ValidatorUpdates(res.Validators) if err != nil { return nil, err } diff --git a/consensus/replay_test.go b/consensus/replay_test.go index c74a1ae9d..8ea71d353 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -416,7 +416,7 @@ func buildAppStateFromChain(proxyApp proxy.AppConns, stateDB dbm.DB, } defer proxyApp.Stop() - validators := types.TM2PB.Validators(state.Validators) + validators := types.TM2PB.ValidatorUpdates(state.Validators) if _, err := proxyApp.Consensus().InitChainSync(abci.RequestInitChain{ Validators: validators, }); err != nil { @@ -453,7 +453,7 @@ func buildTMStateFromChain(config *cfg.Config, stateDB dbm.DB, state sm.State, c } defer proxyApp.Stop() - validators := types.TM2PB.Validators(state.Validators) + validators := types.TM2PB.ValidatorUpdates(state.Validators) if _, err := proxyApp.Consensus().InitChainSync(abci.RequestInitChain{ Validators: validators, }); err != nil { @@ -639,7 +639,7 @@ func (bs *mockBlockStore) LoadSeenCommit(height int64) *types.Commit { func TestInitChainUpdateValidators(t *testing.T) { val, _ := types.RandValidator(true, 10) vals := types.NewValidatorSet([]*types.Validator{val}) - app := &initChainApp{vals: types.TM2PB.Validators(vals)} + app := &initChainApp{vals: types.TM2PB.ValidatorUpdates(vals)} clientCreator := proxy.NewLocalClientCreator(app) config := ResetConfig("proxy_test_") @@ -666,7 +666,7 @@ func TestInitChainUpdateValidators(t *testing.T) { assert.Equal(t, newValAddr, expectValAddr) } -func newInitChainApp(vals []abci.Validator) *initChainApp { +func newInitChainApp(vals []abci.ValidatorUpdate) *initChainApp { return &initChainApp{ vals: vals, } @@ -675,7 +675,7 @@ func newInitChainApp(vals []abci.Validator) *initChainApp { // returns the vals on InitChain type initChainApp struct { abci.BaseApplication - vals []abci.Validator + vals []abci.ValidatorUpdate } func (ica *initChainApp) InitChain(req abci.RequestInitChain) abci.ResponseInitChain { diff --git a/docs/app-dev/abci-spec.md b/docs/app-dev/abci-spec.md index 770740b86..63570f7f8 100644 --- a/docs/app-dev/abci-spec.md +++ b/docs/app-dev/abci-spec.md @@ -111,14 +111,21 @@ See below for more details on the message types and how they are used. - `Time (google.protobuf.Timestamp)`: Genesis time. - `ChainID (string)`: ID of the blockchain. - `ConsensusParams (ConsensusParams)`: Initial consensus-critical parameters. - - `Validators ([]Validator)`: Initial genesis validators. + - `Validators ([]ValidatorUpdate)`: Initial genesis validators. - `AppStateBytes ([]byte)`: Serialized initial application state. Amino-encoded JSON bytes. - **Response**: - `ConsensusParams (ConsensusParams)`: Initial consensus-critical parameters. - - `Validators ([]Validator)`: Initial validator set. + - `Validators ([]ValidatorUpdate)`: Initial validator set (if non empty). - **Usage**: - Called once upon genesis. + - If ResponseInitChain.Validators is empty, the initial validator set will be the RequestInitChain.Validators + - If ResponseInitChain.Validators is not empty, the initial validator set will be the + ResponseInitChain.Validators (regardless of what is in RequestInitChain.Validators). + - This allows the app to decide if it wants to accept the initial validator + set proposed by tendermint (ie. in the genesis file), or if it wants to use + a different one (perhaps computed based on some application specific + information in the genesis file). ### Query @@ -161,9 +168,10 @@ See below for more details on the message types and how they are used. - `Hash ([]byte)`: The block's hash. This can be derived from the block header. - `Header (struct{})`: The block header. - - `LastCommitInfo (LastCommitInfo)`: Info about the last commit. + - `LastCommitInfo (LastCommitInfo)`: Info about the last commit, including the + round, and the list of validators and which ones signed the last block. - `ByzantineValidators ([]Evidence)`: List of evidence of - validators that acted maliciously + validators that acted maliciously. - **Response**: - `Tags ([]cmn.KVPair)`: Key-Value tags for filtering and indexing - **Usage**: @@ -237,7 +245,7 @@ See below for more details on the message types and how they are used. - **Request**: - `Height (int64)`: Height of the block just executed. - **Response**: - - `ValidatorUpdates ([]Validator)`: Changes to validator set (set + - `ValidatorUpdates ([]ValidatorUpdate)`: Changes to validator set (set voting power to 0 to remove). - `ConsensusParamUpdates (ConsensusParams)`: Changes to consensus-critical time, size, and other parameters. @@ -246,7 +254,6 @@ See below for more details on the message types and how they are used. - Signals the end of a block. - Called prior to each Commit, after all transactions. - Validator set and consensus params are updated with the result. - - Validator pubkeys are expected to be go-wire encoded. ### Commit @@ -271,12 +278,17 @@ See below for more details on the message types and how they are used. - `NumTxs (int32)`: Number of transactions in the block - `TotalTxs (int64)`: Total number of transactions in the blockchain until now - - `LastBlockHash ([]byte)`: Hash of the previous (parent) block + - `LastBlockID (BlockID)`: Hash of the previous (parent) block + - `LastCommitHash ([]byte)`: Hash of the previous block's commit - `ValidatorsHash ([]byte)`: Hash of the validator set for this block + - `NextValidatorsHash ([]byte)`: Hash of the validator set for the next block + - `ConsensusHash ([]byte)`: Hash of the consensus parameters for this block - `AppHash ([]byte)`: Data returned by the last call to `Commit` - typically the Merkle root of the application state after executing the previous block's transactions - - `Proposer (Validator)`: Original proposer for the block + - `LastResultsHash ([]byte)`: Hash of the ABCI results returned by the last block + - `EvidenceHash ([]byte)`: Hash of the evidence included in this block + - `ProposerAddress ([]byte)`: Original proposer for the block - **Usage**: - Provided in RequestBeginBlock - Provides important context about the current state of the blockchain - @@ -288,16 +300,27 @@ See below for more details on the message types and how they are used. - **Fields**: - `Address ([]byte)`: Address of the validator (hash of the public key) + - `Power (int64)`: Voting power of the validator +- **Usage**: + - Validator identified by address + - Used in RequestBeginBlock as part of VoteInfo + - Does not include PubKey to avoid sending potentially large quantum pubkeys + over the ABCI + +### ValidatorUpdate + +- **Fields**: - `PubKey (PubKey)`: Public key of the validator - `Power (int64)`: Voting power of the validator - **Usage**: - - Provides all identifying information about the validator + - Validator identified by PubKey + - Used to tell Tendermint to update the validator set -### SigningValidator +### VoteInfo - **Fields**: - `Validator (Validator)`: A validator - - `SignedLastBlock (bool)`: Indicated whether or not the validator signed + - `SignedLastBlock (bool)`: Indicates whether or not the validator signed the last block - **Usage**: - Indicates whether a validator signed the last block, allowing for rewards @@ -330,6 +353,6 @@ See below for more details on the message types and how they are used. ### LastCommitInfo - **Fields**: - - `CommitRound (int32)`: Commit round. - - `Validators ([]SigningValidator)`: List of validators in the current - validator set and whether or not they signed a vote. + - `Round (int32)`: Commit round. + - `Votes ([]VoteInfo)`: List of validators addresses in the last validator set + with their voting power and whether or not they signed a vote. diff --git a/docs/architecture/adr-018-ABCI-Validators.md b/docs/architecture/adr-018-ABCI-Validators.md index 2f1060b91..b632da855 100644 --- a/docs/architecture/adr-018-ABCI-Validators.md +++ b/docs/architecture/adr-018-ABCI-Validators.md @@ -2,6 +2,10 @@ ## Changelog +016-08-2018: Follow up from review: + - Revert changes to commit round + - Remind about justification for removing pubkey + - Update pros/cons 05-08-2018: Initial draft ## Context @@ -10,17 +14,14 @@ ADR 009 introduced major improvements to the ABCI around validators and the use of Amino. Here we follow up with some additional changes to improve the naming and expected use of Validator messages. -We also fix how we communicate the commit round - there is no defined commit -round, as validators can commit the same block in different rounds, so we -should communicate the round each validator committed in. - ## Decision ### Validator -Currently a Validator contains address and `pub_key`, and one or the other is +Currently a Validator contains `address` and `pub_key`, and one or the other is optional/not-sent depending on the use case. Instead, we should have a -Validator (with just the address) and a ValidatorUpdate (with the pubkey): +`Validator` (with just the address, used for RequestBeginBlock) +and a `ValidatorUpdate` (with the pubkey, used for ResponseEndBlock): ``` message Validator { @@ -34,6 +35,13 @@ message ValidatorUpdate { } ``` +As noted in ADR-009[https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-009-ABCI-design.md], +the `Validator` does not contain a pubkey because quantum public keys are +quite large and it would be wasteful to send them all over ABCI with every block. +Thus, applications that want to take advantage of the information in BeginBlock +are *required* to store pubkeys in state (or use much less efficient lazy means +of verifying BeginBlock data). + ### RequestBeginBlock LastCommitInfo currently has an array of `SigningValidator` that contains @@ -41,19 +49,17 @@ information for each validator in the entire validator set. Instead, this should be called `VoteInfo`, since it is information about the validator votes. -Additionally, we have a single CommitRound in the LastCommitInfo, -but such a round does not exist. Instead, we -should include the round associated with each commit vote: +Note that all votes in a commit must be from the same round. ``` message LastCommitInfo { + int64 round repeated VoteInfo commit_votes } message VoteInfo { Validator validator bool signed_last_block - int64 round } ``` @@ -62,6 +68,9 @@ message VoteInfo { Use ValidatorUpdates instead of Validators. Then it's clear we don't need an address, and we do need a pubkey. +We could require the address here as well as a sanity check, but it doesn't seem +necessary. + ### InitChain Use ValidatorUpdates for both Request and Response. InitChain @@ -76,16 +85,15 @@ Proposal. ### Positive -- Easier for developers to build on and understand the ABCI -- Apps get more information about the votes (ie. the round they're from) +- Clarifies the distinction between the different uses of validator information ### Negative -- There are two validator types +- Apps must still store the public keys in state to utilize the RequestBeginBlock info ### Neutral -- +- ResponseEndBlock does not require an address ## References diff --git a/docs/spec/software/abci.md b/docs/spec/software/abci.md index 093f3ac1c..4323d3948 100644 --- a/docs/spec/software/abci.md +++ b/docs/spec/software/abci.md @@ -52,14 +52,13 @@ objects in the `ResponseBeginBlock`: ``` message Validator { - bytes address = 1; - PubKey pub_key = 2; - int64 power = 3; + PubKey pub_key + int64 power } message PubKey { - string type = 1; - bytes data = 2; + string type + bytes data } ``` @@ -99,9 +98,6 @@ If the list is not empty, Tendermint will adopt it for the validator set. This way the application can determine the initial validator set for the blockchain. -Note that if addressses are included in the returned validators, they must match -the address of the public key. - ResponseInitChain also includes ConsensusParams, but these are presently ignored. diff --git a/state/execution.go b/state/execution.go index 7e7bc37a7..ab689f5fb 100644 --- a/state/execution.go +++ b/state/execution.go @@ -184,16 +184,13 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus, } proxyAppConn.SetResponseCallback(proxyCb) - signVals, byzVals := getBeginBlockValidatorInfo(block, lastValSet, stateDB) + commitInfo, byzVals := getBeginBlockValidatorInfo(block, lastValSet, stateDB) // Begin block. _, err := proxyAppConn.BeginBlockSync(abci.RequestBeginBlock{ - Hash: block.Hash(), - Header: types.TM2PB.Header(&block.Header), - LastCommitInfo: abci.LastCommitInfo{ - CommitRound: int32(block.LastCommit.Round()), - Validators: signVals, - }, + Hash: block.Hash(), + Header: types.TM2PB.Header(&block.Header), + LastCommitInfo: commitInfo, ByzantineValidators: byzVals, }) if err != nil { @@ -220,13 +217,14 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus, valUpdates := abciResponses.EndBlock.ValidatorUpdates if len(valUpdates) > 0 { - logger.Info("Updates to validators", "updates", abci.ValidatorsString(valUpdates)) + // TODO: cleanup the formatting + logger.Info("Updates to validators", "updates", valUpdates) } return abciResponses, nil } -func getBeginBlockValidatorInfo(block *types.Block, lastValSet *types.ValidatorSet, stateDB dbm.DB) ([]abci.SigningValidator, []abci.Evidence) { +func getBeginBlockValidatorInfo(block *types.Block, lastValSet *types.ValidatorSet, stateDB dbm.DB) (abci.LastCommitInfo, []abci.Evidence) { // Sanity check that commit length matches validator set size - // only applies after first block @@ -240,18 +238,23 @@ func getBeginBlockValidatorInfo(block *types.Block, lastValSet *types.ValidatorS } } - // determine which validators did not sign last block. - signVals := make([]abci.SigningValidator, len(lastValSet.Validators)) + // Collect the vote info (list of validators and whether or not they signed). + voteInfos := make([]abci.VoteInfo, len(lastValSet.Validators)) for i, val := range lastValSet.Validators { var vote *types.Vote if i < len(block.LastCommit.Precommits) { vote = block.LastCommit.Precommits[i] } - val := abci.SigningValidator{ - Validator: types.TM2PB.ValidatorWithoutPubKey(val), + voteInfo := abci.VoteInfo{ + Validator: types.TM2PB.Validator(val), SignedLastBlock: vote != nil, } - signVals[i] = val + voteInfos[i] = voteInfo + } + + commitInfo := abci.LastCommitInfo{ + Round: int32(block.LastCommit.Round()), + Votes: voteInfos, } byzVals := make([]abci.Evidence, len(block.Evidence.Evidence)) @@ -266,15 +269,15 @@ func getBeginBlockValidatorInfo(block *types.Block, lastValSet *types.ValidatorS byzVals[i] = types.TM2PB.Evidence(ev, valset, block.Time) } - return signVals, byzVals + return commitInfo, byzVals } // If more or equal than 1/3 of total voting power changed in one block, then // a light client could never prove the transition externally. See // ./lite/doc.go for details on how a light client tracks validators. -func updateValidators(currentSet *types.ValidatorSet, abciUpdates []abci.Validator) error { - updates, err := types.PB2TM.Validators(abciUpdates) +func updateValidators(currentSet *types.ValidatorSet, abciUpdates []abci.ValidatorUpdate) error { + updates, err := types.PB2TM.ValidatorUpdates(abciUpdates) if err != nil { return err } @@ -381,9 +384,10 @@ func fireEvents(logger log.Logger, eventBus types.BlockEventPublisher, block *ty }}) } - if len(abciResponses.EndBlock.ValidatorUpdates) > 0 { + abciValUpdates := abciResponses.EndBlock.ValidatorUpdates + if len(abciValUpdates) > 0 { // if there were an error, we would've stopped in updateValidators - updates, _ := types.PB2TM.Validators(abciResponses.EndBlock.ValidatorUpdates) + updates, _ := types.PB2TM.ValidatorUpdates(abciValUpdates) eventBus.PublishEventValidatorSetUpdates( types.EventDataValidatorSetUpdates{ValidatorUpdates: updates}) } diff --git a/state/execution_test.go b/state/execution_test.go index 161b96f23..4d7c4f999 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -86,7 +86,7 @@ func TestBeginBlockValidators(t *testing.T) { // -> app receives a list of validators with a bool indicating if they signed ctr := 0 - for i, v := range app.Validators { + for i, v := range app.CommitVotes { if ctr < len(tc.expectedAbsentValidators) && tc.expectedAbsentValidators[ctr] == i { @@ -160,7 +160,7 @@ func TestUpdateValidators(t *testing.T) { name string currentSet *types.ValidatorSet - abciUpdates []abci.Validator + abciUpdates []abci.ValidatorUpdate resultingSet *types.ValidatorSet shouldErr bool @@ -169,7 +169,7 @@ func TestUpdateValidators(t *testing.T) { "adding a validator is OK", types.NewValidatorSet([]*types.Validator{val1}), - []abci.Validator{{Address: []byte{}, PubKey: types.TM2PB.PubKey(pubkey2), Power: 20}}, + []abci.ValidatorUpdate{{PubKey: types.TM2PB.PubKey(pubkey2), Power: 20}}, types.NewValidatorSet([]*types.Validator{val1, val2}), false, @@ -178,7 +178,7 @@ func TestUpdateValidators(t *testing.T) { "updating a validator is OK", types.NewValidatorSet([]*types.Validator{val1}), - []abci.Validator{{Address: []byte{}, PubKey: types.TM2PB.PubKey(pubkey1), Power: 20}}, + []abci.ValidatorUpdate{{PubKey: types.TM2PB.PubKey(pubkey1), Power: 20}}, types.NewValidatorSet([]*types.Validator{types.NewValidator(pubkey1, 20)}), false, @@ -187,7 +187,7 @@ func TestUpdateValidators(t *testing.T) { "removing a validator is OK", types.NewValidatorSet([]*types.Validator{val1, val2}), - []abci.Validator{{Address: []byte{}, PubKey: types.TM2PB.PubKey(pubkey2), Power: 0}}, + []abci.ValidatorUpdate{{PubKey: types.TM2PB.PubKey(pubkey2), Power: 0}}, types.NewValidatorSet([]*types.Validator{val1}), false, @@ -197,7 +197,7 @@ func TestUpdateValidators(t *testing.T) { "removing a non-existing validator results in error", types.NewValidatorSet([]*types.Validator{val1}), - []abci.Validator{{Address: []byte{}, PubKey: types.TM2PB.PubKey(pubkey2), Power: 0}}, + []abci.ValidatorUpdate{{PubKey: types.TM2PB.PubKey(pubkey2), Power: 0}}, types.NewValidatorSet([]*types.Validator{val1}), true, @@ -207,7 +207,7 @@ func TestUpdateValidators(t *testing.T) { "adding a validator with negative power results in error", types.NewValidatorSet([]*types.Validator{val1}), - []abci.Validator{{Address: []byte{}, PubKey: types.TM2PB.PubKey(pubkey2), Power: -100}}, + []abci.ValidatorUpdate{{PubKey: types.TM2PB.PubKey(pubkey2), Power: -100}}, types.NewValidatorSet([]*types.Validator{val1}), true, @@ -260,7 +260,7 @@ func TestEndBlockValidatorUpdates(t *testing.T) { blockID := types.BlockID{block.Hash(), block.MakePartSet(testPartSize).Header()} pubkey := ed25519.GenPrivKey().PubKey() - app.ValidatorUpdates = []abci.Validator{ + app.ValidatorUpdates = []abci.ValidatorUpdate{ {PubKey: types.TM2PB.PubKey(pubkey), Power: 10}, } @@ -335,9 +335,9 @@ func makeBlock(state State, height int64) *types.Block { type testApp struct { abci.BaseApplication - Validators []abci.SigningValidator + CommitVotes []abci.VoteInfo ByzantineValidators []abci.Evidence - ValidatorUpdates []abci.Validator + ValidatorUpdates []abci.ValidatorUpdate } var _ abci.Application = (*testApp)(nil) @@ -347,7 +347,7 @@ func (app *testApp) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo) { } func (app *testApp) BeginBlock(req abci.RequestBeginBlock) abci.ResponseBeginBlock { - app.Validators = req.LastCommitInfo.Validators + app.CommitVotes = req.LastCommitInfo.Votes app.ByzantineValidators = req.ByzantineValidators return abci.ResponseBeginBlock{} } diff --git a/state/state_test.go b/state/state_test.go index 211d5fdc9..d8a8c0b82 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -78,8 +78,8 @@ func TestABCIResponsesSaveLoad1(t *testing.T) { abciResponses := NewABCIResponses(block) abciResponses.DeliverTx[0] = &abci.ResponseDeliverTx{Data: []byte("foo"), Tags: nil} abciResponses.DeliverTx[1] = &abci.ResponseDeliverTx{Data: []byte("bar"), Log: "ok", Tags: nil} - abciResponses.EndBlock = &abci.ResponseEndBlock{ValidatorUpdates: []abci.Validator{ - types.TM2PB.ValidatorFromPubKeyAndPower(ed25519.GenPrivKey().PubKey(), 10), + abciResponses.EndBlock = &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{ + types.TM2PB.NewValidatorUpdate(ed25519.GenPrivKey().PubKey(), 10), }} saveABCIResponses(stateDB, block.Height, abciResponses) @@ -454,9 +454,9 @@ func makeHeaderPartsResponsesValPubKeyChange(state State, height int64, _, val := state.NextValidators.GetByIndex(0) if !bytes.Equal(pubkey.Bytes(), val.PubKey.Bytes()) { abciResponses.EndBlock = &abci.ResponseEndBlock{ - ValidatorUpdates: []abci.Validator{ - types.TM2PB.ValidatorFromPubKeyAndPower(val.PubKey, 0), - types.TM2PB.ValidatorFromPubKeyAndPower(pubkey, 10), + ValidatorUpdates: []abci.ValidatorUpdate{ + types.TM2PB.NewValidatorUpdate(val.PubKey, 0), + types.TM2PB.NewValidatorUpdate(pubkey, 10), }, } } @@ -476,8 +476,8 @@ func makeHeaderPartsResponsesValPowerChange(state State, height int64, _, val := state.NextValidators.GetByIndex(0) if val.VotingPower != power { abciResponses.EndBlock = &abci.ResponseEndBlock{ - ValidatorUpdates: []abci.Validator{ - types.TM2PB.ValidatorFromPubKeyAndPower(val.PubKey, power), + ValidatorUpdates: []abci.ValidatorUpdate{ + types.TM2PB.NewValidatorUpdate(val.PubKey, power), }, } } diff --git a/types/proto3/block.proto b/types/proto3/block.proto index cefd180da..835d6b74b 100644 --- a/types/proto3/block.proto +++ b/types/proto3/block.proto @@ -30,13 +30,14 @@ message Header { // hashes from the app output from the prev block bytes ValidatorsHash = 9; // validators for the current block - bytes ConsensusHash = 10; // consensus params for current block - bytes AppHash = 11; // state after txs from the previous block - bytes LastResultsHash = 12; // root hash of all results from the txs from the previous block + bytes NextValidatorsHash = 10; // validators for the next block + bytes ConsensusHash = 11; // consensus params for current block + bytes AppHash = 12; // state after txs from the previous block + bytes LastResultsHash = 13; // root hash of all results from the txs from the previous block // consensus info - bytes EvidenceHash = 13; // evidence included in the block - bytes ProposerAddress = 14; // original proposer of the block + bytes EvidenceHash = 14; // evidence included in the block + bytes ProposerAddress = 15; // original proposer of the block } // Timestamp wraps how amino encodes time. Note that this is different from the protobuf well-known type diff --git a/types/protobuf.go b/types/protobuf.go index 1681dd376..30e74f15e 100644 --- a/types/protobuf.go +++ b/types/protobuf.go @@ -1,7 +1,6 @@ package types import ( - "bytes" "fmt" "reflect" "time" @@ -56,7 +55,7 @@ func (tm2pb) Header(header *Header) abci.Header { } } -func (tm2pb) ValidatorWithoutPubKey(val *Validator) abci.Validator { +func (tm2pb) Validator(val *Validator) abci.Validator { return abci.Validator{ Address: val.PubKey.Address(), Power: val.VotingPower, @@ -78,11 +77,10 @@ func (tm2pb) PartSetHeader(header PartSetHeader) abci.PartSetHeader { } // XXX: panics on unknown pubkey type -func (tm2pb) Validator(val *Validator) abci.Validator { - return abci.Validator{ - Address: val.PubKey.Address(), - PubKey: TM2PB.PubKey(val.PubKey), - Power: val.VotingPower, +func (tm2pb) ValidatorUpdate(val *Validator) abci.ValidatorUpdate { + return abci.ValidatorUpdate{ + PubKey: TM2PB.PubKey(val.PubKey), + Power: val.VotingPower, } } @@ -106,10 +104,10 @@ func (tm2pb) PubKey(pubKey crypto.PubKey) abci.PubKey { } // XXX: panics on nil or unknown pubkey type -func (tm2pb) Validators(vals *ValidatorSet) []abci.Validator { - validators := make([]abci.Validator, vals.Size()) +func (tm2pb) ValidatorUpdates(vals *ValidatorSet) []abci.ValidatorUpdate { + validators := make([]abci.ValidatorUpdate, vals.Size()) for i, val := range vals.Validators { - validators[i] = TM2PB.Validator(val) + validators[i] = TM2PB.ValidatorUpdate(val) } return validators } @@ -156,7 +154,7 @@ func (tm2pb) Evidence(ev Evidence, valSet *ValidatorSet, evTime time.Time) abci. return abci.Evidence{ Type: evType, - Validator: TM2PB.ValidatorWithoutPubKey(val), + Validator: TM2PB.Validator(val), Height: ev.Height(), Time: evTime, TotalVotingPower: valSet.TotalVotingPower(), @@ -164,12 +162,11 @@ func (tm2pb) Evidence(ev Evidence, valSet *ValidatorSet, evTime time.Time) abci. } // XXX: panics on nil or unknown pubkey type -func (tm2pb) ValidatorFromPubKeyAndPower(pubkey crypto.PubKey, power int64) abci.Validator { +func (tm2pb) NewValidatorUpdate(pubkey crypto.PubKey, power int64) abci.ValidatorUpdate { pubkeyABCI := TM2PB.PubKey(pubkey) - return abci.Validator{ - Address: pubkey.Address(), - PubKey: pubkeyABCI, - Power: power, + return abci.ValidatorUpdate{ + PubKey: pubkeyABCI, + Power: power, } } @@ -205,26 +202,14 @@ func (pb2tm) PubKey(pubKey abci.PubKey) (crypto.PubKey, error) { } } -func (pb2tm) Validators(vals []abci.Validator) ([]*Validator, error) { +func (pb2tm) ValidatorUpdates(vals []abci.ValidatorUpdate) ([]*Validator, error) { tmVals := make([]*Validator, len(vals)) for i, v := range vals { pub, err := PB2TM.PubKey(v.PubKey) if err != nil { return nil, err } - // If the app provided an address too, it must match. - // This is just a sanity check. - if len(v.Address) > 0 { - if !bytes.Equal(pub.Address(), v.Address) { - return nil, fmt.Errorf("Validator.Address (%X) does not match PubKey.Address (%X)", - v.Address, pub.Address()) - } - } - tmVals[i] = &Validator{ - Address: pub.Address(), - PubKey: pub, - VotingPower: v.Power, - } + tmVals[i] = NewValidator(pub, v.Power) } return tmVals, nil } diff --git a/types/protobuf_test.go b/types/protobuf_test.go index caad5c8f9..8bdf094ba 100644 --- a/types/protobuf_test.go +++ b/types/protobuf_test.go @@ -41,26 +41,26 @@ func TestABCIValidators(t *testing.T) { VotingPower: 10, } - abciVal := TM2PB.Validator(tmVal) - tmVals, err := PB2TM.Validators([]abci.Validator{abciVal}) + abciVal := TM2PB.ValidatorUpdate(tmVal) + tmVals, err := PB2TM.ValidatorUpdates([]abci.ValidatorUpdate{abciVal}) assert.Nil(t, err) assert.Equal(t, tmValExpected, tmVals[0]) - abciVals := TM2PB.Validators(NewValidatorSet(tmVals)) - assert.Equal(t, []abci.Validator{abciVal}, abciVals) + abciVals := TM2PB.ValidatorUpdates(NewValidatorSet(tmVals)) + assert.Equal(t, []abci.ValidatorUpdate{abciVal}, abciVals) // val with address tmVal.Address = pkEd.Address() - abciVal = TM2PB.Validator(tmVal) - tmVals, err = PB2TM.Validators([]abci.Validator{abciVal}) + abciVal = TM2PB.ValidatorUpdate(tmVal) + tmVals, err = PB2TM.ValidatorUpdates([]abci.ValidatorUpdate{abciVal}) assert.Nil(t, err) assert.Equal(t, tmValExpected, tmVals[0]) - // val with incorrect address - abciVal = TM2PB.Validator(tmVal) - abciVal.Address = []byte("incorrect!") - tmVals, err = PB2TM.Validators([]abci.Validator{abciVal}) + // val with incorrect pubkey data + abciVal = TM2PB.ValidatorUpdate(tmVal) + abciVal.PubKey.Data = []byte("incorrect!") + tmVals, err = PB2TM.ValidatorUpdates([]abci.ValidatorUpdate{abciVal}) assert.NotNil(t, err) assert.Nil(t, tmVals) } @@ -104,9 +104,6 @@ func TestABCIEvidence(t *testing.T) { ) assert.Equal(t, "duplicate/vote", abciEv.Type) - - // test we do not send pubkeys - assert.Empty(t, abciEv.Validator.PubKey) } type pubKeyEddie struct{} @@ -119,17 +116,17 @@ func (pubKeyEddie) Equals(crypto.PubKey) bool { return false } func TestABCIValidatorFromPubKeyAndPower(t *testing.T) { pubkey := ed25519.GenPrivKey().PubKey() - abciVal := TM2PB.ValidatorFromPubKeyAndPower(pubkey, 10) + abciVal := TM2PB.NewValidatorUpdate(pubkey, 10) assert.Equal(t, int64(10), abciVal.Power) - assert.Panics(t, func() { TM2PB.ValidatorFromPubKeyAndPower(nil, 10) }) - assert.Panics(t, func() { TM2PB.ValidatorFromPubKeyAndPower(pubKeyEddie{}, 10) }) + assert.Panics(t, func() { TM2PB.NewValidatorUpdate(nil, 10) }) + assert.Panics(t, func() { TM2PB.NewValidatorUpdate(pubKeyEddie{}, 10) }) } func TestABCIValidatorWithoutPubKey(t *testing.T) { pkEd := ed25519.GenPrivKey().PubKey() - abciVal := TM2PB.ValidatorWithoutPubKey(&Validator{ + abciVal := TM2PB.Validator(&Validator{ Address: pkEd.Address(), PubKey: pkEd, VotingPower: 10,