abci: PrepareProposal-VoteExtension integration [2nd try] (#7821)

* PrepareProposal-VoteExtension integration (#6915)

* make proto-gen

* Fix protobuf crash in e2e nightly tests

* Update types/vote.go

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Addressed @creachadair's comments

Co-authored-by: mconcat <monoidconcat@gmail.com>
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
This commit is contained in:
Sergio Mena
2022-02-15 18:16:11 +01:00
committed by GitHub
co-authored by M. J. Fromberger mconcat
parent 44d9e9917c
commit 60f09840dd
8 changed files with 287 additions and 190 deletions
+6 -2
View File
@@ -106,6 +106,7 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
height int64,
state State, commit *types.Commit,
proposerAddr []byte,
votes []*types.Vote,
) (*types.Block, *types.PartSet, error) {
maxBytes := state.ConsensusParams.Block.MaxBytes
@@ -120,7 +121,11 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
preparedProposal, err := blockExec.proxyApp.PrepareProposal(
ctx,
abci.RequestPrepareProposal{BlockData: txs.ToSliceOfBytes(), BlockDataSize: maxDataBytes},
abci.RequestPrepareProposal{
BlockData: txs.ToSliceOfBytes(),
BlockDataSize: maxDataBytes,
Votes: types.VotesToProto(votes),
},
)
if err != nil {
// The App MUST ensure that only valid (and hence 'processable') transactions
@@ -287,7 +292,6 @@ func (blockExec *BlockExecutor) ExtendVote(ctx context.Context, vote *types.Vote
if err != nil {
return types.VoteExtension{}, err
}
return types.VoteExtensionFromProto(resp.VoteExtension), nil
}