Browse Source

abci: Vote Extension 1 (#6646)

* add proto, add boilerplates

* add canonical

* fix tests

* add vote signing test

* Update internal/consensus/msgs_test.go

* modify state execution in progress

* add extension signing

* VoteExtension -> ExtendVote

* apply review

* update data structures

* Add comments

* Apply suggestions from code review

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>

* *Signed -> *ToSign

* add Vote to RequestExtendVote

* apply reviews

* Apply suggestions from code review

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>

* fix typo, modify proto

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
pull/7769/head
mconcat 3 years ago
committed by Sergio Mena
parent
commit
29f7573762
25 changed files with 2652 additions and 506 deletions
  1. +2
    -0
      abci/client/client.go
  2. +16
    -0
      abci/client/grpc_client.go
  3. +22
    -0
      abci/client/local_client.go
  4. +46
    -0
      abci/client/mocks/client.go
  5. +28
    -2
      abci/client/socket_client.go
  6. +3
    -3
      abci/example/kvstore/README.md
  7. +10
    -0
      abci/example/kvstore/persistent_kvstore.go
  8. +6
    -0
      abci/server/socket_server.go
  9. +22
    -0
      abci/types/application.go
  10. +24
    -0
      abci/types/messages.go
  11. +1457
    -316
      abci/types/types.pb.go
  12. +7
    -1
      internal/consensus/msgs_test.go
  13. +13
    -1
      internal/consensus/state.go
  14. +18
    -0
      internal/proxy/app_conn.go
  15. +46
    -0
      internal/proxy/mocks/app_conn_consensus.go
  16. +15
    -1
      internal/state/execution.go
  17. +6
    -2
      internal/state/execution_test.go
  18. +6
    -2
      privval/msgs_test.go
  19. +105
    -43
      proto/tendermint/types/canonical.pb.go
  20. +1
    -0
      proto/tendermint/types/canonical.proto
  21. +644
    -118
      proto/tendermint/types/types.pb.go
  22. +12
    -7
      types/block.go
  23. +16
    -6
      types/canonical.go
  24. +98
    -2
      types/vote.go
  25. +29
    -2
      types/vote_test.go

+ 2
- 0
abci/client/client.go View File

@ -46,6 +46,8 @@ type Client interface {
Commit(context.Context) (*types.ResponseCommit, error) Commit(context.Context) (*types.ResponseCommit, error)
InitChain(context.Context, types.RequestInitChain) (*types.ResponseInitChain, error) InitChain(context.Context, types.RequestInitChain) (*types.ResponseInitChain, error)
PrepareProposal(context.Context, types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) PrepareProposal(context.Context, types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)
ExtendVote(context.Context, types.RequestExtendVote) (*types.ResponseExtendVote, error)
VerifyVoteExtension(context.Context, types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)
BeginBlock(context.Context, types.RequestBeginBlock) (*types.ResponseBeginBlock, error) BeginBlock(context.Context, types.RequestBeginBlock) (*types.ResponseBeginBlock, error)
EndBlock(context.Context, types.RequestEndBlock) (*types.ResponseEndBlock, error) EndBlock(context.Context, types.RequestEndBlock) (*types.ResponseEndBlock, error)
ListSnapshots(context.Context, types.RequestListSnapshots) (*types.ResponseListSnapshots, error) ListSnapshots(context.Context, types.RequestListSnapshots) (*types.ResponseListSnapshots, error)


+ 16
- 0
abci/client/grpc_client.go View File

@ -376,3 +376,19 @@ func (cli *grpcClient) PrepareProposal(
req := types.ToRequestPrepareProposal(params) req := types.ToRequestPrepareProposal(params)
return cli.client.PrepareProposal(ctx, req.GetPrepareProposal(), grpc.WaitForReady(true)) return cli.client.PrepareProposal(ctx, req.GetPrepareProposal(), grpc.WaitForReady(true))
} }
func (cli *grpcClient) ExtendVote(
ctx context.Context,
params types.RequestExtendVote) (*types.ResponseExtendVote, error) {
req := types.ToRequestExtendVote(params)
return cli.client.ExtendVote(ctx, req.GetExtendVote(), grpc.WaitForReady(true))
}
func (cli *grpcClient) VerifyVoteExtension(
ctx context.Context,
params types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) {
req := types.ToRequestVerifyVoteExtension(params)
return cli.client.VerifyVoteExtension(ctx, req.GetVerifyVoteExtension(), grpc.WaitForReady(true))
}

+ 22
- 0
abci/client/local_client.go View File

@ -233,6 +233,28 @@ func (app *localClient) PrepareProposal(
return &res, nil return &res, nil
} }
func (app *localClient) ExtendVote(
ctx context.Context,
req types.RequestExtendVote) (*types.ResponseExtendVote, error) {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.ExtendVote(req)
return &res, nil
}
func (app *localClient) VerifyVoteExtension(
ctx context.Context,
req types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) {
app.mtx.Lock()
defer app.mtx.Unlock()
res := app.Application.VerifyVoteExtension(req)
return &res, nil
}
//------------------------------------------------------- //-------------------------------------------------------
func (app *localClient) callback(req *types.Request, res *types.Response) *ReqRes { func (app *localClient) callback(req *types.Request, res *types.Response) *ReqRes {


+ 46
- 0
abci/client/mocks/client.go View File

@ -238,6 +238,29 @@ func (_m *Client) Error() error {
return r0 return r0
} }
// ExtendVote provides a mock function with given fields: _a0, _a1
func (_m *Client) ExtendVote(_a0 context.Context, _a1 types.RequestExtendVote) (*types.ResponseExtendVote, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseExtendVote
if rf, ok := ret.Get(0).(func(context.Context, types.RequestExtendVote) *types.ResponseExtendVote); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseExtendVote)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestExtendVote) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Flush provides a mock function with given fields: _a0 // Flush provides a mock function with given fields: _a0
func (_m *Client) Flush(_a0 context.Context) error { func (_m *Client) Flush(_a0 context.Context) error {
ret := _m.Called(_a0) ret := _m.Called(_a0)
@ -483,6 +506,29 @@ func (_m *Client) String() string {
return r0 return r0
} }
// VerifyVoteExtension provides a mock function with given fields: _a0, _a1
func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseVerifyVoteExtension
if rf, ok := ret.Get(0).(func(context.Context, types.RequestVerifyVoteExtension) *types.ResponseVerifyVoteExtension); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseVerifyVoteExtension)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestVerifyVoteExtension) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Wait provides a mock function with given fields: // Wait provides a mock function with given fields:
func (_m *Client) Wait() { func (_m *Client) Wait() {
_m.Called() _m.Called()


+ 28
- 2
abci/client/socket_client.go View File

@ -415,6 +415,28 @@ func (cli *socketClient) PrepareProposal(
return reqres.Response.GetPrepareProposal(), nil return reqres.Response.GetPrepareProposal(), nil
} }
func (cli *socketClient) ExtendVote(
ctx context.Context,
req types.RequestExtendVote) (*types.ResponseExtendVote, error) {
reqres, err := cli.queueRequestAndFlush(ctx, types.ToRequestExtendVote(req))
if err != nil {
return nil, err
}
return reqres.Response.GetExtendVote(), nil
}
func (cli *socketClient) VerifyVoteExtension(
ctx context.Context,
req types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) {
reqres, err := cli.queueRequestAndFlush(ctx, types.ToRequestVerifyVoteExtension(req))
if err != nil {
return nil, err
}
return reqres.Response.GetVerifyVoteExtension(), nil
}
//---------------------------------------- //----------------------------------------
// queueRequest enqueues req onto the queue. If the queue is full, it ether // queueRequest enqueues req onto the queue. If the queue is full, it ether
@ -526,6 +548,12 @@ func resMatchesReq(req *types.Request, res *types.Response) (ok bool) {
_, ok = res.Value.(*types.Response_Query) _, ok = res.Value.(*types.Response_Query)
case *types.Request_InitChain: case *types.Request_InitChain:
_, ok = res.Value.(*types.Response_InitChain) _, ok = res.Value.(*types.Response_InitChain)
case *types.Request_PrepareProposal:
_, ok = res.Value.(*types.Response_PrepareProposal)
case *types.Request_ExtendVote:
_, ok = res.Value.(*types.Response_ExtendVote)
case *types.Request_VerifyVoteExtension:
_, ok = res.Value.(*types.Response_VerifyVoteExtension)
case *types.Request_BeginBlock: case *types.Request_BeginBlock:
_, ok = res.Value.(*types.Response_BeginBlock) _, ok = res.Value.(*types.Response_BeginBlock)
case *types.Request_EndBlock: case *types.Request_EndBlock:
@ -538,8 +566,6 @@ func resMatchesReq(req *types.Request, res *types.Response) (ok bool) {
_, ok = res.Value.(*types.Response_ListSnapshots) _, ok = res.Value.(*types.Response_ListSnapshots)
case *types.Request_OfferSnapshot: case *types.Request_OfferSnapshot:
_, ok = res.Value.(*types.Response_OfferSnapshot) _, ok = res.Value.(*types.Response_OfferSnapshot)
case *types.Request_PrepareProposal:
_, ok = res.Value.(*types.Response_PrepareProposal)
} }
return ok return ok
} }


+ 3
- 3
abci/example/kvstore/README.md View File

@ -4,7 +4,7 @@ There are two app's here: the KVStoreApplication and the PersistentKVStoreApplic
## KVStoreApplication ## KVStoreApplication
The KVStoreApplication is a simple merkle key-value store.
The KVStoreApplication is a simple merkle key-value store.
Transactions of the form `key=value` are stored as key-value pairs in the tree. Transactions of the form `key=value` are stored as key-value pairs in the tree.
Transactions without an `=` sign set the value to the key. Transactions without an `=` sign set the value to the key.
The app has no replay protection (other than what the mempool provides). The app has no replay protection (other than what the mempool provides).
@ -12,7 +12,7 @@ The app has no replay protection (other than what the mempool provides).
## PersistentKVStoreApplication ## PersistentKVStoreApplication
The PersistentKVStoreApplication wraps the KVStoreApplication The PersistentKVStoreApplication wraps the KVStoreApplication
and provides two additional features:
and provides three additional features:
1) persistence of state across app restarts (using Tendermint's ABCI-Handshake mechanism) 1) persistence of state across app restarts (using Tendermint's ABCI-Handshake mechanism)
2) validator set changes 2) validator set changes
@ -27,4 +27,4 @@ Validator set changes are effected using the following transaction format:
where `pubkeyN` is a base64-encoded 32-byte ed25519 key and `powerN` is a new voting power for the validator with `pubkeyN` (possibly a new one). where `pubkeyN` is a base64-encoded 32-byte ed25519 key and `powerN` is a new voting power for the validator with `pubkeyN` (possibly a new one).
To remove a validator from the validator set, set power to `0`. To remove a validator from the validator set, set power to `0`.
There is no sybil protection against new validators joining.
There is no sybil protection against new validators joining.

+ 10
- 0
abci/example/kvstore/persistent_kvstore.go View File

@ -166,6 +166,16 @@ func (app *PersistentKVStoreApplication) ApplySnapshotChunk(
return types.ResponseApplySnapshotChunk{Result: types.ResponseApplySnapshotChunk_ABORT} return types.ResponseApplySnapshotChunk{Result: types.ResponseApplySnapshotChunk_ABORT}
} }
func (app *PersistentKVStoreApplication) ExtendVote(
req types.RequestExtendVote) types.ResponseExtendVote {
return types.ResponseExtendVote{}
}
func (app *PersistentKVStoreApplication) VerifyVoteExtension(
req types.RequestVerifyVoteExtension) types.ResponseVerifyVoteExtension {
return types.ResponseVerifyVoteExtension{}
}
func (app *PersistentKVStoreApplication) PrepareProposal( func (app *PersistentKVStoreApplication) PrepareProposal(
req types.RequestPrepareProposal) types.ResponsePrepareProposal { req types.RequestPrepareProposal) types.ResponsePrepareProposal {
if len(req.BlockData) >= 1 { if len(req.BlockData) >= 1 {


+ 6
- 0
abci/server/socket_server.go View File

@ -249,6 +249,12 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types
case *types.Request_ApplySnapshotChunk: case *types.Request_ApplySnapshotChunk:
res := s.app.ApplySnapshotChunk(*r.ApplySnapshotChunk) res := s.app.ApplySnapshotChunk(*r.ApplySnapshotChunk)
responses <- types.ToResponseApplySnapshotChunk(res) responses <- types.ToResponseApplySnapshotChunk(res)
case *types.Request_ExtendVote:
res := s.app.ExtendVote(*r.ExtendVote)
responses <- types.ToResponseExtendVote(res)
case *types.Request_VerifyVoteExtension:
res := s.app.VerifyVoteExtension(*r.VerifyVoteExtension)
responses <- types.ToResponseVerifyVoteExtension(res)
default: default:
responses <- types.ToResponseException("Unknown request") responses <- types.ToResponseException("Unknown request")
} }


+ 22
- 0
abci/types/application.go View File

@ -23,6 +23,8 @@ type Application interface {
DeliverTx(RequestDeliverTx) ResponseDeliverTx // Deliver a tx for full processing DeliverTx(RequestDeliverTx) ResponseDeliverTx // Deliver a tx for full processing
EndBlock(RequestEndBlock) ResponseEndBlock // Signals the end of a block, returns changes to the validator set EndBlock(RequestEndBlock) ResponseEndBlock // Signals the end of a block, returns changes to the validator set
Commit() ResponseCommit // Commit the state and return the application Merkle root hash Commit() ResponseCommit // Commit the state and return the application Merkle root hash
ExtendVote(RequestExtendVote) ResponseExtendVote // Create application specific vote extension
VerifyVoteExtension(RequestVerifyVoteExtension) ResponseVerifyVoteExtension // Verify application's vote extension data
// State Sync Connection // State Sync Connection
ListSnapshots(RequestListSnapshots) ResponseListSnapshots // List available snapshots ListSnapshots(RequestListSnapshots) ResponseListSnapshots // List available snapshots
@ -59,6 +61,14 @@ func (BaseApplication) Commit() ResponseCommit {
return ResponseCommit{} return ResponseCommit{}
} }
func (BaseApplication) ExtendVote(req RequestExtendVote) ResponseExtendVote {
return ResponseExtendVote{}
}
func (BaseApplication) VerifyVoteExtension(req RequestVerifyVoteExtension) ResponseVerifyVoteExtension {
return ResponseVerifyVoteExtension{}
}
func (BaseApplication) Query(req RequestQuery) ResponseQuery { func (BaseApplication) Query(req RequestQuery) ResponseQuery {
return ResponseQuery{Code: CodeTypeOK} return ResponseQuery{Code: CodeTypeOK}
} }
@ -178,6 +188,18 @@ func (app *GRPCApplication) ApplySnapshotChunk(
return &res, nil return &res, nil
} }
func (app *GRPCApplication) ExtendVote(
ctx context.Context, req *RequestExtendVote) (*ResponseExtendVote, error) {
res := app.app.ExtendVote(*req)
return &res, nil
}
func (app *GRPCApplication) VerifyVoteExtension(
ctx context.Context, req *RequestVerifyVoteExtension) (*ResponseVerifyVoteExtension, error) {
res := app.app.VerifyVoteExtension(*req)
return &res, nil
}
func (app *GRPCApplication) PrepareProposal( func (app *GRPCApplication) PrepareProposal(
ctx context.Context, req *RequestPrepareProposal) (*ResponsePrepareProposal, error) { ctx context.Context, req *RequestPrepareProposal) (*ResponsePrepareProposal, error) {
res := app.app.PrepareProposal(*req) res := app.app.PrepareProposal(*req)


+ 24
- 0
abci/types/messages.go View File

@ -110,6 +110,18 @@ func ToRequestApplySnapshotChunk(req RequestApplySnapshotChunk) *Request {
} }
} }
func ToRequestExtendVote(req RequestExtendVote) *Request {
return &Request{
Value: &Request_ExtendVote{&req},
}
}
func ToRequestVerifyVoteExtension(req RequestVerifyVoteExtension) *Request {
return &Request{
Value: &Request_VerifyVoteExtension{&req},
}
}
func ToRequestPrepareProposal(req RequestPrepareProposal) *Request { func ToRequestPrepareProposal(req RequestPrepareProposal) *Request {
return &Request{ return &Request{
Value: &Request_PrepareProposal{&req}, Value: &Request_PrepareProposal{&req},
@ -207,6 +219,18 @@ func ToResponseApplySnapshotChunk(res ResponseApplySnapshotChunk) *Response {
} }
} }
func ToResponseExtendVote(res ResponseExtendVote) *Response {
return &Response{
Value: &Response_ExtendVote{&res},
}
}
func ToResponseVerifyVoteExtension(res ResponseVerifyVoteExtension) *Response {
return &Response{
Value: &Response_VerifyVoteExtension{&res},
}
}
func ToResponsePrepareProposal(res ResponsePrepareProposal) *Response { func ToResponsePrepareProposal(res ResponsePrepareProposal) *Response {
return &Response{ return &Response{
Value: &Response_PrepareProposal{&res}, Value: &Response_PrepareProposal{&res},


+ 1457
- 316
abci/types/types.pb.go
File diff suppressed because it is too large
View File


+ 7
- 1
internal/consensus/msgs_test.go View File

@ -357,6 +357,11 @@ func TestConsMsgsVectors(t *testing.T) {
} }
pbProposal := proposal.ToProto() pbProposal := proposal.ToProto()
ext := types.VoteExtension{
AppDataToSign: []byte("signed"),
AppDataSelfAuthenticating: []byte("auth"),
}
v := &types.Vote{ v := &types.Vote{
ValidatorAddress: []byte("add_more_exclamation"), ValidatorAddress: []byte("add_more_exclamation"),
ValidatorIndex: 1, ValidatorIndex: 1,
@ -365,6 +370,7 @@ func TestConsMsgsVectors(t *testing.T) {
Timestamp: date, Timestamp: date,
Type: tmproto.PrecommitType, Type: tmproto.PrecommitType,
BlockID: bi, BlockID: bi,
VoteExtension: ext,
} }
vpb := v.ToProto() vpb := v.ToProto()
@ -401,7 +407,7 @@ func TestConsMsgsVectors(t *testing.T) {
"2a36080110011a3008011204746573741a26080110011a206164645f6d6f72655f6578636c616d6174696f6e5f6d61726b735f636f64652d"}, "2a36080110011a3008011204746573741a26080110011a206164645f6d6f72655f6578636c616d6174696f6e5f6d61726b735f636f64652d"},
{"Vote", &tmcons.Message{Sum: &tmcons.Message_Vote{ {"Vote", &tmcons.Message{Sum: &tmcons.Message_Vote{
Vote: &tmcons.Vote{Vote: vpb}}}, Vote: &tmcons.Vote{Vote: vpb}}},
"32700a6e0802100122480a206164645f6d6f72655f6578636c616d6174696f6e5f6d61726b735f636f64652d1224080112206164645f6d6f72655f6578636c616d6174696f6e5f6d61726b735f636f64652d2a0608c0b89fdc0532146164645f6d6f72655f6578636c616d6174696f6e3801"},
"3280010a7e0802100122480a206164645f6d6f72655f6578636c616d6174696f6e5f6d61726b735f636f64652d1224080112206164645f6d6f72655f6578636c616d6174696f6e5f6d61726b735f636f64652d2a0608c0b89fdc0532146164645f6d6f72655f6578636c616d6174696f6e38014a0e0a067369676e6564120461757468"},
{"HasVote", &tmcons.Message{Sum: &tmcons.Message_HasVote{ {"HasVote", &tmcons.Message{Sum: &tmcons.Message_HasVote{
HasVote: &tmcons.HasVote{Height: 1, Round: 1, Type: tmproto.PrevoteType, Index: 1}}}, HasVote: &tmcons.HasVote{Height: 1, Round: 1, Type: tmproto.PrevoteType, Index: 1}}},
"3a080801100118012001"}, "3a080801100118012001"},


+ 13
- 1
internal/consensus/state.go View File

@ -2379,6 +2379,12 @@ func (cs *State) signVote(
switch msgType { switch msgType {
case tmproto.PrecommitType: case tmproto.PrecommitType:
timeout = cs.config.TimeoutPrecommit timeout = cs.config.TimeoutPrecommit
// if the signedMessage type is for a precommit, add VoteExtension
ext, err := cs.blockExec.ExtendVote(vote)
if err != nil {
return nil, err
}
vote.VoteExtension = ext
case tmproto.PrevoteType: case tmproto.PrevoteType:
timeout = cs.config.TimeoutPrevote timeout = cs.config.TimeoutPrevote
default: default:
@ -2392,11 +2398,17 @@ func (cs *State) signVote(
vote.Signature = v.Signature vote.Signature = v.Signature
vote.Timestamp = v.Timestamp vote.Timestamp = v.Timestamp
return vote, err return vote, err
} }
// sign the vote and publish on internalMsgQueue // sign the vote and publish on internalMsgQueue
func (cs *State) signAddVote(ctx context.Context, msgType tmproto.SignedMsgType, hash []byte, header types.PartSetHeader) *types.Vote {
func (cs *State) signAddVote(
ctx context.Context,
msgType tmproto.SignedMsgType,
hash []byte,
header types.PartSetHeader,
) *types.Vote {
if cs.privValidator == nil { // the node does not have a key if cs.privValidator == nil { // the node does not have a key
return nil return nil
} }


+ 18
- 0
internal/proxy/app_conn.go View File

@ -21,6 +21,8 @@ type AppConnConsensus interface {
InitChain(context.Context, types.RequestInitChain) (*types.ResponseInitChain, error) InitChain(context.Context, types.RequestInitChain) (*types.ResponseInitChain, error)
PrepareProposal(context.Context, types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) PrepareProposal(context.Context, types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)
ExtendVote(context.Context, types.RequestExtendVote) (*types.ResponseExtendVote, error)
VerifyVoteExtension(context.Context, types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)
BeginBlock(context.Context, types.RequestBeginBlock) (*types.ResponseBeginBlock, error) BeginBlock(context.Context, types.RequestBeginBlock) (*types.ResponseBeginBlock, error)
DeliverTx(context.Context, types.RequestDeliverTx) (*types.ResponseDeliverTx, error) DeliverTx(context.Context, types.RequestDeliverTx) (*types.ResponseDeliverTx, error)
EndBlock(context.Context, types.RequestEndBlock) (*types.ResponseEndBlock, error) EndBlock(context.Context, types.RequestEndBlock) (*types.ResponseEndBlock, error)
@ -96,6 +98,22 @@ func (app *appConnConsensus) PrepareProposal(
return app.appConn.PrepareProposal(ctx, req) return app.appConn.PrepareProposal(ctx, req)
} }
func (app *appConnConsensus) ExtendVote(
ctx context.Context,
req types.RequestExtendVote,
) (*types.ResponseExtendVote, error) {
defer addTimeSample(app.metrics.MethodTiming.With("method", "extend_vote", "type", "sync"))()
return app.appConn.ExtendVote(ctx, req)
}
func (app *appConnConsensus) VerifyVoteExtension(
ctx context.Context,
req types.RequestVerifyVoteExtension,
) (*types.ResponseVerifyVoteExtension, error) {
defer addTimeSample(app.metrics.MethodTiming.With("method", "verify_vote_extension", "type", "sync"))()
return app.appConn.VerifyVoteExtension(ctx, req)
}
func (app *appConnConsensus) BeginBlock( func (app *appConnConsensus) BeginBlock(
ctx context.Context, ctx context.Context,
req types.RequestBeginBlock, req types.RequestBeginBlock,


+ 46
- 0
internal/proxy/mocks/app_conn_consensus.go View File

@ -123,6 +123,29 @@ func (_m *AppConnConsensus) Error() error {
return r0 return r0
} }
// ExtendVote provides a mock function with given fields: _a0, _a1
func (_m *AppConnConsensus) ExtendVote(_a0 context.Context, _a1 types.RequestExtendVote) (*types.ResponseExtendVote, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseExtendVote
if rf, ok := ret.Get(0).(func(context.Context, types.RequestExtendVote) *types.ResponseExtendVote); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseExtendVote)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestExtendVote) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// InitChain provides a mock function with given fields: _a0, _a1 // InitChain provides a mock function with given fields: _a0, _a1
func (_m *AppConnConsensus) InitChain(_a0 context.Context, _a1 types.RequestInitChain) (*types.ResponseInitChain, error) { func (_m *AppConnConsensus) InitChain(_a0 context.Context, _a1 types.RequestInitChain) (*types.ResponseInitChain, error) {
ret := _m.Called(_a0, _a1) ret := _m.Called(_a0, _a1)
@ -173,3 +196,26 @@ func (_m *AppConnConsensus) PrepareProposal(_a0 context.Context, _a1 types.Reque
func (_m *AppConnConsensus) SetResponseCallback(_a0 abciclient.Callback) { func (_m *AppConnConsensus) SetResponseCallback(_a0 abciclient.Callback) {
_m.Called(_a0) _m.Called(_a0)
} }
// VerifyVoteExtension provides a mock function with given fields: _a0, _a1
func (_m *AppConnConsensus) VerifyVoteExtension(_a0 context.Context, _a1 types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseVerifyVoteExtension
if rf, ok := ret.Get(0).(func(context.Context, types.RequestVerifyVoteExtension) *types.ResponseVerifyVoteExtension); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseVerifyVoteExtension)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestVerifyVoteExtension) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}

+ 15
- 1
internal/state/execution.go View File

@ -260,6 +260,20 @@ func (blockExec *BlockExecutor) ApplyBlock(
return state, nil return state, nil
} }
func (blockExec *BlockExecutor) ExtendVote(vote *types.Vote) (types.VoteExtension, error) {
ctx := context.TODO()
req := abci.RequestExtendVote{
Vote: vote.ToProto(),
}
resp, err := blockExec.proxyApp.ExtendVote(ctx, req)
if err != nil {
return types.VoteExtension{}, err
}
return types.VoteExtensionFromProto(resp.VoteExtension), nil
}
// Commit locks the mempool, runs the ABCI Commit message, and updates the // Commit locks the mempool, runs the ABCI Commit message, and updates the
// mempool. // mempool.
// It returns the result of calling abci.Commit (the AppHash) and the height to retain (if any). // It returns the result of calling abci.Commit (the AppHash) and the height to retain (if any).
@ -497,7 +511,7 @@ func updateState(
nextVersion := state.Version nextVersion := state.Version
// NOTE: the AppHash has not been populated.
// NOTE: the AppHash and the VoteExtension has not been populated.
// It will be filled on state.Save. // It will be filled on state.Save.
return State{ return State{
Version: nextVersion, Version: nextVersion,


+ 6
- 2
internal/state/execution_test.go View File

@ -90,11 +90,15 @@ func TestBeginBlockValidators(t *testing.T) {
commitSig0 = types.NewCommitSigForBlock( commitSig0 = types.NewCommitSigForBlock(
[]byte("Signature1"), []byte("Signature1"),
state.Validators.Validators[0].Address, state.Validators.Validators[0].Address,
now)
now,
types.VoteExtensionToSign{},
)
commitSig1 = types.NewCommitSigForBlock( commitSig1 = types.NewCommitSigForBlock(
[]byte("Signature2"), []byte("Signature2"),
state.Validators.Validators[1].Address, state.Validators.Validators[1].Address,
now)
now,
types.VoteExtensionToSign{},
)
absentSig = types.NewCommitSigAbsent() absentSig = types.NewCommitSigAbsent()
) )


+ 6
- 2
privval/msgs_test.go View File

@ -35,6 +35,10 @@ func exampleVote() *types.Vote {
}, },
ValidatorAddress: crypto.AddressHash([]byte("validator_address")), ValidatorAddress: crypto.AddressHash([]byte("validator_address")),
ValidatorIndex: 56789, ValidatorIndex: 56789,
VoteExtension: types.VoteExtension {
AppDataToSign: []byte("app_data_signed"),
AppDataSelfAuthenticating: []byte("app_data_self_authenticating"),
},
} }
} }
@ -83,8 +87,8 @@ func TestPrivvalVectors(t *testing.T) {
{"pubKey request", &privproto.PubKeyRequest{}, "0a00"}, {"pubKey request", &privproto.PubKeyRequest{}, "0a00"},
{"pubKey response", &privproto.PubKeyResponse{PubKey: ppk, Error: nil}, "12240a220a20556a436f1218d30942efe798420f51dc9b6a311b929c578257457d05c5fcf230"}, {"pubKey response", &privproto.PubKeyResponse{PubKey: ppk, Error: nil}, "12240a220a20556a436f1218d30942efe798420f51dc9b6a311b929c578257457d05c5fcf230"},
{"pubKey response with error", &privproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: remoteError}, "12140a0012100801120c697427732061206572726f72"}, {"pubKey response with error", &privproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: remoteError}, "12140a0012100801120c697427732061206572726f72"},
{"Vote Request", &privproto.SignVoteRequest{Vote: votepb}, "1a760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"},
{"Vote Response", &privproto.SignedVoteResponse{Vote: *votepb, Error: nil}, "22760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"},
{"Vote Request", &privproto.SignVoteRequest{Vote: votepb}, "1aa8010aa501080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb034a2f0a0f6170705f646174615f7369676e6564121c6170705f646174615f73656c665f61757468656e7469636174696e67"},
{"Vote Response", &privproto.SignedVoteResponse{Vote: *votepb, Error: nil}, "22a8010aa501080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb034a2f0a0f6170705f646174615f7369676e6564121c6170705f646174615f73656c665f61757468656e7469636174696e67"},
{"Vote Response with error", &privproto.SignedVoteResponse{Vote: tmproto.Vote{}, Error: remoteError}, "22250a11220212002a0b088092b8c398feffffff0112100801120c697427732061206572726f72"}, {"Vote Response with error", &privproto.SignedVoteResponse{Vote: tmproto.Vote{}, Error: remoteError}, "22250a11220212002a0b088092b8c398feffffff0112100801120c697427732061206572726f72"},
{"Proposal Request", &privproto.SignProposalRequest{Proposal: proposalpb}, "2a700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, {"Proposal Request", &privproto.SignProposalRequest{Proposal: proposalpb}, "2a700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"},
{"Proposal Response", &privproto.SignedProposalResponse{Proposal: *proposalpb, Error: nil}, "32700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, {"Proposal Response", &privproto.SignedProposalResponse{Proposal: *proposalpb, Error: nil}, "32700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"},


+ 105
- 43
proto/tendermint/types/canonical.pb.go View File

@ -225,12 +225,13 @@ func (m *CanonicalProposal) GetChainID() string {
} }
type CanonicalVote struct { type CanonicalVote struct {
Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"`
Height int64 `protobuf:"fixed64,2,opt,name=height,proto3" json:"height,omitempty"`
Round int64 `protobuf:"fixed64,3,opt,name=round,proto3" json:"round,omitempty"`
BlockID *CanonicalBlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"`
Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
ChainID string `protobuf:"bytes,6,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"`
Height int64 `protobuf:"fixed64,2,opt,name=height,proto3" json:"height,omitempty"`
Round int64 `protobuf:"fixed64,3,opt,name=round,proto3" json:"round,omitempty"`
BlockID *CanonicalBlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"`
Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
ChainID string `protobuf:"bytes,6,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
VoteExtension *VoteExtensionToSign `protobuf:"bytes,7,opt,name=vote_extension,json=voteExtension,proto3" json:"vote_extension,omitempty"`
} }
func (m *CanonicalVote) Reset() { *m = CanonicalVote{} } func (m *CanonicalVote) Reset() { *m = CanonicalVote{} }
@ -308,6 +309,13 @@ func (m *CanonicalVote) GetChainID() string {
return "" return ""
} }
func (m *CanonicalVote) GetVoteExtension() *VoteExtensionToSign {
if m != nil {
return m.VoteExtension
}
return nil
}
func init() { func init() {
proto.RegisterType((*CanonicalBlockID)(nil), "tendermint.types.CanonicalBlockID") proto.RegisterType((*CanonicalBlockID)(nil), "tendermint.types.CanonicalBlockID")
proto.RegisterType((*CanonicalPartSetHeader)(nil), "tendermint.types.CanonicalPartSetHeader") proto.RegisterType((*CanonicalPartSetHeader)(nil), "tendermint.types.CanonicalPartSetHeader")
@ -318,38 +326,40 @@ func init() {
func init() { proto.RegisterFile("tendermint/types/canonical.proto", fileDescriptor_8d1a1a84ff7267ed) } func init() { proto.RegisterFile("tendermint/types/canonical.proto", fileDescriptor_8d1a1a84ff7267ed) }
var fileDescriptor_8d1a1a84ff7267ed = []byte{ var fileDescriptor_8d1a1a84ff7267ed = []byte{
// 487 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x53, 0x3d, 0x6f, 0xd3, 0x40,
0x18, 0xce, 0xa5, 0x4e, 0xe2, 0x5c, 0x1b, 0x08, 0xa7, 0xaa, 0xb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 0xe5, 0xcc, 0x50, 0xff, 0x7a, 0xbb, 0xe8, 0xbe, 0xbf,
0x2b, 0x35, 0xe9, 0xbe, 0xd4, 0xa4, 0x1f, 0xa5, 0x26, 0xdd, 0x2e, 0xb5, 0xc6, 0xfd, 0x52, 0x6b,
0x7c, 0x5d, 0x6a, 0x8d, 0x0f, 0x2f, 0xc2, 0x98, 0x45, 0xf3, 0xa9, 0xed, 0xd3, 0x99, 0xb3, 0xfd,
0xf7, 0xaf, 0xc3, 0xea, 0x99, 0xd8, 0x7d, 0x1a, 0xa6, 0x6d, 0x51, 0x3f, 0xfd, 0x15, 0x00, 0x00,
0xff, 0xff, 0x4e, 0x61, 0xcb, 0xc4, 0x7f, 0x04, 0x00, 0x00,
} }
func (m *CanonicalBlockID) Marshal() (dAtA []byte, err error) { func (m *CanonicalBlockID) Marshal() (dAtA []byte, err error) {
@ -519,6 +529,18 @@ func (m *CanonicalVote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if m.VoteExtension != nil {
{
size, err := m.VoteExtension.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintCanonical(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x3a
}
if len(m.ChainID) > 0 { if len(m.ChainID) > 0 {
i -= len(m.ChainID) i -= len(m.ChainID)
copy(dAtA[i:], m.ChainID) copy(dAtA[i:], m.ChainID)
@ -526,12 +548,12 @@ func (m *CanonicalVote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i-- i--
dAtA[i] = 0x32 dAtA[i] = 0x32
} }
n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
if err4 != nil {
return 0, err4
n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
if err5 != nil {
return 0, err5
} }
i -= n4
i = encodeVarintCanonical(dAtA, i, uint64(n4))
i -= n5
i = encodeVarintCanonical(dAtA, i, uint64(n5))
i-- i--
dAtA[i] = 0x2a dAtA[i] = 0x2a
if m.BlockID != nil { if m.BlockID != nil {
@ -664,6 +686,10 @@ func (m *CanonicalVote) Size() (n int) {
if l > 0 { if l > 0 {
n += 1 + l + sovCanonical(uint64(l)) n += 1 + l + sovCanonical(uint64(l))
} }
if m.VoteExtension != nil {
l = m.VoteExtension.Size()
n += 1 + l + sovCanonical(uint64(l))
}
return n return n
} }
@ -1271,6 +1297,42 @@ func (m *CanonicalVote) Unmarshal(dAtA []byte) error {
} }
m.ChainID = string(dAtA[iNdEx:postIndex]) m.ChainID = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex iNdEx = postIndex
case 7:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field VoteExtension", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCanonical
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthCanonical
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthCanonical
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.VoteExtension == nil {
m.VoteExtension = &VoteExtensionToSign{}
}
if err := m.VoteExtension.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipCanonical(dAtA[iNdEx:]) skippy, err := skipCanonical(dAtA[iNdEx:])


+ 1
- 0
proto/tendermint/types/canonical.proto View File

@ -34,4 +34,5 @@ message CanonicalVote {
CanonicalBlockID block_id = 4 [(gogoproto.customname) = "BlockID"]; CanonicalBlockID block_id = 4 [(gogoproto.customname) = "BlockID"];
google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
string chain_id = 6 [(gogoproto.customname) = "ChainID"]; string chain_id = 6 [(gogoproto.customname) = "ChainID"];
VoteExtensionToSign vote_extension = 7;
} }

+ 644
- 118
proto/tendermint/types/types.pb.go View File

@ -466,14 +466,15 @@ func (m *Data) GetTxs() [][]byte {
// Vote represents a prevote, precommit, or commit vote from validators for // Vote represents a prevote, precommit, or commit vote from validators for
// consensus. // consensus.
type Vote struct { type Vote struct {
Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"`
Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
Round int32 `protobuf:"varint,3,opt,name=round,proto3" json:"round,omitempty"`
BlockID BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id"`
Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
ValidatorAddress []byte `protobuf:"bytes,6,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
ValidatorIndex int32 `protobuf:"varint,7,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty"`
Signature []byte `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty"`
Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"`
Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
Round int32 `protobuf:"varint,3,opt,name=round,proto3" json:"round,omitempty"`
BlockID BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id"`
Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
ValidatorAddress []byte `protobuf:"bytes,6,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
ValidatorIndex int32 `protobuf:"varint,7,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty"`
Signature []byte `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty"`
VoteExtension *VoteExtension `protobuf:"bytes,9,opt,name=vote_extension,json=voteExtension,proto3" json:"vote_extension,omitempty"`
} }
func (m *Vote) Reset() { *m = Vote{} } func (m *Vote) Reset() { *m = Vote{} }
@ -565,6 +566,112 @@ func (m *Vote) GetSignature() []byte {
return nil return nil
} }
func (m *Vote) GetVoteExtension() *VoteExtension {
if m != nil {
return m.VoteExtension
}
return nil
}
// VoteExtension is app-defined additional information to the validator votes.
type VoteExtension struct {
AppDataToSign []byte `protobuf:"bytes,1,opt,name=app_data_to_sign,json=appDataToSign,proto3" json:"app_data_to_sign,omitempty"`
AppDataSelfAuthenticating []byte `protobuf:"bytes,2,opt,name=app_data_self_authenticating,json=appDataSelfAuthenticating,proto3" json:"app_data_self_authenticating,omitempty"`
}
func (m *VoteExtension) Reset() { *m = VoteExtension{} }
func (m *VoteExtension) String() string { return proto.CompactTextString(m) }
func (*VoteExtension) ProtoMessage() {}
func (*VoteExtension) Descriptor() ([]byte, []int) {
return fileDescriptor_d3a6e55e2345de56, []int{6}
}
func (m *VoteExtension) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *VoteExtension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_VoteExtension.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *VoteExtension) XXX_Merge(src proto.Message) {
xxx_messageInfo_VoteExtension.Merge(m, src)
}
func (m *VoteExtension) XXX_Size() int {
return m.Size()
}
func (m *VoteExtension) XXX_DiscardUnknown() {
xxx_messageInfo_VoteExtension.DiscardUnknown(m)
}
var xxx_messageInfo_VoteExtension proto.InternalMessageInfo
func (m *VoteExtension) GetAppDataToSign() []byte {
if m != nil {
return m.AppDataToSign
}
return nil
}
func (m *VoteExtension) GetAppDataSelfAuthenticating() []byte {
if m != nil {
return m.AppDataSelfAuthenticating
}
return nil
}
// VoteExtensionToSign is a subset of VoteExtension that is signed by the validators private key.
// VoteExtensionToSign is extracted from an existing VoteExtension.
type VoteExtensionToSign struct {
AppDataToSign []byte `protobuf:"bytes,1,opt,name=app_data_to_sign,json=appDataToSign,proto3" json:"app_data_to_sign,omitempty"`
}
func (m *VoteExtensionToSign) Reset() { *m = VoteExtensionToSign{} }
func (m *VoteExtensionToSign) String() string { return proto.CompactTextString(m) }
func (*VoteExtensionToSign) ProtoMessage() {}
func (*VoteExtensionToSign) Descriptor() ([]byte, []int) {
return fileDescriptor_d3a6e55e2345de56, []int{7}
}
func (m *VoteExtensionToSign) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *VoteExtensionToSign) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_VoteExtensionToSign.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *VoteExtensionToSign) XXX_Merge(src proto.Message) {
xxx_messageInfo_VoteExtensionToSign.Merge(m, src)
}
func (m *VoteExtensionToSign) XXX_Size() int {
return m.Size()
}
func (m *VoteExtensionToSign) XXX_DiscardUnknown() {
xxx_messageInfo_VoteExtensionToSign.DiscardUnknown(m)
}
var xxx_messageInfo_VoteExtensionToSign proto.InternalMessageInfo
func (m *VoteExtensionToSign) GetAppDataToSign() []byte {
if m != nil {
return m.AppDataToSign
}
return nil
}
// Commit contains the evidence that a block was committed by a set of // Commit contains the evidence that a block was committed by a set of
// validators. // validators.
type Commit struct { type Commit struct {
@ -578,7 +685,7 @@ func (m *Commit) Reset() { *m = Commit{} }
func (m *Commit) String() string { return proto.CompactTextString(m) } func (m *Commit) String() string { return proto.CompactTextString(m) }
func (*Commit) ProtoMessage() {} func (*Commit) ProtoMessage() {}
func (*Commit) Descriptor() ([]byte, []int) { func (*Commit) Descriptor() ([]byte, []int) {
return fileDescriptor_d3a6e55e2345de56, []int{6}
return fileDescriptor_d3a6e55e2345de56, []int{8}
} }
func (m *Commit) XXX_Unmarshal(b []byte) error { func (m *Commit) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -637,17 +744,18 @@ func (m *Commit) GetSignatures() []CommitSig {
// CommitSig is a part of the Vote included in a Commit. // CommitSig is a part of the Vote included in a Commit.
type CommitSig struct { type CommitSig struct {
BlockIdFlag BlockIDFlag `protobuf:"varint,1,opt,name=block_id_flag,json=blockIdFlag,proto3,enum=tendermint.types.BlockIDFlag" json:"block_id_flag,omitempty"`
ValidatorAddress []byte `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
Timestamp time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"`
BlockIdFlag BlockIDFlag `protobuf:"varint,1,opt,name=block_id_flag,json=blockIdFlag,proto3,enum=tendermint.types.BlockIDFlag" json:"block_id_flag,omitempty"`
ValidatorAddress []byte `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
Timestamp time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"`
VoteExtension *VoteExtensionToSign `protobuf:"bytes,5,opt,name=vote_extension,json=voteExtension,proto3" json:"vote_extension,omitempty"`
} }
func (m *CommitSig) Reset() { *m = CommitSig{} } func (m *CommitSig) Reset() { *m = CommitSig{} }
func (m *CommitSig) String() string { return proto.CompactTextString(m) } func (m *CommitSig) String() string { return proto.CompactTextString(m) }
func (*CommitSig) ProtoMessage() {} func (*CommitSig) ProtoMessage() {}
func (*CommitSig) Descriptor() ([]byte, []int) { func (*CommitSig) Descriptor() ([]byte, []int) {
return fileDescriptor_d3a6e55e2345de56, []int{7}
return fileDescriptor_d3a6e55e2345de56, []int{9}
} }
func (m *CommitSig) XXX_Unmarshal(b []byte) error { func (m *CommitSig) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -704,6 +812,13 @@ func (m *CommitSig) GetSignature() []byte {
return nil return nil
} }
func (m *CommitSig) GetVoteExtension() *VoteExtensionToSign {
if m != nil {
return m.VoteExtension
}
return nil
}
type Proposal struct { type Proposal struct {
Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"` Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"`
Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
@ -718,7 +833,7 @@ func (m *Proposal) Reset() { *m = Proposal{} }
func (m *Proposal) String() string { return proto.CompactTextString(m) } func (m *Proposal) String() string { return proto.CompactTextString(m) }
func (*Proposal) ProtoMessage() {} func (*Proposal) ProtoMessage() {}
func (*Proposal) Descriptor() ([]byte, []int) { func (*Proposal) Descriptor() ([]byte, []int) {
return fileDescriptor_d3a6e55e2345de56, []int{8}
return fileDescriptor_d3a6e55e2345de56, []int{10}
} }
func (m *Proposal) XXX_Unmarshal(b []byte) error { func (m *Proposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -805,7 +920,7 @@ func (m *SignedHeader) Reset() { *m = SignedHeader{} }
func (m *SignedHeader) String() string { return proto.CompactTextString(m) } func (m *SignedHeader) String() string { return proto.CompactTextString(m) }
func (*SignedHeader) ProtoMessage() {} func (*SignedHeader) ProtoMessage() {}
func (*SignedHeader) Descriptor() ([]byte, []int) { func (*SignedHeader) Descriptor() ([]byte, []int) {
return fileDescriptor_d3a6e55e2345de56, []int{9}
return fileDescriptor_d3a6e55e2345de56, []int{11}
} }
func (m *SignedHeader) XXX_Unmarshal(b []byte) error { func (m *SignedHeader) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -857,7 +972,7 @@ func (m *LightBlock) Reset() { *m = LightBlock{} }
func (m *LightBlock) String() string { return proto.CompactTextString(m) } func (m *LightBlock) String() string { return proto.CompactTextString(m) }
func (*LightBlock) ProtoMessage() {} func (*LightBlock) ProtoMessage() {}
func (*LightBlock) Descriptor() ([]byte, []int) { func (*LightBlock) Descriptor() ([]byte, []int) {
return fileDescriptor_d3a6e55e2345de56, []int{10}
return fileDescriptor_d3a6e55e2345de56, []int{12}
} }
func (m *LightBlock) XXX_Unmarshal(b []byte) error { func (m *LightBlock) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -911,7 +1026,7 @@ func (m *BlockMeta) Reset() { *m = BlockMeta{} }
func (m *BlockMeta) String() string { return proto.CompactTextString(m) } func (m *BlockMeta) String() string { return proto.CompactTextString(m) }
func (*BlockMeta) ProtoMessage() {} func (*BlockMeta) ProtoMessage() {}
func (*BlockMeta) Descriptor() ([]byte, []int) { func (*BlockMeta) Descriptor() ([]byte, []int) {
return fileDescriptor_d3a6e55e2345de56, []int{11}
return fileDescriptor_d3a6e55e2345de56, []int{13}
} }
func (m *BlockMeta) XXX_Unmarshal(b []byte) error { func (m *BlockMeta) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -980,7 +1095,7 @@ func (m *TxProof) Reset() { *m = TxProof{} }
func (m *TxProof) String() string { return proto.CompactTextString(m) } func (m *TxProof) String() string { return proto.CompactTextString(m) }
func (*TxProof) ProtoMessage() {} func (*TxProof) ProtoMessage() {}
func (*TxProof) Descriptor() ([]byte, []int) { func (*TxProof) Descriptor() ([]byte, []int) {
return fileDescriptor_d3a6e55e2345de56, []int{12}
return fileDescriptor_d3a6e55e2345de56, []int{14}
} }
func (m *TxProof) XXX_Unmarshal(b []byte) error { func (m *TxProof) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -1039,6 +1154,8 @@ func init() {
proto.RegisterType((*Header)(nil), "tendermint.types.Header") proto.RegisterType((*Header)(nil), "tendermint.types.Header")
proto.RegisterType((*Data)(nil), "tendermint.types.Data") proto.RegisterType((*Data)(nil), "tendermint.types.Data")
proto.RegisterType((*Vote)(nil), "tendermint.types.Vote") proto.RegisterType((*Vote)(nil), "tendermint.types.Vote")
proto.RegisterType((*VoteExtension)(nil), "tendermint.types.VoteExtension")
proto.RegisterType((*VoteExtensionToSign)(nil), "tendermint.types.VoteExtensionToSign")
proto.RegisterType((*Commit)(nil), "tendermint.types.Commit") proto.RegisterType((*Commit)(nil), "tendermint.types.Commit")
proto.RegisterType((*CommitSig)(nil), "tendermint.types.CommitSig") proto.RegisterType((*CommitSig)(nil), "tendermint.types.CommitSig")
proto.RegisterType((*Proposal)(nil), "tendermint.types.Proposal") proto.RegisterType((*Proposal)(nil), "tendermint.types.Proposal")
@ -1051,90 +1168,96 @@ func init() {
func init() { proto.RegisterFile("tendermint/types/types.proto", fileDescriptor_d3a6e55e2345de56) } func init() { proto.RegisterFile("tendermint/types/types.proto", fileDescriptor_d3a6e55e2345de56) }
var fileDescriptor_d3a6e55e2345de56 = []byte{ var fileDescriptor_d3a6e55e2345de56 = []byte{
// 1314 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4f, 0x6f, 0x1b, 0x45,
0x14, 0xcf, 0xda, 0x9b, 0xd8, 0x7e, 0xb6, 0x13, 0x67, 0x95, 0xb6, 0xae, 0xdb, 0x38, 0x2b, 0x23,
0x20, 0x2d, 0x68, 0x53, 0x52, 0xc4, 0x9f, 0x03, 0x07, 0xdb, 0x49, 0x5b, 0xab, 0x89, 0x63, 0xd6,
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, 0x63, 0xe8, 0xdb, 0xb0, 0x7a, 0x0e, 0x3a, 0x28, 0x6c, 0xf9, 0xf8, 0xa4, 0xa8, 0x34, 0x3d,
0xcc, 0xdf, 0x1f, 0x66, 0x51, 0x82, 0xdc, 0xb4, 0xc5, 0x5e, 0x73, 0xaf, 0x55, 0xde, 0xc9, 0x16,
0xf3, 0xd9, 0xe3, 0x93, 0x62, 0x66, 0xbc, 0x0c, 0x29, 0x7e, 0x52, 0x59, 0xe5, 0x8b, 0x67, 0xa7,
0x05, 0xe9, 0xf9, 0x69, 0x41, 0xfa, 0xfb, 0xb4, 0x20, 0x3d, 0x7d, 0x59, 0x98, 0x7b, 0xfe, 0xb2,
0x30, 0xf7, 0xe7, 0xcb, 0xc2, 0xdc, 0xd7, 0x1f, 0xf5, 0x4d, 0x32, 0x18, 0x75, 0x4a, 0x5d, 0x67,
0xb8, 0x19, 0xfe, 0x8f, 0x35, 0x79, 0xe4, 0xff, 0xf5, 0xce, 0xfe, 0xff, 0xea, 0x2c, 0x30, 0xf9,
0x9d, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x38, 0xfc, 0x14, 0xb1, 0x40, 0x0e, 0x00, 0x00,
} }
func (m *PartSetHeader) Marshal() (dAtA []byte, err error) { func (m *PartSetHeader) Marshal() (dAtA []byte, err error) {
@ -1435,6 +1558,18 @@ func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if m.VoteExtension != nil {
{
size, err := m.VoteExtension.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintTypes(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x4a
}
if len(m.Signature) > 0 { if len(m.Signature) > 0 {
i -= len(m.Signature) i -= len(m.Signature)
copy(dAtA[i:], m.Signature) copy(dAtA[i:], m.Signature)
@ -1454,12 +1589,12 @@ func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i-- i--
dAtA[i] = 0x32 dAtA[i] = 0x32
} }
n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
if err6 != nil {
return 0, err6
n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
if err7 != nil {
return 0, err7
} }
i -= n6
i = encodeVarintTypes(dAtA, i, uint64(n6))
i -= n7
i = encodeVarintTypes(dAtA, i, uint64(n7))
i-- i--
dAtA[i] = 0x2a dAtA[i] = 0x2a
{ {
@ -1490,6 +1625,73 @@ func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil return len(dAtA) - i, nil
} }
func (m *VoteExtension) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *VoteExtension) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *VoteExtension) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.AppDataSelfAuthenticating) > 0 {
i -= len(m.AppDataSelfAuthenticating)
copy(dAtA[i:], m.AppDataSelfAuthenticating)
i = encodeVarintTypes(dAtA, i, uint64(len(m.AppDataSelfAuthenticating)))
i--
dAtA[i] = 0x12
}
if len(m.AppDataToSign) > 0 {
i -= len(m.AppDataToSign)
copy(dAtA[i:], m.AppDataToSign)
i = encodeVarintTypes(dAtA, i, uint64(len(m.AppDataToSign)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *VoteExtensionToSign) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *VoteExtensionToSign) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *VoteExtensionToSign) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.AppDataToSign) > 0 {
i -= len(m.AppDataToSign)
copy(dAtA[i:], m.AppDataToSign)
i = encodeVarintTypes(dAtA, i, uint64(len(m.AppDataToSign)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *Commit) Marshal() (dAtA []byte, err error) { func (m *Commit) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
@ -1567,6 +1769,18 @@ func (m *CommitSig) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if m.VoteExtension != nil {
{
size, err := m.VoteExtension.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintTypes(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x2a
}
if len(m.Signature) > 0 { if len(m.Signature) > 0 {
i -= len(m.Signature) i -= len(m.Signature)
copy(dAtA[i:], m.Signature) copy(dAtA[i:], m.Signature)
@ -1574,12 +1788,12 @@ func (m *CommitSig) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i-- i--
dAtA[i] = 0x22 dAtA[i] = 0x22
} }
n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
if err9 != nil {
return 0, err9
n11, err11 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
if err11 != nil {
return 0, err11
} }
i -= n9
i = encodeVarintTypes(dAtA, i, uint64(n9))
i -= n11
i = encodeVarintTypes(dAtA, i, uint64(n11))
i-- i--
dAtA[i] = 0x1a dAtA[i] = 0x1a
if len(m.ValidatorAddress) > 0 { if len(m.ValidatorAddress) > 0 {
@ -1624,12 +1838,12 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i-- i--
dAtA[i] = 0x3a dAtA[i] = 0x3a
} }
n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
if err10 != nil {
return 0, err10
n12, err12 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
if err12 != nil {
return 0, err12
} }
i -= n10
i = encodeVarintTypes(dAtA, i, uint64(n10))
i -= n12
i = encodeVarintTypes(dAtA, i, uint64(n12))
i-- i--
dAtA[i] = 0x32 dAtA[i] = 0x32
{ {
@ -2024,6 +2238,40 @@ func (m *Vote) Size() (n int) {
if l > 0 { if l > 0 {
n += 1 + l + sovTypes(uint64(l)) n += 1 + l + sovTypes(uint64(l))
} }
if m.VoteExtension != nil {
l = m.VoteExtension.Size()
n += 1 + l + sovTypes(uint64(l))
}
return n
}
func (m *VoteExtension) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.AppDataToSign)
if l > 0 {
n += 1 + l + sovTypes(uint64(l))
}
l = len(m.AppDataSelfAuthenticating)
if l > 0 {
n += 1 + l + sovTypes(uint64(l))
}
return n
}
func (m *VoteExtensionToSign) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.AppDataToSign)
if l > 0 {
n += 1 + l + sovTypes(uint64(l))
}
return n return n
} }
@ -2069,6 +2317,10 @@ func (m *CommitSig) Size() (n int) {
if l > 0 { if l > 0 {
n += 1 + l + sovTypes(uint64(l)) n += 1 + l + sovTypes(uint64(l))
} }
if m.VoteExtension != nil {
l = m.VoteExtension.Size()
n += 1 + l + sovTypes(uint64(l))
}
return n return n
} }
@ -3364,6 +3616,244 @@ func (m *Vote) Unmarshal(dAtA []byte) error {
m.Signature = []byte{} m.Signature = []byte{}
} }
iNdEx = postIndex iNdEx = postIndex
case 9:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field VoteExtension", 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 < 0 {
return ErrInvalidLengthTypes
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.VoteExtension == nil {
m.VoteExtension = &VoteExtension{}
}
if err := m.VoteExtension.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipTypes(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTypes
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *VoteExtension) 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: VoteExtension: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: VoteExtension: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field AppDataToSign", 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 < 0 {
return ErrInvalidLengthTypes
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.AppDataToSign = append(m.AppDataToSign[:0], dAtA[iNdEx:postIndex]...)
if m.AppDataToSign == nil {
m.AppDataToSign = []byte{}
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field AppDataSelfAuthenticating", 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 < 0 {
return ErrInvalidLengthTypes
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.AppDataSelfAuthenticating = append(m.AppDataSelfAuthenticating[:0], dAtA[iNdEx:postIndex]...)
if m.AppDataSelfAuthenticating == nil {
m.AppDataSelfAuthenticating = []byte{}
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipTypes(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTypes
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *VoteExtensionToSign) 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: VoteExtensionToSign: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: VoteExtensionToSign: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field AppDataToSign", 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 < 0 {
return ErrInvalidLengthTypes
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.AppDataToSign = append(m.AppDataToSign[:0], dAtA[iNdEx:postIndex]...)
if m.AppDataToSign == nil {
m.AppDataToSign = []byte{}
}
iNdEx = postIndex
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipTypes(dAtA[iNdEx:]) skippy, err := skipTypes(dAtA[iNdEx:])
@ -3689,6 +4179,42 @@ func (m *CommitSig) Unmarshal(dAtA []byte) error {
m.Signature = []byte{} m.Signature = []byte{}
} }
iNdEx = postIndex iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field VoteExtension", 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 < 0 {
return ErrInvalidLengthTypes
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.VoteExtension == nil {
m.VoteExtension = &VoteExtensionToSign{}
}
if err := m.VoteExtension.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipTypes(dAtA[iNdEx:]) skippy, err := skipTypes(dAtA[iNdEx:])


+ 12
- 7
types/block.go View File

@ -602,19 +602,21 @@ const (
// CommitSig is a part of the Vote included in a Commit. // CommitSig is a part of the Vote included in a Commit.
type CommitSig struct { type CommitSig struct {
BlockIDFlag BlockIDFlag `json:"block_id_flag"`
ValidatorAddress Address `json:"validator_address"`
Timestamp time.Time `json:"timestamp"`
Signature []byte `json:"signature"`
BlockIDFlag BlockIDFlag `json:"block_id_flag"`
ValidatorAddress Address `json:"validator_address"`
Timestamp time.Time `json:"timestamp"`
Signature []byte `json:"signature"`
VoteExtension VoteExtensionToSign `json:"vote_extension"`
} }
// NewCommitSigForBlock returns new CommitSig with BlockIDFlagCommit. // NewCommitSigForBlock returns new CommitSig with BlockIDFlagCommit.
func NewCommitSigForBlock(signature []byte, valAddr Address, ts time.Time) CommitSig {
func NewCommitSigForBlock(signature []byte, valAddr Address, ts time.Time, ext VoteExtensionToSign) CommitSig {
return CommitSig{ return CommitSig{
BlockIDFlag: BlockIDFlagCommit, BlockIDFlag: BlockIDFlagCommit,
ValidatorAddress: valAddr, ValidatorAddress: valAddr,
Timestamp: ts, Timestamp: ts,
Signature: signature, Signature: signature,
VoteExtension: ext,
} }
} }
@ -647,12 +649,14 @@ func (cs CommitSig) Absent() bool {
// 1. first 6 bytes of signature // 1. first 6 bytes of signature
// 2. first 6 bytes of validator address // 2. first 6 bytes of validator address
// 3. block ID flag // 3. block ID flag
// 4. timestamp
// 4. first 6 bytes of the vote extension
// 5. timestamp
func (cs CommitSig) String() string { func (cs CommitSig) String() string {
return fmt.Sprintf("CommitSig{%X by %X on %v @ %s}",
return fmt.Sprintf("CommitSig{%X by %X on %v with %X @ %s}",
tmbytes.Fingerprint(cs.Signature), tmbytes.Fingerprint(cs.Signature),
tmbytes.Fingerprint(cs.ValidatorAddress), tmbytes.Fingerprint(cs.ValidatorAddress),
cs.BlockIDFlag, cs.BlockIDFlag,
tmbytes.Fingerprint(cs.VoteExtension.BytesPacked()),
CanonicalTime(cs.Timestamp)) CanonicalTime(cs.Timestamp))
} }
@ -801,6 +805,7 @@ func (commit *Commit) GetVote(valIdx int32) *Vote {
ValidatorAddress: commitSig.ValidatorAddress, ValidatorAddress: commitSig.ValidatorAddress,
ValidatorIndex: valIdx, ValidatorIndex: valIdx,
Signature: commitSig.Signature, Signature: commitSig.Signature,
VoteExtension: commitSig.VoteExtension.ToVoteExtension(),
} }
} }


+ 16
- 6
types/canonical.go View File

@ -51,16 +51,26 @@ func CanonicalizeProposal(chainID string, proposal *tmproto.Proposal) tmproto.Ca
} }
} }
func GetVoteExtensionToSign(ext *tmproto.VoteExtension) *tmproto.VoteExtensionToSign {
if ext == nil {
return nil
}
return &tmproto.VoteExtensionToSign{
AppDataToSign: ext.AppDataToSign,
}
}
// CanonicalizeVote transforms the given Vote to a CanonicalVote, which does // CanonicalizeVote transforms the given Vote to a CanonicalVote, which does
// not contain ValidatorIndex and ValidatorAddress fields. // not contain ValidatorIndex and ValidatorAddress fields.
func CanonicalizeVote(chainID string, vote *tmproto.Vote) tmproto.CanonicalVote { func CanonicalizeVote(chainID string, vote *tmproto.Vote) tmproto.CanonicalVote {
return tmproto.CanonicalVote{ return tmproto.CanonicalVote{
Type: vote.Type,
Height: vote.Height, // encoded as sfixed64
Round: int64(vote.Round), // encoded as sfixed64
BlockID: CanonicalizeBlockID(vote.BlockID),
Timestamp: vote.Timestamp,
ChainID: chainID,
Type: vote.Type,
Height: vote.Height, // encoded as sfixed64
Round: int64(vote.Round), // encoded as sfixed64
BlockID: CanonicalizeBlockID(vote.BlockID),
Timestamp: vote.Timestamp,
ChainID: chainID,
VoteExtension: GetVoteExtensionToSign(vote.VoteExtension),
} }
} }


+ 98
- 2
types/vote.go View File

@ -24,6 +24,7 @@ var (
ErrVoteInvalidBlockHash = errors.New("invalid block hash") ErrVoteInvalidBlockHash = errors.New("invalid block hash")
ErrVoteNonDeterministicSignature = errors.New("non-deterministic signature") ErrVoteNonDeterministicSignature = errors.New("non-deterministic signature")
ErrVoteNil = errors.New("nil vote") ErrVoteNil = errors.New("nil vote")
ErrVoteInvalidExtension = errors.New("invalid vote extension")
) )
type ErrVoteConflictingVotes struct { type ErrVoteConflictingVotes struct {
@ -45,6 +46,52 @@ func NewConflictingVoteError(vote1, vote2 *Vote) *ErrVoteConflictingVotes {
// Address is hex bytes. // Address is hex bytes.
type Address = crypto.Address type Address = crypto.Address
// VoteExtensionToSign is a subset of VoteExtension
// that is signed by the validators private key
type VoteExtensionToSign struct {
AppDataToSign []byte `json:"app_data_to_sign"`
}
// BytesPacked returns a bytes-packed representation for
// debugging and human identification. This function should
// not be used for any logical operations.
func (ext VoteExtensionToSign) BytesPacked() []byte {
res := make([]byte, len(ext.AppDataToSign))
copy(res, ext.AppDataToSign)
return res
}
// ToVoteExtension constructs a VoteExtension from a VoteExtensionToSign
func (ext VoteExtensionToSign) ToVoteExtension() VoteExtension {
return VoteExtension{
AppDataToSign: ext.AppDataToSign,
}
}
// VoteExtension is a set of data provided by the application
// that is additionally included in the vote
type VoteExtension struct {
AppDataToSign []byte `json:"app_data_to_sign"`
AppDataSelfAuthenticating []byte `json:"app_data_self_authenticating"`
}
// ToSign constructs a VoteExtensionToSign from a VoteExtenstion
func (ext VoteExtension) ToSign() VoteExtensionToSign {
return VoteExtensionToSign{
AppDataToSign: ext.AppDataToSign,
}
}
// BytesPacked returns a bytes-packed representation for
// debugging and human identification. This function should
// not be used for any logical operations.
func (ext VoteExtension) BytesPacked() []byte {
res := make([]byte, len(ext.AppDataToSign)+len(ext.AppDataSelfAuthenticating))
copy(res[:len(ext.AppDataToSign)], ext.AppDataToSign)
copy(res[len(ext.AppDataToSign):], ext.AppDataSelfAuthenticating)
return res
}
// Vote represents a prevote, precommit, or commit vote from validators for // Vote represents a prevote, precommit, or commit vote from validators for
// consensus. // consensus.
type Vote struct { type Vote struct {
@ -56,6 +103,7 @@ type Vote struct {
ValidatorAddress Address `json:"validator_address"` ValidatorAddress Address `json:"validator_address"`
ValidatorIndex int32 `json:"validator_index"` ValidatorIndex int32 `json:"validator_index"`
Signature []byte `json:"signature"` Signature []byte `json:"signature"`
VoteExtension VoteExtension `json:"vote_extension"`
} }
// CommitSig converts the Vote to a CommitSig. // CommitSig converts the Vote to a CommitSig.
@ -79,6 +127,7 @@ func (vote *Vote) CommitSig() CommitSig {
ValidatorAddress: vote.ValidatorAddress, ValidatorAddress: vote.ValidatorAddress,
Timestamp: vote.Timestamp, Timestamp: vote.Timestamp,
Signature: vote.Signature, Signature: vote.Signature,
VoteExtension: vote.VoteExtension.ToSign(),
} }
} }
@ -102,6 +151,7 @@ func VoteSignBytes(chainID string, vote *tmproto.Vote) []byte {
func (vote *Vote) Copy() *Vote { func (vote *Vote) Copy() *Vote {
voteCopy := *vote voteCopy := *vote
voteCopy.VoteExtension = vote.VoteExtension.Copy()
return &voteCopy return &voteCopy
} }
@ -115,7 +165,8 @@ func (vote *Vote) Copy() *Vote {
// 6. type string // 6. type string
// 7. first 6 bytes of block hash // 7. first 6 bytes of block hash
// 8. first 6 bytes of signature // 8. first 6 bytes of signature
// 9. timestamp
// 9. first 6 bytes of vote extension
// 10. timestamp
func (vote *Vote) String() string { func (vote *Vote) String() string {
if vote == nil { if vote == nil {
return nilVoteStr return nilVoteStr
@ -131,7 +182,7 @@ func (vote *Vote) String() string {
panic("Unknown vote type") panic("Unknown vote type")
} }
return fmt.Sprintf("Vote{%v:%X %v/%02d/%v(%v) %X %X @ %s}",
return fmt.Sprintf("Vote{%v:%X %v/%02d/%v(%v) %X %X %X @ %s}",
vote.ValidatorIndex, vote.ValidatorIndex,
tmbytes.Fingerprint(vote.ValidatorAddress), tmbytes.Fingerprint(vote.ValidatorAddress),
vote.Height, vote.Height,
@ -140,6 +191,7 @@ func (vote *Vote) String() string {
typeString, typeString,
tmbytes.Fingerprint(vote.BlockID.Hash), tmbytes.Fingerprint(vote.BlockID.Hash),
tmbytes.Fingerprint(vote.Signature), tmbytes.Fingerprint(vote.Signature),
tmbytes.Fingerprint(vote.VoteExtension.BytesPacked()),
CanonicalTime(vote.Timestamp), CanonicalTime(vote.Timestamp),
) )
} }
@ -198,9 +250,42 @@ func (vote *Vote) ValidateBasic() error {
return fmt.Errorf("signature is too big (max: %d)", MaxSignatureSize) return fmt.Errorf("signature is too big (max: %d)", MaxSignatureSize)
} }
// XXX: add length verification for vote extension?
return nil return nil
} }
func (ext VoteExtension) Copy() VoteExtension {
res := VoteExtension{
AppDataToSign: make([]byte, len(ext.AppDataToSign)),
AppDataSelfAuthenticating: make([]byte, len(ext.AppDataSelfAuthenticating)),
}
copy(res.AppDataToSign, ext.AppDataToSign)
copy(res.AppDataSelfAuthenticating, ext.AppDataSelfAuthenticating)
return res
}
func (ext VoteExtension) IsEmpty() bool {
if len(ext.AppDataToSign) != 0 {
return false
}
if len(ext.AppDataSelfAuthenticating) != 0 {
return false
}
return true
}
func (ext VoteExtension) ToProto() *tmproto.VoteExtension {
if ext.IsEmpty() {
return nil
}
return &tmproto.VoteExtension{
AppDataToSign: ext.AppDataToSign,
AppDataSelfAuthenticating: ext.AppDataSelfAuthenticating,
}
}
// ToProto converts the handwritten type to proto generated type // ToProto converts the handwritten type to proto generated type
// return type, nil if everything converts safely, otherwise nil, error // return type, nil if everything converts safely, otherwise nil, error
func (vote *Vote) ToProto() *tmproto.Vote { func (vote *Vote) ToProto() *tmproto.Vote {
@ -217,7 +302,17 @@ func (vote *Vote) ToProto() *tmproto.Vote {
ValidatorAddress: vote.ValidatorAddress, ValidatorAddress: vote.ValidatorAddress,
ValidatorIndex: vote.ValidatorIndex, ValidatorIndex: vote.ValidatorIndex,
Signature: vote.Signature, Signature: vote.Signature,
VoteExtension: vote.VoteExtension.ToProto(),
}
}
func VoteExtensionFromProto(pext *tmproto.VoteExtension) VoteExtension {
ext := VoteExtension{}
if pext != nil {
ext.AppDataToSign = pext.AppDataToSign
ext.AppDataSelfAuthenticating = pext.AppDataSelfAuthenticating
} }
return ext
} }
// FromProto converts a proto generetad type to a handwritten type // FromProto converts a proto generetad type to a handwritten type
@ -241,6 +336,7 @@ func VoteFromProto(pv *tmproto.Vote) (*Vote, error) {
vote.ValidatorAddress = pv.ValidatorAddress vote.ValidatorAddress = pv.ValidatorAddress
vote.ValidatorIndex = pv.ValidatorIndex vote.ValidatorIndex = pv.ValidatorIndex
vote.Signature = pv.Signature vote.Signature = pv.Signature
vote.VoteExtension = VoteExtensionFromProto(pv.VoteExtension)
return vote, vote.ValidateBasic() return vote, vote.ValidateBasic()
} }

+ 29
- 2
types/vote_test.go View File

@ -128,6 +128,33 @@ func TestVoteSignBytesTestVectors(t *testing.T) {
0x32, 0x32,
0xd, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64}, // chainID 0xd, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64}, // chainID
}, },
// containing vote extension
5: {
"test_chain_id", &Vote{Height: 1, Round: 1, VoteExtension: VoteExtension{
AppDataToSign: []byte("signed"),
AppDataSelfAuthenticating: []byte("auth"),
}},
[]byte{
0x38, // length
0x11, // (field_number << 3) | wire_type
0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, // height
0x19, // (field_number << 3) | wire_type
0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, // round
// remaning fields:
0x2a, // (field_number << 3) | wire_type
0xb, 0x8, 0x80, 0x92, 0xb8, 0xc3, 0x98, 0xfe, 0xff, 0xff, 0xff, 0x1, // timestamp
// (field_number << 3) | wire_type
0x32,
0xd, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, // chainID
// (field_number << 3) | wire_type
0x3a,
0x8, // length
0xa, // (field_number << 3) | wire_type
0x6, // length
0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, // AppDataSigned
// SelfAuthenticating data is excluded on signing
}, // chainID
},
} }
for i, tc := range tests { for i, tc := range tests {
v := tc.vote.ToProto() v := tc.vote.ToProto()
@ -226,13 +253,13 @@ func TestVoteVerify(t *testing.T) {
func TestVoteString(t *testing.T) { func TestVoteString(t *testing.T) {
str := examplePrecommit(t).String() str := examplePrecommit(t).String()
expected := `Vote{56789:6AF1F4111082 12345/02/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 8B01023386C3 000000000000 @ 2017-12-25T03:00:01.234Z}`
expected := `Vote{56789:6AF1F4111082 12345/02/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 8B01023386C3 000000000000 000000000000 @ 2017-12-25T03:00:01.234Z}` //nolint:lll //ignore line length for tests
if str != expected { if str != expected {
t.Errorf("got unexpected string for Vote. Expected:\n%v\nGot:\n%v", expected, str) t.Errorf("got unexpected string for Vote. Expected:\n%v\nGot:\n%v", expected, str)
} }
str2 := examplePrevote(t).String() str2 := examplePrevote(t).String()
expected = `Vote{56789:6AF1F4111082 12345/02/SIGNED_MSG_TYPE_PREVOTE(Prevote) 8B01023386C3 000000000000 @ 2017-12-25T03:00:01.234Z}`
expected = `Vote{56789:6AF1F4111082 12345/02/SIGNED_MSG_TYPE_PREVOTE(Prevote) 8B01023386C3 000000000000 000000000000 @ 2017-12-25T03:00:01.234Z}` //nolint:lll //ignore line length for tests
if str2 != expected { if str2 != expected {
t.Errorf("got unexpected string for Vote. Expected:\n%v\nGot:\n%v", expected, str2) t.Errorf("got unexpected string for Vote. Expected:\n%v\nGot:\n%v", expected, str2)
} }


Loading…
Cancel
Save