From 26c301c03a56a006f145c1cdbffcdcb090aea896 Mon Sep 17 00:00:00 2001 From: Sergio Mena Date: Tue, 15 Feb 2022 18:16:11 +0100 Subject: [PATCH] [cheryy-picked] 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 * Addressed @creachadair's comments Co-authored-by: mconcat Co-authored-by: M. J. Fromberger --- consensus/byzantine_test.go | 4 +++- state/execution.go | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/consensus/byzantine_test.go b/consensus/byzantine_test.go index a1cb43949..ccfa98370 100644 --- a/consensus/byzantine_test.go +++ b/consensus/byzantine_test.go @@ -198,6 +198,7 @@ func TestByzantinePrevoteEquivocation(t *testing.T) { } var commit *types.Commit + var votes []*types.Vote switch { case lazyProposer.Height == lazyProposer.state.InitialHeight: // We're creating a proposal for the first block. @@ -206,6 +207,7 @@ func TestByzantinePrevoteEquivocation(t *testing.T) { case lazyProposer.LastCommit.HasTwoThirdsMajority(): // Make the commit from LastCommit commit = lazyProposer.LastCommit.MakeCommit() + votes = lazyProposer.LastCommit.GetVotes() default: // This shouldn't happen. lazyProposer.Logger.Error("enterPropose: Cannot propose anything: No commit for the previous block") return @@ -223,7 +225,7 @@ func TestByzantinePrevoteEquivocation(t *testing.T) { proposerAddr := lazyProposer.privValidatorPubKey.Address() block, err := lazyProposer.blockExec.CreateProposalBlock( - lazyProposer.Height, lazyProposer.state, commit, proposerAddr, nil) + lazyProposer.Height, lazyProposer.state, commit, proposerAddr, votes) require.NoError(t, err) blockParts, err := block.MakePartSet(types.BlockPartSizeBytes) require.NoError(t, err) diff --git a/state/execution.go b/state/execution.go index 1ea4f26f9..167a3aa16 100644 --- a/state/execution.go +++ b/state/execution.go @@ -302,7 +302,6 @@ func (blockExec *BlockExecutor) ExtendVote(vote *types.Vote) (types.VoteExtensio if err != nil { return types.VoteExtension{}, err } - return types.VoteExtensionFromProto(resp.VoteExtension), nil }