Browse Source

Merge 9951b7ad81 into e4ae922c33

pull/8141/merge
Thane Thomson 3 years ago
committed by GitHub
parent
commit
c6d8c6d825
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 1964 additions and 2054 deletions
  1. +0
    -34
      abci/example/kvstore/persistent_kvstore.go
  2. +0
    -11
      abci/types/types.go
  3. +1266
    -1101
      abci/types/types.pb.go
  4. +1
    -1
      internal/consensus/byzantine_test.go
  5. +10
    -11
      internal/consensus/common_test.go
  6. +2
    -7
      internal/consensus/msgs_test.go
  7. +5
    -2
      internal/consensus/state.go
  8. +17
    -10
      internal/state/execution.go
  9. +12
    -12
      internal/state/execution_test.go
  10. +7
    -5
      internal/state/helpers_test.go
  11. +4
    -1
      node/node_test.go
  12. +11
    -1
      privval/file.go
  13. +8
    -17
      privval/msgs_test.go
  14. +15
    -19
      proto/tendermint/abci/types.proto
  15. +21
    -7
      proto/tendermint/abci/types.proto.intermediate
  16. +360
    -72
      proto/tendermint/types/canonical.pb.go
  17. +9
    -0
      proto/tendermint/types/canonical.proto
  18. +150
    -566
      proto/tendermint/types/types.pb.go
  19. +6
    -1
      proto/tendermint/types/types.proto
  20. +2
    -2
      scripts/abci-gen.sh
  21. +1
    -1
      scripts/protopackage.sh
  22. +7
    -14
      types/block.go
  23. +8
    -17
      types/canonical.go
  24. +6
    -0
      types/priv_validator.go
  25. +30
    -130
      types/vote.go
  26. +6
    -12
      types/vote_test.go

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

@ -1,14 +1,11 @@
package kvstore package kvstore
import ( import (
"bytes"
dbm "github.com/tendermint/tm-db" dbm "github.com/tendermint/tm-db"
"github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/libs/log"
cryptoproto "github.com/tendermint/tendermint/proto/tendermint/crypto" cryptoproto "github.com/tendermint/tendermint/proto/tendermint/crypto"
ptypes "github.com/tendermint/tendermint/proto/tendermint/types"
) )
const ( const (
@ -45,34 +42,3 @@ func (app *PersistentKVStoreApplication) OfferSnapshot(req types.RequestOfferSna
func (app *PersistentKVStoreApplication) ApplySnapshotChunk(req types.RequestApplySnapshotChunk) types.ResponseApplySnapshotChunk { func (app *PersistentKVStoreApplication) ApplySnapshotChunk(req types.RequestApplySnapshotChunk) types.ResponseApplySnapshotChunk {
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{VoteExtension: ConstructVoteExtension(req.Vote.ValidatorAddress)}
}
func (app *PersistentKVStoreApplication) VerifyVoteExtension(req types.RequestVerifyVoteExtension) types.ResponseVerifyVoteExtension {
return types.RespondVerifyVoteExtension(app.verifyExtension(req.Vote.ValidatorAddress, req.Vote.VoteExtension))
}
// -----------------------------
func ConstructVoteExtension(valAddr []byte) *ptypes.VoteExtension {
return &ptypes.VoteExtension{
AppDataToSign: valAddr,
AppDataSelfAuthenticating: valAddr,
}
}
func (app *PersistentKVStoreApplication) verifyExtension(valAddr []byte, ext *ptypes.VoteExtension) bool {
if ext == nil {
return false
}
canonical := ConstructVoteExtension(valAddr)
if !bytes.Equal(canonical.AppDataToSign, ext.AppDataToSign) {
return false
}
if !bytes.Equal(canonical.AppDataSelfAuthenticating, ext.AppDataSelfAuthenticating) {
return false
}
return true
}

+ 0
- 11
abci/types/types.go View File

@ -5,8 +5,6 @@ import (
"encoding/json" "encoding/json"
"github.com/gogo/protobuf/jsonpb" "github.com/gogo/protobuf/jsonpb"
types "github.com/tendermint/tendermint/proto/tendermint/types"
) )
const ( const (
@ -165,15 +163,6 @@ var _ jsonRoundTripper = (*EventAttribute)(nil)
// ----------------------------------------------- // -----------------------------------------------
// construct Result data // construct Result data
func RespondExtendVote(appDataToSign, appDataSelfAuthenticating []byte) ResponseExtendVote {
return ResponseExtendVote{
VoteExtension: &types.VoteExtension{
AppDataToSign: appDataToSign,
AppDataSelfAuthenticating: appDataSelfAuthenticating,
},
}
}
func RespondVerifyVoteExtension(ok bool) ResponseVerifyVoteExtension { func RespondVerifyVoteExtension(ok bool) ResponseVerifyVoteExtension {
status := ResponseVerifyVoteExtension_REJECT status := ResponseVerifyVoteExtension_REJECT
if ok { if ok {


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


+ 1
- 1
internal/consensus/byzantine_test.go View File

@ -201,7 +201,7 @@ func TestByzantinePrevoteEquivocation(t *testing.T) {
proposerAddr := lazyNodeState.privValidatorPubKey.Address() proposerAddr := lazyNodeState.privValidatorPubKey.Address()
block, err := lazyNodeState.blockExec.CreateProposalBlock( block, err := lazyNodeState.blockExec.CreateProposalBlock(
ctx, lazyNodeState.Height, lazyNodeState.state, commit, proposerAddr, nil)
ctx, lazyNodeState.Height, lazyNodeState.state, commit, proposerAddr, lazyNodeState.LastCommit.GetVotes())
require.NoError(t, err) require.NoError(t, err)
blockParts, err := block.MakePartSet(types.BlockPartSizeBytes) blockParts, err := block.MakePartSet(types.BlockPartSizeBytes)
require.NoError(t, err) require.NoError(t, err)


+ 10
- 11
internal/consensus/common_test.go View File

@ -120,17 +120,17 @@ func (vs *validatorStub) signVote(
} }
vote := &types.Vote{ vote := &types.Vote{
ValidatorIndex: vs.Index,
ValidatorAddress: pubKey.Address(),
Type: voteType,
Height: vs.Height, Height: vs.Height,
Round: vs.Round, Round: vs.Round,
Timestamp: vs.clock.Now(),
Type: voteType,
BlockID: blockID, BlockID: blockID,
VoteExtension: types.VoteExtensionFromProto(kvstore.ConstructVoteExtension(pubKey.Address())),
Timestamp: vs.clock.Now(),
ValidatorAddress: pubKey.Address(),
ValidatorIndex: vs.Index,
Extension: []byte("extension"),
} }
v := vote.ToProto() v := vote.ToProto()
if err := vs.PrivValidator.SignVote(ctx, chainID, v); err != nil {
if err = vs.PrivValidator.SignVote(ctx, chainID, v); err != nil {
return nil, fmt.Errorf("sign vote failed: %w", err) return nil, fmt.Errorf("sign vote failed: %w", err)
} }
@ -138,10 +138,12 @@ func (vs *validatorStub) signVote(
if signDataIsEqual(vs.lastVote, v) { if signDataIsEqual(vs.lastVote, v) {
v.Signature = vs.lastVote.Signature v.Signature = vs.lastVote.Signature
v.Timestamp = vs.lastVote.Timestamp v.Timestamp = vs.lastVote.Timestamp
v.ExtensionSignature = vs.lastVote.ExtensionSignature
} }
vote.Signature = v.Signature vote.Signature = v.Signature
vote.Timestamp = v.Timestamp vote.Timestamp = v.Timestamp
vote.ExtensionSignature = v.ExtensionSignature
return vote, err return vote, err
} }
@ -158,10 +160,6 @@ func signVote(
v, err := vs.signVote(ctx, voteType, chainID, blockID) v, err := vs.signVote(ctx, voteType, chainID, blockID)
require.NoError(t, err, "failed to sign vote") require.NoError(t, err, "failed to sign vote")
// TODO: remove hardcoded vote extension.
// currently set for abci/examples/kvstore/persistent_kvstore.go
v.VoteExtension = types.VoteExtensionFromProto(kvstore.ConstructVoteExtension(v.ValidatorAddress))
vs.lastVote = v vs.lastVote = v
return v return v
@ -987,5 +985,6 @@ func signDataIsEqual(v1 *types.Vote, v2 *tmproto.Vote) bool {
v1.Height == v2.GetHeight() && v1.Height == v2.GetHeight() &&
v1.Round == v2.Round && v1.Round == v2.Round &&
bytes.Equal(v1.ValidatorAddress.Bytes(), v2.GetValidatorAddress()) && bytes.Equal(v1.ValidatorAddress.Bytes(), v2.GetValidatorAddress()) &&
v1.ValidatorIndex == v2.GetValidatorIndex()
v1.ValidatorIndex == v2.GetValidatorIndex() &&
bytes.Equal(v1.Extension, v2.Extension)
} }

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

@ -357,11 +357,6 @@ 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,
@ -370,7 +365,7 @@ func TestConsMsgsVectors(t *testing.T) {
Timestamp: date, Timestamp: date,
Type: tmproto.PrecommitType, Type: tmproto.PrecommitType,
BlockID: bi, BlockID: bi,
VoteExtension: ext,
Extension: []byte("signed"),
} }
vpb := v.ToProto() vpb := v.ToProto()
@ -407,7 +402,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}}},
"3280010a7e0802100122480a206164645f6d6f72655f6578636c616d6174696f6e5f6d61726b735f636f64652d1224080112206164645f6d6f72655f6578636c616d6174696f6e5f6d61726b735f636f64652d2a0608c0b89fdc0532146164645f6d6f72655f6578636c616d6174696f6e38014a0e0a067369676e6564120461757468"},
"32780a760802100122480a206164645f6d6f72655f6578636c616d6174696f6e5f6d61726b735f636f64652d1224080112206164645f6d6f72655f6578636c616d6174696f6e5f6d61726b735f636f64652d2a0608c0b89fdc0532146164645f6d6f72655f6578636c616d6174696f6e38014a067369676e6564"},
{"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"},


+ 5
- 2
internal/consensus/state.go View File

@ -1391,6 +1391,7 @@ func (cs *State) createProposalBlock(ctx context.Context) (*types.Block, error)
} }
var commit *types.Commit var commit *types.Commit
var votes []*types.Vote
switch { switch {
case cs.Height == cs.state.InitialHeight: case cs.Height == cs.state.InitialHeight:
// We're creating a proposal for the first block. // We're creating a proposal for the first block.
@ -1400,6 +1401,7 @@ func (cs *State) createProposalBlock(ctx context.Context) (*types.Block, error)
case cs.LastCommit.HasTwoThirdsMajority(): case cs.LastCommit.HasTwoThirdsMajority():
// Make the commit from LastCommit // Make the commit from LastCommit
commit = cs.LastCommit.MakeCommit() commit = cs.LastCommit.MakeCommit()
votes = cs.LastCommit.GetVotes()
default: // This shouldn't happen. default: // This shouldn't happen.
cs.logger.Error("propose step; cannot propose anything without commit for the previous block") cs.logger.Error("propose step; cannot propose anything without commit for the previous block")
@ -1415,7 +1417,7 @@ func (cs *State) createProposalBlock(ctx context.Context) (*types.Block, error)
proposerAddr := cs.privValidatorPubKey.Address() proposerAddr := cs.privValidatorPubKey.Address()
return cs.blockExec.CreateProposalBlock(ctx, cs.Height, cs.state, commit, proposerAddr, cs.LastCommit.GetVotes())
return cs.blockExec.CreateProposalBlock(ctx, cs.Height, cs.state, commit, proposerAddr, votes)
} }
// Enter: `timeoutPropose` after entering Propose. // Enter: `timeoutPropose` after entering Propose.
@ -2481,7 +2483,7 @@ func (cs *State) signVote(
if err != nil { if err != nil {
return nil, err return nil, err
} }
vote.VoteExtension = ext
vote.Extension = ext
default: default:
timeout = time.Second timeout = time.Second
} }
@ -2493,6 +2495,7 @@ func (cs *State) signVote(
err := cs.privValidator.SignVote(ctxto, cs.state.ChainID, v) err := cs.privValidator.SignVote(ctxto, cs.state.ChainID, v)
vote.Signature = v.Signature vote.Signature = v.Signature
vote.ExtensionSignature = v.ExtensionSignature
vote.Timestamp = v.Timestamp vote.Timestamp = v.Timestamp
return vote, err return vote, err


+ 17
- 10
internal/state/execution.go View File

@ -311,21 +311,25 @@ func (blockExec *BlockExecutor) ApplyBlock(
return state, nil return state, nil
} }
func (blockExec *BlockExecutor) ExtendVote(ctx context.Context, vote *types.Vote) (types.VoteExtension, error) {
func (blockExec *BlockExecutor) ExtendVote(ctx context.Context, vote *types.Vote) ([]byte, error) {
req := abci.RequestExtendVote{ req := abci.RequestExtendVote{
Vote: vote.ToProto(),
Hash: vote.BlockID.Hash,
Height: vote.Height,
} }
resp, err := blockExec.appClient.ExtendVote(ctx, req) resp, err := blockExec.appClient.ExtendVote(ctx, req)
if err != nil { if err != nil {
return types.VoteExtension{}, err
return nil, err
} }
return types.VoteExtensionFromProto(resp.VoteExtension), nil
return resp.VoteExtension, nil
} }
func (blockExec *BlockExecutor) VerifyVoteExtension(ctx context.Context, vote *types.Vote) error { func (blockExec *BlockExecutor) VerifyVoteExtension(ctx context.Context, vote *types.Vote) error {
req := abci.RequestVerifyVoteExtension{ req := abci.RequestVerifyVoteExtension{
Vote: vote.ToProto(),
Hash: vote.BlockID.Hash,
ValidatorAddress: vote.ValidatorAddress,
Height: vote.Height,
VoteExtension: vote.Extension,
} }
resp, err := blockExec.appClient.VerifyVoteExtension(ctx, req) resp, err := blockExec.appClient.VerifyVoteExtension(ctx, req)
@ -333,7 +337,7 @@ func (blockExec *BlockExecutor) VerifyVoteExtension(ctx context.Context, vote *t
return err return err
} }
if resp.IsErr() {
if !resp.IsOK() {
return types.ErrVoteInvalidExtension return types.ErrVoteInvalidExtension
} }
@ -434,14 +438,17 @@ func buildLastCommitInfo(block *types.Block, store Store, initialHeight int64) a
func extendedCommitInfo(c abci.CommitInfo, votes []*types.Vote) abci.ExtendedCommitInfo { func extendedCommitInfo(c abci.CommitInfo, votes []*types.Vote) abci.ExtendedCommitInfo {
vs := make([]abci.ExtendedVoteInfo, len(c.Votes)) vs := make([]abci.ExtendedVoteInfo, len(c.Votes))
var ext []byte
for i := range vs { for i := range vs {
if c.Votes[i].SignedLastBlock {
ext = votes[i].Extension
} else {
ext = nil
}
vs[i] = abci.ExtendedVoteInfo{ vs[i] = abci.ExtendedVoteInfo{
Validator: c.Votes[i].Validator, Validator: c.Votes[i].Validator,
SignedLastBlock: c.Votes[i].SignedLastBlock, SignedLastBlock: c.Votes[i].SignedLastBlock,
/*
TODO: Include vote extensions information when implementing vote extensions.
VoteExtension: []byte{},
*/
VoteExtension: ext,
} }
} }
return abci.ExtendedCommitInfo{ return abci.ExtendedCommitInfo{


+ 12
- 12
internal/state/execution_test.go View File

@ -648,8 +648,8 @@ func TestEmptyPrepareProposal(t *testing.T) {
eventBus, eventBus,
) )
pa, _ := state.Validators.GetByIndex(0) pa, _ := state.Validators.GetByIndex(0)
commit := makeValidCommit(ctx, t, height, types.BlockID{}, state.Validators, privVals)
_, err = blockExec.CreateProposalBlock(ctx, height, state, commit, pa, nil)
commit, votes := makeValidCommit(ctx, t, height, types.BlockID{}, state.Validators, privVals)
_, err = blockExec.CreateProposalBlock(ctx, height, state, commit, pa, votes)
require.NoError(t, err) require.NoError(t, err)
} }
@ -702,10 +702,10 @@ func TestPrepareProposalPanicOnInvalid(t *testing.T) {
eventBus, eventBus,
) )
pa, _ := state.Validators.GetByIndex(0) pa, _ := state.Validators.GetByIndex(0)
commit := makeValidCommit(ctx, t, height, types.BlockID{}, state.Validators, privVals)
commit, votes := makeValidCommit(ctx, t, height, types.BlockID{}, state.Validators, privVals)
require.Panics(t, require.Panics(t,
func() { func() {
blockExec.CreateProposalBlock(ctx, height, state, commit, pa, nil) //nolint:errcheck
blockExec.CreateProposalBlock(ctx, height, state, commit, pa, votes) //nolint:errcheck
}) })
mp.AssertExpectations(t) mp.AssertExpectations(t)
@ -759,8 +759,8 @@ func TestPrepareProposalRemoveTxs(t *testing.T) {
eventBus, eventBus,
) )
pa, _ := state.Validators.GetByIndex(0) pa, _ := state.Validators.GetByIndex(0)
commit := makeValidCommit(ctx, t, height, types.BlockID{}, state.Validators, privVals)
block, err := blockExec.CreateProposalBlock(ctx, height, state, commit, pa, nil)
commit, votes := makeValidCommit(ctx, t, height, types.BlockID{}, state.Validators, privVals)
block, err := blockExec.CreateProposalBlock(ctx, height, state, commit, pa, votes)
require.NoError(t, err) require.NoError(t, err)
require.Len(t, block.Data.Txs.ToSliceOfBytes(), len(trs)-2) require.Len(t, block.Data.Txs.ToSliceOfBytes(), len(trs)-2)
@ -818,8 +818,8 @@ func TestPrepareProposalAddedTxsIncluded(t *testing.T) {
eventBus, eventBus,
) )
pa, _ := state.Validators.GetByIndex(0) pa, _ := state.Validators.GetByIndex(0)
commit := makeValidCommit(ctx, t, height, types.BlockID{}, state.Validators, privVals)
block, err := blockExec.CreateProposalBlock(ctx, height, state, commit, pa, nil)
commit, votes := makeValidCommit(ctx, t, height, types.BlockID{}, state.Validators, privVals)
block, err := blockExec.CreateProposalBlock(ctx, height, state, commit, pa, votes)
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, txs[0], block.Data.Txs[0]) require.Equal(t, txs[0], block.Data.Txs[0])
@ -874,8 +874,8 @@ func TestPrepareProposalReorderTxs(t *testing.T) {
eventBus, eventBus,
) )
pa, _ := state.Validators.GetByIndex(0) pa, _ := state.Validators.GetByIndex(0)
commit := makeValidCommit(ctx, t, height, types.BlockID{}, state.Validators, privVals)
block, err := blockExec.CreateProposalBlock(ctx, height, state, commit, pa, nil)
commit, votes := makeValidCommit(ctx, t, height, types.BlockID{}, state.Validators, privVals)
block, err := blockExec.CreateProposalBlock(ctx, height, state, commit, pa, votes)
require.NoError(t, err) require.NoError(t, err)
for i, tx := range block.Data.Txs { for i, tx := range block.Data.Txs {
require.Equal(t, types.Tx(trs[i].Tx), tx) require.Equal(t, types.Tx(trs[i].Tx), tx)
@ -937,8 +937,8 @@ func TestPrepareProposalModifiedTxStatusFalse(t *testing.T) {
eventBus, eventBus,
) )
pa, _ := state.Validators.GetByIndex(0) pa, _ := state.Validators.GetByIndex(0)
commit := makeValidCommit(ctx, t, height, types.BlockID{}, state.Validators, privVals)
block, err := blockExec.CreateProposalBlock(ctx, height, state, commit, pa, nil)
commit, votes := makeValidCommit(ctx, t, height, types.BlockID{}, state.Validators, privVals)
block, err := blockExec.CreateProposalBlock(ctx, height, state, commit, pa, votes)
require.NoError(t, err) require.NoError(t, err)
for i, tx := range block.Data.Txs { for i, tx := range block.Data.Txs {
require.Equal(t, txs[i], tx) require.Equal(t, txs[i], tx)


+ 7
- 5
internal/state/helpers_test.go View File

@ -46,7 +46,7 @@ func makeAndCommitGoodBlock(
state, blockID := makeAndApplyGoodBlock(ctx, t, state, height, lastCommit, proposerAddr, blockExec, evidence) state, blockID := makeAndApplyGoodBlock(ctx, t, state, height, lastCommit, proposerAddr, blockExec, evidence)
// Simulate a lastCommit for this block from all validators for the next height // Simulate a lastCommit for this block from all validators for the next height
commit := makeValidCommit(ctx, t, height, blockID, state.Validators, privVals)
commit, _ := makeValidCommit(ctx, t, height, blockID, state.Validators, privVals)
return state, blockID, commit return state, blockID, commit
} }
@ -82,17 +82,19 @@ func makeValidCommit(
blockID types.BlockID, blockID types.BlockID,
vals *types.ValidatorSet, vals *types.ValidatorSet,
privVals map[string]types.PrivValidator, privVals map[string]types.PrivValidator,
) *types.Commit {
) (*types.Commit, []*types.Vote) {
t.Helper() t.Helper()
sigs := make([]types.CommitSig, 0)
sigs := make([]types.CommitSig, vals.Size())
votes := make([]*types.Vote, vals.Size())
for i := 0; i < vals.Size(); i++ { for i := 0; i < vals.Size(); i++ {
_, val := vals.GetByIndex(int32(i)) _, val := vals.GetByIndex(int32(i))
vote, err := factory.MakeVote(ctx, privVals[val.Address.String()], chainID, int32(i), height, 0, 2, blockID, time.Now()) vote, err := factory.MakeVote(ctx, privVals[val.Address.String()], chainID, int32(i), height, 0, 2, blockID, time.Now())
require.NoError(t, err) require.NoError(t, err)
sigs = append(sigs, vote.CommitSig())
sigs[i] = vote.CommitSig()
votes[i] = vote
} }
return types.NewCommit(height, 0, blockID, sigs)
return types.NewCommit(height, 0, blockID, sigs), votes
} }
func makeState(t *testing.T, nVals, height int) (sm.State, dbm.DB, map[string]types.PrivValidator) { func makeState(t *testing.T, nVals, height int) (sm.State, dbm.DB, map[string]types.PrivValidator) {


+ 4
- 1
node/node_test.go View File

@ -531,8 +531,11 @@ func TestMaxProposalBlockSize(t *testing.T) {
BlockID: blockID, BlockID: blockID,
} }
votes := make([]*types.Vote, types.MaxVotesCount)
// add maximum amount of signatures to a single commit // add maximum amount of signatures to a single commit
for i := 0; i < types.MaxVotesCount; i++ { for i := 0; i < types.MaxVotesCount; i++ {
votes[i] = &types.Vote{}
commit.Signatures = append(commit.Signatures, cs) commit.Signatures = append(commit.Signatures, cs)
} }
@ -541,7 +544,7 @@ func TestMaxProposalBlockSize(t *testing.T) {
math.MaxInt64, math.MaxInt64,
state, commit, state, commit,
proposerAddr, proposerAddr,
nil,
votes,
) )
require.NoError(t, err) require.NoError(t, err)
partSet, err := block.MakePartSet(types.BlockPartSizeBytes) partSet, err := block.MakePartSet(types.BlockPartSizeBytes)


+ 11
- 1
privval/file.go View File

@ -398,10 +398,20 @@ func (pv *FilePV) signVote(chainID string, vote *tmproto.Vote) error {
if err != nil { if err != nil {
return err return err
} }
if err := pv.saveSigned(height, round, step, signBytes, sig); err != nil {
if err = pv.saveSigned(height, round, step, signBytes, sig); err != nil {
return err return err
} }
vote.Signature = sig vote.Signature = sig
// Sign the vote extension, if any
if len(vote.Extension) > 0 {
var err error
vote.ExtensionSignature, err = pv.Key.PrivKey.Sign(vote.Extension)
if err != nil {
return err
}
}
return nil return nil
} }


+ 8
- 17
privval/msgs_test.go View File

@ -22,23 +22,14 @@ var stamp = time.Date(2019, 10, 13, 16, 14, 44, 0, time.UTC)
func exampleVote() *types.Vote { func exampleVote() *types.Vote {
return &types.Vote{ return &types.Vote{
Type: tmproto.SignedMsgType(1),
Height: 3,
Round: 2,
Timestamp: stamp,
BlockID: types.BlockID{
Hash: tmhash.Sum([]byte("blockID_hash")),
PartSetHeader: types.PartSetHeader{
Total: 1000000,
Hash: tmhash.Sum([]byte("blockID_part_set_header_hash")),
},
},
Type: tmproto.SignedMsgType(1),
Height: 3,
Round: 2,
BlockID: types.BlockID{Hash: tmhash.Sum([]byte("blockID_hash")), PartSetHeader: types.PartSetHeader{Total: 1000000, Hash: tmhash.Sum([]byte("blockID_part_set_header_hash"))}},
Timestamp: stamp,
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"),
},
Extension: []byte("app_data_signed"),
} }
} }
@ -87,8 +78,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}, "1aa8010aa501080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb034a2f0a0f6170705f646174615f7369676e6564121c6170705f646174615f73656c665f61757468656e7469636174696e67"},
{"Vote Response", &privproto.SignedVoteResponse{Vote: *votepb, Error: nil}, "22a8010aa501080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb034a2f0a0f6170705f646174615f7369676e6564121c6170705f646174615f73656c665f61757468656e7469636174696e67"},
{"Vote Request", &privproto.SignVoteRequest{Vote: votepb}, "1a88010a8501080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb034a0f6170705f646174615f7369676e6564"},
{"Vote Response", &privproto.SignedVoteResponse{Vote: *votepb, Error: nil}, "2288010a8501080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb034a0f6170705f646174615f7369676e6564"},
{"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"},


+ 15
- 19
proto/tendermint/abci/types.proto View File

@ -362,7 +362,7 @@ message ResponseFinalizeBlock {
repeated Event events = 1 repeated Event events = 1
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
repeated ExecTxResult tx_results = 2; repeated ExecTxResult tx_results = 2;
repeated ValidatorUpdate validator_updates = 3;
repeated ValidatorUpdate validator_updates = 3 [(gogoproto.nullable) = false];
tendermint.types.ConsensusParams consensus_param_updates = 4; tendermint.types.ConsensusParams consensus_param_updates = 4;
bytes app_hash = 5; bytes app_hash = 5;
int64 retain_height = 6; int64 retain_height = 6;
@ -377,7 +377,10 @@ message CommitInfo {
} }
message ExtendedCommitInfo { message ExtendedCommitInfo {
int32 round = 1;
// The round at which the block proposer decided in the previous height.
int32 round = 1;
// List of validators' addresses in the last validator set with their voting
// information, including vote extensions.
repeated ExtendedVoteInfo votes = 2 [(gogoproto.nullable) = false]; repeated ExtendedVoteInfo votes = 2 [(gogoproto.nullable) = false];
} }
@ -415,10 +418,10 @@ message ExecTxResult {
// //
// One usage is indexing transaction results. // One usage is indexing transaction results.
message TxResult { message TxResult {
int64 height = 1;
uint32 index = 2;
bytes tx = 3;
ResponseDeliverTx result = 4 [(gogoproto.nullable) = false];
int64 height = 1;
uint32 index = 2;
bytes tx = 3;
ExecTxResult result = 4 [(gogoproto.nullable) = false];
} }
message TxRecord { message TxRecord {
@ -458,19 +461,12 @@ message VoteInfo {
// ExtendedVoteInfo // ExtendedVoteInfo
message ExtendedVoteInfo { message ExtendedVoteInfo {
Validator validator = 1 [(gogoproto.nullable) = false];
bool signed_last_block = 2;
bytes vote_extension = 3;
}
// CanonicalVoteExtension
// TODO: move this to core Tendermint data structures
message CanonicalVoteExtension {
bytes extension = 1;
int64 height = 2;
int32 round = 3;
string chain_id = 4;
bytes address = 5;
// The validator that sent the vote.
Validator validator = 1 [(gogoproto.nullable) = false];
// Indicates whether the validator signed the last block, allowing for rewards based on validator availability.
bool signed_last_block = 2;
// Non-deterministic extension provided by the sending validator's application.
bytes vote_extension = 3;
} }
enum EvidenceType { enum EvidenceType {


+ 21
- 7
proto/tendermint/abci/types.proto.intermediate View File

@ -145,12 +145,16 @@ message RequestProcessProposal {
// Extends a vote with application-side injection // Extends a vote with application-side injection
message RequestExtendVote { message RequestExtendVote {
types.Vote vote = 1;
bytes hash = 1;
int64 height = 2;
} }
// Verify the vote extension // Verify the vote extension
message RequestVerifyVoteExtension { message RequestVerifyVoteExtension {
types.Vote vote = 1;
bytes hash = 1;
bytes validator_address = 2;
int64 height = 3;
bytes vote_extension = 4;
} }
message RequestFinalizeBlock { message RequestFinalizeBlock {
@ -342,7 +346,7 @@ message ResponseProcessProposal {
} }
message ResponseExtendVote { message ResponseExtendVote {
tendermint.types.VoteExtension vote_extension = 1;
bytes vote_extension = 1;
} }
message ResponseVerifyVoteExtension { message ResponseVerifyVoteExtension {
@ -373,8 +377,14 @@ message CommitInfo {
repeated VoteInfo votes = 2 [(gogoproto.nullable) = false]; repeated VoteInfo votes = 2 [(gogoproto.nullable) = false];
} }
// ExtendedCommitInfo is similar to CommitInfo except that it is only used in
// the PrepareProposal request such that Tendermint can provide vote extensions
// to the application.
message ExtendedCommitInfo { message ExtendedCommitInfo {
int32 round = 1;
// The round at which the block proposer decided in the previous height.
int32 round = 1;
// List of validators' addresses in the last validator set with their voting
// information, including vote extensions.
repeated ExtendedVoteInfo votes = 2 [(gogoproto.nullable) = false]; repeated ExtendedVoteInfo votes = 2 [(gogoproto.nullable) = false];
} }
@ -455,10 +465,14 @@ message VoteInfo {
reserved 4; // Placeholder for app_signed_extension in v0.37 reserved 4; // Placeholder for app_signed_extension in v0.37
} }
// ExtendedVoteInfo
message ExtendedVoteInfo { message ExtendedVoteInfo {
Validator validator = 1 [(gogoproto.nullable) = false];
bool signed_last_block = 2;
bytes vote_extension = 3;
// The validator that sent the vote.
Validator validator = 1 [(gogoproto.nullable) = false];
// Indicates whether the validator signed the last block, allowing for rewards based on validator availability.
bool signed_last_block = 2;
// Non-deterministic extension provided by the sending validator's application.
bytes vote_extension = 3;
} }
enum EvidenceType { enum EvidenceType {


+ 360
- 72
proto/tendermint/types/canonical.pb.go View File

@ -225,13 +225,12 @@ 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"`
VoteExtension *VoteExtensionToSign `protobuf:"bytes,7,opt,name=vote_extension,json=voteExtension,proto3" json:"vote_extension,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"`
} }
func (m *CanonicalVote) Reset() { *m = CanonicalVote{} } func (m *CanonicalVote) Reset() { *m = CanonicalVote{} }
@ -309,9 +308,79 @@ func (m *CanonicalVote) GetChainID() string {
return "" return ""
} }
func (m *CanonicalVote) GetVoteExtension() *VoteExtensionToSign {
// CanonicalVoteExtension
type CanonicalVoteExtension struct {
Extension []byte `protobuf:"bytes,1,opt,name=extension,proto3" json:"extension,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"`
ChainId string `protobuf:"bytes,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
Address []byte `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"`
}
func (m *CanonicalVoteExtension) Reset() { *m = CanonicalVoteExtension{} }
func (m *CanonicalVoteExtension) String() string { return proto.CompactTextString(m) }
func (*CanonicalVoteExtension) ProtoMessage() {}
func (*CanonicalVoteExtension) Descriptor() ([]byte, []int) {
return fileDescriptor_8d1a1a84ff7267ed, []int{4}
}
func (m *CanonicalVoteExtension) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *CanonicalVoteExtension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_CanonicalVoteExtension.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 *CanonicalVoteExtension) XXX_Merge(src proto.Message) {
xxx_messageInfo_CanonicalVoteExtension.Merge(m, src)
}
func (m *CanonicalVoteExtension) XXX_Size() int {
return m.Size()
}
func (m *CanonicalVoteExtension) XXX_DiscardUnknown() {
xxx_messageInfo_CanonicalVoteExtension.DiscardUnknown(m)
}
var xxx_messageInfo_CanonicalVoteExtension proto.InternalMessageInfo
func (m *CanonicalVoteExtension) GetExtension() []byte {
if m != nil {
return m.Extension
}
return nil
}
func (m *CanonicalVoteExtension) GetHeight() int64 {
if m != nil {
return m.Height
}
return 0
}
func (m *CanonicalVoteExtension) GetRound() int32 {
if m != nil {
return m.Round
}
return 0
}
func (m *CanonicalVoteExtension) GetChainId() string {
if m != nil {
return m.ChainId
}
return ""
}
func (m *CanonicalVoteExtension) GetAddress() []byte {
if m != nil { if m != nil {
return m.VoteExtension
return m.Address
} }
return nil return nil
} }
@ -321,45 +390,47 @@ func init() {
proto.RegisterType((*CanonicalPartSetHeader)(nil), "tendermint.types.CanonicalPartSetHeader") proto.RegisterType((*CanonicalPartSetHeader)(nil), "tendermint.types.CanonicalPartSetHeader")
proto.RegisterType((*CanonicalProposal)(nil), "tendermint.types.CanonicalProposal") proto.RegisterType((*CanonicalProposal)(nil), "tendermint.types.CanonicalProposal")
proto.RegisterType((*CanonicalVote)(nil), "tendermint.types.CanonicalVote") proto.RegisterType((*CanonicalVote)(nil), "tendermint.types.CanonicalVote")
proto.RegisterType((*CanonicalVoteExtension)(nil), "tendermint.types.CanonicalVoteExtension")
} }
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{
// 522 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x94, 0x3f, 0x6f, 0xd3, 0x40,
0x18, 0xc6, 0xe3, 0xd4, 0x49, 0x9c, 0x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6, 0x59, 0x9d, 0x7f, 0x69, 0x56, 0xf7, 0xef, 0xcd, 0xea, 0x3d, 0x60, 0xd6, 0x37, 0xd0,
0xf8, 0x9a, 0x85, 0x59, 0xaf, 0xbe, 0x70, 0x1a, 0xa5, 0x01, 0x8b, 0xd0, 0x11, 0x1c, 0xd2, 0x12,
0x14, 0x3f, 0x56, 0x9d, 0xd8, 0xb1, 0x67, 0xef, 0x7e, 0x7b, 0xba, 0xa5, 0x3d, 0x4f, 0x1b, 0x72,
0x84, 0x3d, 0xc3, 0x4a, 0x01, 0x52, 0x60, 0x9f, 0xb8, 0x6e, 0x42, 0xd3, 0x54, 0xbe, 0xeb, 0x08,
0x97, 0xd0, 0xfe, 0x70, 0x93, 0xa9, 0xe0, 0x36, 0x53, 0xc1, 0xef, 0x4c, 0x05, 0xd7, 0x5b, 0xb5,
0x75, 0xbb, 0x55, 0x5b, 0x3f, 0xb6, 0x6a, 0xeb, 0xe3, 0x0b, 0x2f, 0xe0, 0xfe, 0x7a, 0x69, 0x3a,
0x6c, 0x65, 0x35, 0x2f, 0x93, 0x3a, 0xcc, 0x2f, 0x9d, 0xdd, 0x8b, 0x66, 0xd9, 0x93, 0xf9, 0x93,
0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5f, 0xba, 0xba, 0x40, 0xcd, 0x04, 0x00, 0x00,
} }
func (m *CanonicalBlockID) Marshal() (dAtA []byte, err error) { func (m *CanonicalBlockID) Marshal() (dAtA []byte, err error) {
@ -529,18 +600,6 @@ 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)
@ -548,12 +607,12 @@ func (m *CanonicalVote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i-- i--
dAtA[i] = 0x32 dAtA[i] = 0x32
} }
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
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
} }
i -= n5
i = encodeVarintCanonical(dAtA, i, uint64(n5))
i -= n4
i = encodeVarintCanonical(dAtA, i, uint64(n4))
i-- i--
dAtA[i] = 0x2a dAtA[i] = 0x2a
if m.BlockID != nil { if m.BlockID != nil {
@ -588,6 +647,60 @@ func (m *CanonicalVote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil return len(dAtA) - i, nil
} }
func (m *CanonicalVoteExtension) 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 *CanonicalVoteExtension) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *CanonicalVoteExtension) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Address) > 0 {
i -= len(m.Address)
copy(dAtA[i:], m.Address)
i = encodeVarintCanonical(dAtA, i, uint64(len(m.Address)))
i--
dAtA[i] = 0x2a
}
if len(m.ChainId) > 0 {
i -= len(m.ChainId)
copy(dAtA[i:], m.ChainId)
i = encodeVarintCanonical(dAtA, i, uint64(len(m.ChainId)))
i--
dAtA[i] = 0x22
}
if m.Round != 0 {
i = encodeVarintCanonical(dAtA, i, uint64(m.Round))
i--
dAtA[i] = 0x18
}
if m.Height != 0 {
i = encodeVarintCanonical(dAtA, i, uint64(m.Height))
i--
dAtA[i] = 0x10
}
if len(m.Extension) > 0 {
i -= len(m.Extension)
copy(dAtA[i:], m.Extension)
i = encodeVarintCanonical(dAtA, i, uint64(len(m.Extension)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintCanonical(dAtA []byte, offset int, v uint64) int { func encodeVarintCanonical(dAtA []byte, offset int, v uint64) int {
offset -= sovCanonical(v) offset -= sovCanonical(v)
base := offset base := offset
@ -686,8 +799,31 @@ 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()
return n
}
func (m *CanonicalVoteExtension) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Extension)
if l > 0 {
n += 1 + l + sovCanonical(uint64(l))
}
if m.Height != 0 {
n += 1 + sovCanonical(uint64(m.Height))
}
if m.Round != 0 {
n += 1 + sovCanonical(uint64(m.Round))
}
l = len(m.ChainId)
if l > 0 {
n += 1 + l + sovCanonical(uint64(l))
}
l = len(m.Address)
if l > 0 {
n += 1 + l + sovCanonical(uint64(l)) n += 1 + l + sovCanonical(uint64(l))
} }
return n return n
@ -1297,11 +1433,61 @@ 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:
default:
iNdEx = preIndex
skippy, err := skipCanonical(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthCanonical
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *CanonicalVoteExtension) 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 ErrIntOverflowCanonical
}
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: CanonicalVoteExtension: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: CanonicalVoteExtension: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field VoteExtension", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field Extension", wireType)
} }
var msglen int
var byteLen int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
if shift >= 64 { if shift >= 64 {
return ErrIntOverflowCanonical return ErrIntOverflowCanonical
@ -1311,26 +1497,128 @@ func (m *CanonicalVote) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
msglen |= int(b&0x7F) << shift
byteLen |= int(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
} }
if msglen < 0 {
if byteLen < 0 {
return ErrInvalidLengthCanonical return ErrInvalidLengthCanonical
} }
postIndex := iNdEx + msglen
postIndex := iNdEx + byteLen
if postIndex < 0 { if postIndex < 0 {
return ErrInvalidLengthCanonical return ErrInvalidLengthCanonical
} }
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
if m.VoteExtension == nil {
m.VoteExtension = &VoteExtensionToSign{}
m.Extension = append(m.Extension[:0], dAtA[iNdEx:postIndex]...)
if m.Extension == nil {
m.Extension = []byte{}
} }
if err := m.VoteExtension.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType)
}
m.Height = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCanonical
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Height |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType)
}
m.Round = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCanonical
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Round |= int32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCanonical
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthCanonical
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthCanonical
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ChainId = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCanonical
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthCanonical
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthCanonical
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...)
if m.Address == nil {
m.Address = []byte{}
} }
iNdEx = postIndex iNdEx = postIndex
default: default:


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

@ -35,3 +35,12 @@ message CanonicalVote {
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"];
} }
// CanonicalVoteExtension
message CanonicalVoteExtension {
bytes extension = 1;
int64 height = 2;
int32 round = 3;
string chain_id = 4;
bytes address = 5;
}

+ 150
- 566
proto/tendermint/types/types.pb.go View File

@ -466,15 +466,19 @@ 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"`
VoteExtension *VoteExtension `protobuf:"bytes,9,opt,name=vote_extension,json=voteExtension,proto3" json:"vote_extension,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 by the validator if they participated in consensus for the associated block.
Signature []byte `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty"`
// Vote extension provided by the application. Only valid for precommit messages.
Extension []byte `protobuf:"bytes,9,opt,name=extension,proto3" json:"extension,omitempty"`
// Signature by the validator if they participated in consensus for the associated block.
ExtensionSignature []byte `protobuf:"bytes,10,opt,name=extension_signature,json=extensionSignature,proto3" json:"extension_signature,omitempty"`
} }
func (m *Vote) Reset() { *m = Vote{} } func (m *Vote) Reset() { *m = Vote{} }
@ -566,108 +570,16 @@ func (m *Vote) GetSignature() []byte {
return nil return nil
} }
func (m *Vote) GetVoteExtension() *VoteExtension {
func (m *Vote) GetExtension() []byte {
if m != nil { if m != nil {
return m.VoteExtension
return m.Extension
} }
return nil 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 {
func (m *Vote) GetExtensionSignature() []byte {
if m != nil { if m != nil {
return m.AppDataToSign
return m.ExtensionSignature
} }
return nil return nil
} }
@ -685,7 +597,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{8}
return fileDescriptor_d3a6e55e2345de56, []int{6}
} }
func (m *Commit) XXX_Unmarshal(b []byte) error { func (m *Commit) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -744,18 +656,17 @@ 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"`
VoteExtension *VoteExtensionToSign `protobuf:"bytes,5,opt,name=vote_extension,json=voteExtension,proto3" json:"vote_extension,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"`
} }
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{9}
return fileDescriptor_d3a6e55e2345de56, []int{7}
} }
func (m *CommitSig) XXX_Unmarshal(b []byte) error { func (m *CommitSig) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -812,13 +723,6 @@ 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"`
@ -833,7 +737,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{10}
return fileDescriptor_d3a6e55e2345de56, []int{8}
} }
func (m *Proposal) XXX_Unmarshal(b []byte) error { func (m *Proposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -920,7 +824,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{11}
return fileDescriptor_d3a6e55e2345de56, []int{9}
} }
func (m *SignedHeader) XXX_Unmarshal(b []byte) error { func (m *SignedHeader) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -972,7 +876,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{12}
return fileDescriptor_d3a6e55e2345de56, []int{10}
} }
func (m *LightBlock) XXX_Unmarshal(b []byte) error { func (m *LightBlock) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -1026,7 +930,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{13}
return fileDescriptor_d3a6e55e2345de56, []int{11}
} }
func (m *BlockMeta) XXX_Unmarshal(b []byte) error { func (m *BlockMeta) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -1095,7 +999,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{14}
return fileDescriptor_d3a6e55e2345de56, []int{12}
} }
func (m *TxProof) XXX_Unmarshal(b []byte) error { func (m *TxProof) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -1154,8 +1058,6 @@ 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")
@ -1168,96 +1070,91 @@ 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{
// 1423 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4f, 0x6f, 0xdb, 0x64,
0x18, 0xaf, 0x13, 0xb7, 0x49, 0x9e, 0xc4, 0x6d, 0xfa, 0xd2, 0x6d, 0x69, 0xb6, 0xa6, 0x91, 0xd1,
0x58, 0x37, 0x50, 0x3a, 0x3a, 0xc4, 0x9f, 0x03, 0xa0, 0x24, 0xcd, 0xb6, 0x68, 0x6d, 0x1a, 0x9c,
0x6c, 0x08, 0x2e, 0x96, 0x93, 0xbc, 0x4d, 0xcc, 0x1c, 0xdb, 0xb2, 0xdf, 0x94, 0x76, 0x9f, 0x00,
0xf5, 0xb4, 0x13, 0xb7, 0x9e, 0xe0, 0x80, 0xc4, 0x05, 0x89, 0x2f, 0x80, 0x38, 0xed, 0xb8, 0x1b,
0x9c, 0x06, 0xea, 0x24, 0x3e, 0x07, 0x7a, 0xff, 0xc4, 0xb1, 0x9b, 0x86, 0x4d, 0xd5, 0xc4, 0x25,
0xf2, 0xfb, 0x3c, 0xbf, 0xe7, 0xff, 0xcf, 0x8f, 0xdf, 0xc0, 0x35, 0x82, 0xed, 0x1e, 0xf6, 0x86,
0xa6, 0x4d, 0x36, 0xc9, 0x91, 0x8b, 0x7d, 0xfe, 0x5b, 0x72, 0x3d, 0x87, 0x38, 0x28, 0x3b, 0xd1,
0x96, 0x98, 0x3c, 0xbf, 0xd2, 0x77, 0xfa, 0x0e, 0x53, 0x6e, 0xd2, 0x27, 0x8e, 0xcb, 0xaf, 0xf7,
0x1d, 0xa7, 0x6f, 0xe1, 0x4d, 0x76, 0xea, 0x8c, 0xf6, 0x37, 0x89,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 0x36, 0xba, 0x0c, 0x8b, 0x43, 0xec, 0x0c, 0x86, 0x94, 0x97, 0x25, 0x65,
0xc8, 0x15, 0xfa, 0x18, 0x54, 0x46, 0x88, 0x92, 0xca, 0xf7, 0x2e, 0xeb, 0x82, 0x2d, 0x7a, 0xc4,
0x16, 0xbd, 0x1b, 0xb1, 0xa5, 0x9e, 0x61, 0x1b, 0x3f, 0xfd, 0x63, 0x5d, 0x31, 0xb8, 0x05, 0x6a,
0x40, 0xc1, 0xb5, 0x08, 0x35, 0x7b, 0xac, 0x6c, 0x6c, 0xfb, 0x05, 0xee, 0xe2, 0xea, 0x6c, 0x41,
0x64, 0x61, 0x65, 0xe8, 0x39, 0x66, 0x25, 0x44, 0x36, 0xda, 0x80, 0x22, 0x77, 0xd2, 0xf7, 0x47,
0x23, 0x87, 0x9a, 0xbc, 0xee, 0x8b, 0xbc, 0xee, 0x4b, 0x4c, 0xde, 0xe0, 0xe2, 0x7b, 0xac, 0x03,
0xd7, 0x20, 0x6b, 0x5b, 0xd4, 0x12, 0x90, 0x34, 0x87, 0x64, 0x98, 0x80, 0x2b, 0xdf, 0x81, 0xe5,
0x98, 0x75, 0x44, 0x40, 0x32, 0xc2, 0xcb, 0x44, 0xcc, 0x81, 0xb7, 0x60, 0xd5, 0xc3, 0x87, 0xd4,
0x3c, 0x8b, 0xce, 0x72, 0x34, 0x62, 0xba, 0x87, 0xd3, 0x16, 0x6f, 0xc1, 0x52, 0x3f, 0x2a, 0xbe,
0xc0, 0x02, 0xc7, 0x16, 0x62, 0x29, 0x87, 0x5d, 0x85, 0x8c, 0x15, 0x04, 0x02, 0x90, 0xe3, 0x80,
0xb4, 0x15, 0x04, 0x5c, 0x75, 0x13, 0x56, 0x78, 0x8e, 0x21, 0x26, 0x63, 0x97, 0x4a, 0x27, 0x79,
0x8e, 0x59, 0x66, 0x0a, 0x43, 0xc8, 0x39, 0xf6, 0xff, 0x50, 0xc0, 0x07, 0x8e, 0x8d, 0xbd, 0x3e,
0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 0xa3, 0xcd,
0xe4, 0x3f, 0x8c, 0xc9, 0xa7, 0xf8, 0xa7, 0x73, 0xf6, 0xdf, 0x47, 0x6f, 0x91, 0xcb, 0x6f, 0xff,
0x1d, 0x00, 0x00, 0xff, 0xff, 0xbb, 0xc0, 0x81, 0x37, 0x3e, 0x0d, 0x00, 0x00,
} }
func (m *PartSetHeader) Marshal() (dAtA []byte, err error) { func (m *PartSetHeader) Marshal() (dAtA []byte, err error) {
@ -1558,15 +1455,17 @@ 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))
}
if len(m.ExtensionSignature) > 0 {
i -= len(m.ExtensionSignature)
copy(dAtA[i:], m.ExtensionSignature)
i = encodeVarintTypes(dAtA, i, uint64(len(m.ExtensionSignature)))
i--
dAtA[i] = 0x52
}
if len(m.Extension) > 0 {
i -= len(m.Extension)
copy(dAtA[i:], m.Extension)
i = encodeVarintTypes(dAtA, i, uint64(len(m.Extension)))
i-- i--
dAtA[i] = 0x4a dAtA[i] = 0x4a
} }
@ -1589,12 +1488,12 @@ func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i-- i--
dAtA[i] = 0x32 dAtA[i] = 0x32
} }
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
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
} }
i -= n7
i = encodeVarintTypes(dAtA, i, uint64(n7))
i -= n6
i = encodeVarintTypes(dAtA, i, uint64(n6))
i-- i--
dAtA[i] = 0x2a dAtA[i] = 0x2a
{ {
@ -1625,73 +1524,6 @@ 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)
@ -1769,18 +1601,6 @@ 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)
@ -1788,12 +1608,12 @@ func (m *CommitSig) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i-- i--
dAtA[i] = 0x22 dAtA[i] = 0x22
} }
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
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
} }
i -= n11
i = encodeVarintTypes(dAtA, i, uint64(n11))
i -= n9
i = encodeVarintTypes(dAtA, i, uint64(n9))
i-- i--
dAtA[i] = 0x1a dAtA[i] = 0x1a
if len(m.ValidatorAddress) > 0 { if len(m.ValidatorAddress) > 0 {
@ -1838,12 +1658,12 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i-- i--
dAtA[i] = 0x3a dAtA[i] = 0x3a
} }
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
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
} }
i -= n12
i = encodeVarintTypes(dAtA, i, uint64(n12))
i -= n10
i = encodeVarintTypes(dAtA, i, uint64(n10))
i-- i--
dAtA[i] = 0x32 dAtA[i] = 0x32
{ {
@ -2238,37 +2058,11 @@ 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)
l = len(m.Extension)
if l > 0 { if l > 0 {
n += 1 + l + sovTypes(uint64(l)) 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)
l = len(m.ExtensionSignature)
if l > 0 { if l > 0 {
n += 1 + l + sovTypes(uint64(l)) n += 1 + l + sovTypes(uint64(l))
} }
@ -2317,10 +2111,6 @@ 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
} }
@ -3618,127 +3408,7 @@ func (m *Vote) Unmarshal(dAtA []byte) error {
iNdEx = postIndex iNdEx = postIndex
case 9: case 9:
if wireType != 2 { 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)
return fmt.Errorf("proto: wrong wireType = %d for field Extension", wireType)
} }
var byteLen int var byteLen int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -3765,64 +3435,14 @@ func (m *VoteExtension) Unmarshal(dAtA []byte) error {
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
m.AppDataSelfAuthenticating = append(m.AppDataSelfAuthenticating[:0], dAtA[iNdEx:postIndex]...)
if m.AppDataSelfAuthenticating == nil {
m.AppDataSelfAuthenticating = []byte{}
m.Extension = append(m.Extension[:0], dAtA[iNdEx:postIndex]...)
if m.Extension == nil {
m.Extension = []byte{}
} }
iNdEx = postIndex 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:
case 10:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field AppDataToSign", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field ExtensionSignature", wireType)
} }
var byteLen int var byteLen int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -3849,9 +3469,9 @@ func (m *VoteExtensionToSign) Unmarshal(dAtA []byte) error {
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
m.AppDataToSign = append(m.AppDataToSign[:0], dAtA[iNdEx:postIndex]...)
if m.AppDataToSign == nil {
m.AppDataToSign = []byte{}
m.ExtensionSignature = append(m.ExtensionSignature[:0], dAtA[iNdEx:postIndex]...)
if m.ExtensionSignature == nil {
m.ExtensionSignature = []byte{}
} }
iNdEx = postIndex iNdEx = postIndex
default: default:
@ -4179,42 +3799,6 @@ 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:])


+ 6
- 1
proto/tendermint/types/types.proto View File

@ -112,7 +112,12 @@ message Vote {
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
bytes validator_address = 6; bytes validator_address = 6;
int32 validator_index = 7; int32 validator_index = 7;
bytes signature = 8;
// Signature by the validator if they participated in consensus for the associated block.
bytes signature = 8;
// Vote extension provided by the application. Only valid for precommit messages.
bytes extension = 9;
// Signature by the validator if they participated in consensus for the associated block.
bytes extension_signature = 10;
} }
// 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


+ 2
- 2
scripts/abci-gen.sh View File

@ -12,9 +12,9 @@ cp ./proto/tendermint/types/types.proto.intermediate ./proto/tendermint/types/ty
MODNAME="$(go list -m)" MODNAME="$(go list -m)"
find ./proto/tendermint -name '*.proto' -not -path "./proto/tendermint/abci/types.proto" \ find ./proto/tendermint -name '*.proto' -not -path "./proto/tendermint/abci/types.proto" \
-exec sh ./scripts/protopackage.sh {} "$MODNAME" ';'
-exec ./scripts/protopackage.sh {} "$MODNAME" ';'
sh ./scripts/protopackage.sh ./proto/tendermint/abci/types.proto $MODNAME "abci/types"
./scripts/protopackage.sh ./proto/tendermint/abci/types.proto $MODNAME "abci/types"
make proto-gen make proto-gen


+ 1
- 1
scripts/protopackage.sh View File

@ -1,4 +1,4 @@
#!/usr/bin/sh
#!/bin/bash
set -eo pipefail set -eo pipefail
# This script appends the "option go_package" proto option to the file located at $FNAME. # This script appends the "option go_package" proto option to the file located at $FNAME.


+ 7
- 14
types/block.go View File

@ -603,21 +603,19 @@ 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"`
VoteExtension VoteExtensionToSign `json:"vote_extension"`
BlockIDFlag BlockIDFlag `json:"block_id_flag"`
ValidatorAddress Address `json:"validator_address"`
Timestamp time.Time `json:"timestamp"`
Signature []byte `json:"signature"`
} }
// NewCommitSigForBlock returns new CommitSig with BlockIDFlagCommit. // NewCommitSigForBlock returns new CommitSig with BlockIDFlagCommit.
func NewCommitSigForBlock(signature []byte, valAddr Address, ts time.Time, ext VoteExtensionToSign) CommitSig {
func NewCommitSigForBlock(signature []byte, valAddr Address, ts time.Time) CommitSig {
return CommitSig{ return CommitSig{
BlockIDFlag: BlockIDFlagCommit, BlockIDFlag: BlockIDFlagCommit,
ValidatorAddress: valAddr, ValidatorAddress: valAddr,
Timestamp: ts, Timestamp: ts,
Signature: signature, Signature: signature,
VoteExtension: ext,
} }
} }
@ -650,14 +648,12 @@ 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. first 6 bytes of the vote extension
// 5. timestamp
// 4. timestamp
func (cs CommitSig) String() string { func (cs CommitSig) String() string {
return fmt.Sprintf("CommitSig{%X by %X on %v with %X @ %s}",
return fmt.Sprintf("CommitSig{%X by %X on %v @ %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))
} }
@ -729,7 +725,6 @@ func (cs *CommitSig) ToProto() *tmproto.CommitSig {
ValidatorAddress: cs.ValidatorAddress, ValidatorAddress: cs.ValidatorAddress,
Timestamp: cs.Timestamp, Timestamp: cs.Timestamp,
Signature: cs.Signature, Signature: cs.Signature,
VoteExtension: cs.VoteExtension.ToProto(),
} }
} }
@ -741,7 +736,6 @@ func (cs *CommitSig) FromProto(csp tmproto.CommitSig) error {
cs.ValidatorAddress = csp.ValidatorAddress cs.ValidatorAddress = csp.ValidatorAddress
cs.Timestamp = csp.Timestamp cs.Timestamp = csp.Timestamp
cs.Signature = csp.Signature cs.Signature = csp.Signature
cs.VoteExtension = VoteExtensionToSignFromProto(csp.VoteExtension)
return cs.ValidateBasic() return cs.ValidateBasic()
} }
@ -808,7 +802,6 @@ 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(),
} }
} }


+ 8
- 17
types/canonical.go View File

@ -51,26 +51,17 @@ 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, or any fields
// relating to vote extensions.
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,
VoteExtension: GetVoteExtensionToSign(vote.VoteExtension),
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,
} }
} }


+ 6
- 0
types/priv_validator.go View File

@ -95,6 +95,12 @@ func (pv MockPV) SignVote(ctx context.Context, chainID string, vote *tmproto.Vot
return err return err
} }
vote.Signature = sig vote.Signature = sig
if len(vote.Extension) > 0 {
vote.ExtensionSignature, err = pv.PrivKey.Sign(vote.Extension)
if err != nil {
return err
}
}
return nil return nil
} }


+ 30
- 130
types/vote.go View File

@ -46,86 +46,19 @@ 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"`
}
func (ext VoteExtensionToSign) ToProto() *tmproto.VoteExtensionToSign {
if ext.IsEmpty() {
return nil
}
return &tmproto.VoteExtensionToSign{
AppDataToSign: ext.AppDataToSign,
}
}
func VoteExtensionToSignFromProto(pext *tmproto.VoteExtensionToSign) VoteExtensionToSign {
if pext == nil {
return VoteExtensionToSign{}
}
return VoteExtensionToSign{
AppDataToSign: pext.AppDataToSign,
}
}
func (ext VoteExtensionToSign) IsEmpty() bool {
return len(ext.AppDataToSign) == 0
}
// 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 := []byte{}
res = append(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 := []byte{}
res = append(res, ext.AppDataToSign...)
res = append(res, 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 {
Type tmproto.SignedMsgType `json:"type"`
Height int64 `json:"height,string"`
Round int32 `json:"round"` // assume there will not be greater than 2_147_483_647 rounds
BlockID BlockID `json:"block_id"` // zero if vote is nil.
Timestamp time.Time `json:"timestamp"`
ValidatorAddress Address `json:"validator_address"`
ValidatorIndex int32 `json:"validator_index"`
Signature []byte `json:"signature"`
VoteExtension VoteExtension `json:"vote_extension"`
Type tmproto.SignedMsgType `json:"type"`
Height int64 `json:"height,string"`
Round int32 `json:"round"` // assume there will not be greater than 2_147_483_647 rounds
BlockID BlockID `json:"block_id"` // zero if vote is nil.
Timestamp time.Time `json:"timestamp"`
ValidatorAddress Address `json:"validator_address"`
ValidatorIndex int32 `json:"validator_index"`
Signature []byte `json:"signature"`
Extension []byte `json:"extension"`
ExtensionSignature []byte `json:"extension_signature"`
} }
// CommitSig converts the Vote to a CommitSig. // CommitSig converts the Vote to a CommitSig.
@ -149,12 +82,11 @@ 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(),
} }
} }
// VoteSignBytes returns the proto-encoding of the canonicalized Vote, for // VoteSignBytes returns the proto-encoding of the canonicalized Vote, for
// signing. Panics is the marshaling fails.
// signing. Panics if the marshaling fails.
// //
// The encoded Protobuf message is varint length-prefixed (using MarshalDelimited) // The encoded Protobuf message is varint length-prefixed (using MarshalDelimited)
// for backwards-compatibility with the Amino encoding, due to e.g. hardware // for backwards-compatibility with the Amino encoding, due to e.g. hardware
@ -173,7 +105,6 @@ 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
} }
@ -213,7 +144,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()),
tmbytes.Fingerprint(vote.Extension),
CanonicalTime(vote.Timestamp), CanonicalTime(vote.Timestamp),
) )
} }
@ -226,6 +157,9 @@ func (vote *Vote) Verify(chainID string, pubKey crypto.PubKey) error {
if !pubKey.VerifySignature(VoteSignBytes(chainID, v), vote.Signature) { if !pubKey.VerifySignature(VoteSignBytes(chainID, v), vote.Signature) {
return ErrVoteInvalidSignature return ErrVoteInvalidSignature
} }
if vote.Extension != nil && !pubKey.VerifySignature(vote.Extension, vote.ExtensionSignature) {
return ErrVoteInvalidSignature
}
return nil return nil
} }
@ -272,38 +206,11 @@ 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
}
func (ext VoteExtension) Copy() VoteExtension {
res := VoteExtension{
AppDataToSign: ext.AppDataToSign,
AppDataSelfAuthenticating: ext.AppDataSelfAuthenticating,
if len(vote.Extension) > 0 && len(vote.ExtensionSignature) == 0 {
return errors.New("vote extension signature is missing")
} }
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,
}
return nil
} }
// ToProto converts the handwritten type to proto generated type // ToProto converts the handwritten type to proto generated type
@ -314,15 +221,16 @@ func (vote *Vote) ToProto() *tmproto.Vote {
} }
return &tmproto.Vote{ return &tmproto.Vote{
Type: vote.Type,
Height: vote.Height,
Round: vote.Round,
BlockID: vote.BlockID.ToProto(),
Timestamp: vote.Timestamp,
ValidatorAddress: vote.ValidatorAddress,
ValidatorIndex: vote.ValidatorIndex,
Signature: vote.Signature,
VoteExtension: vote.VoteExtension.ToProto(),
Type: vote.Type,
Height: vote.Height,
Round: vote.Round,
BlockID: vote.BlockID.ToProto(),
Timestamp: vote.Timestamp,
ValidatorAddress: vote.ValidatorAddress,
ValidatorIndex: vote.ValidatorIndex,
Signature: vote.Signature,
Extension: vote.Extension,
ExtensionSignature: vote.ExtensionSignature,
} }
} }
@ -342,15 +250,6 @@ func VotesToProto(votes []*Vote) []*tmproto.Vote {
return res return res
} }
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
// return type, nil if everything converts safely, otherwise nil, error // return type, nil if everything converts safely, otherwise nil, error
func VoteFromProto(pv *tmproto.Vote) (*Vote, error) { func VoteFromProto(pv *tmproto.Vote) (*Vote, error) {
@ -372,7 +271,8 @@ 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)
vote.Extension = pv.Extension
vote.ExtensionSignature = pv.ExtensionSignature
return vote, vote.ValidateBasic() return vote, vote.ValidateBasic()
} }

+ 6
- 12
types/vote_test.go View File

@ -130,12 +130,13 @@ func TestVoteSignBytesTestVectors(t *testing.T) {
}, },
// containing vote extension // containing vote extension
5: { 5: {
"test_chain_id", &Vote{Height: 1, Round: 1, VoteExtension: VoteExtension{
AppDataToSign: []byte("signed"),
AppDataSelfAuthenticating: []byte("auth"),
}},
"test_chain_id", &Vote{
Height: 1,
Round: 1,
Extension: []byte("signed"),
},
[]byte{ []byte{
0x38, // length
0x2e, // length
0x11, // (field_number << 3) | wire_type 0x11, // (field_number << 3) | wire_type
0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, // height 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, // height
0x19, // (field_number << 3) | wire_type 0x19, // (field_number << 3) | wire_type
@ -146,13 +147,6 @@ func TestVoteSignBytesTestVectors(t *testing.T) {
// (field_number << 3) | wire_type // (field_number << 3) | wire_type
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
// (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 }, // chainID
}, },
} }


Loading…
Cancel
Save