Repository navigation
Vote extension propagation (RFC017) - #9853
Merged
sergio-mena merged 12 commits intoDec 8, 2022
Merged
Conversation
* Add protos for ExtendedCommit Cherry-pick from e73f017 just the changes to the .proto files, since we have deleted the .intermediate files. Signed-off-by: Thane Thomson <[email protected]> * make proto-gen Signed-off-by: Thane Thomson <[email protected]> * BlockStore holds extended commit Cherry-pick 8d504d4 and fix conflicts. Signed-off-by: Thane Thomson <[email protected]> * Reshuffle ExtendedCommit and ExtendedCommitSig Separate the data structures and functions from their Commit-oriented counterparts to adhere to the current coding style. Signed-off-by: Thane Thomson <[email protected]> * Fix exit condition in blocksync * Add note to remove TxResult proto As Sergio pointed out in 3e31aa6, this proto message can probably be removed. We should do this in a separate PR. Signed-off-by: Thane Thomson <[email protected]> * Lift termination condition into for loop Signed-off-by: Thane Thomson <[email protected]> * Enforce vote extension signature requirement Signed-off-by: Thane Thomson <[email protected]> * Expand on comment for PeekTwoBlocks for posterity Signed-off-by: Thane Thomson <[email protected]> * Isolate TODO more clearly Signed-off-by: Thane Thomson <[email protected]> * make mockery Signed-off-by: Thane Thomson <[email protected]> * Fix comment Signed-off-by: Thane Thomson <[email protected]> * Make panic output from BlockStore.SaveBlock more readable Signed-off-by: Thane Thomson <[email protected]> * Add helper methods to ExtendedCommitSig and ExtendedCommit Signed-off-by: Thane Thomson <[email protected]> * Fix most tests except TestHandshake* Signed-off-by: Thane Thomson <[email protected]> * Fix store prefix collision Signed-off-by: Thane Thomson <[email protected]> * Fix TestBlockFetchAtHeight Signed-off-by: Thane Thomson <[email protected]> * Remove global state from store tests Signed-off-by: Thane Thomson <[email protected]> * Apply suggestions from code review Co-authored-by: M. J. Fromberger <[email protected]> Co-authored-by: Sergio Mena <[email protected]> * blocksync: Just return error Signed-off-by: Thane Thomson <[email protected]> * make format Signed-off-by: Thane Thomson <[email protected]> * types: Remove unused/commented-out code Signed-off-by: Thane Thomson <[email protected]> * blocksync: Change pool AddBlock function signature to return errors Signed-off-by: Thane Thomson <[email protected]> * types: Improve legibility of switch statements Signed-off-by: Thane Thomson <[email protected]> * blocksync: Expand on extended commit requirement in AddBlock description Signed-off-by: Thane Thomson <[email protected]> * blocksync: Return error without also logging it Signed-off-by: Thane Thomson <[email protected]> * consensus: Rename short-lived local variable Signed-off-by: Thane Thomson <[email protected]> * consensus: Allocate TODO to Sergio Signed-off-by: Thane Thomson <[email protected]> * evidence/pool_test: Inline slice construction Signed-off-by: Thane Thomson <[email protected]> * state: Rename LoadBlockExtCommit to LoadBlockExtendedCommit Signed-off-by: Thane Thomson <[email protected]> * proto: Remove TODO on TxResult Signed-off-by: Thane Thomson <[email protected]> * types: Minor format Signed-off-by: Thane Thomson <[email protected]> * types: Reformat ExtendedCommitSig.BlockID Signed-off-by: Thane Thomson <[email protected]> * types: Remove NewExtendedCommit constructor Signed-off-by: Thane Thomson <[email protected]> * types: Remove NewCommit constructor Signed-off-by: Thane Thomson <[email protected]> * types: Shorten receiver names for ExtendedCommit Signed-off-by: Thane Thomson <[email protected]> * types: Convert ExtendedCommit.Copy to a deep clone Signed-off-by: Thane Thomson <[email protected]> * types: Assign TODO to Sergio Signed-off-by: Thane Thomson <[email protected]> * types: Fix legibility nits Signed-off-by: Thane Thomson <[email protected]> * types: Improve legibility Signed-off-by: Thane Thomson <[email protected]> * store/state: Add TODO to move prefixes to common package Signed-off-by: Thane Thomson <[email protected]> * Propagate validator info to PrepareProposal In order to propagate validator voting power through to PrepareProposal, we need to load the validator set info from the height corresponding to the extended commit that we're passing through to PrepareProposal as the "LocalLastCommit". Signed-off-by: Thane Thomson <[email protected]> * Rename local var for clarity Signed-off-by: Thane Thomson <[email protected]> * Fix TestMaxProposalBlockSize Signed-off-by: Thane Thomson <[email protected]> * Rename local var for clarity Signed-off-by: Thane Thomson <[email protected]> * Remove debug log Signed-off-by: Thane Thomson <[email protected]> * Remove CommigSig.ForBlock helper Signed-off-by: Thane Thomson <[email protected]> * Remove CommigSig.Absent helper Signed-off-by: Thane Thomson <[email protected]> * Remove ExtendedCommitSig.ForBlock helper Signed-off-by: Thane Thomson <[email protected]> * Remove ExtendedCommitSig.Absent helper Signed-off-by: Thane Thomson <[email protected]> * There are no extended commits below the initial height Signed-off-by: Thane Thomson <[email protected]> * Fix comment grammar Signed-off-by: Thane Thomson <[email protected]> * Remove JSON encoding from ExtendedCommit Signed-off-by: Thane Thomson <[email protected]> * Embed CommitSig into ExtendedCommitSig instead of duplicating fields Signed-off-by: Thane Thomson <[email protected]> * Rename ExtendedCommit vote_extension field to extension for consistency with domain types Signed-off-by: Thane Thomson <[email protected]> * blocksync: Panic if we peek a block without an extended commit Signed-off-by: Thane Thomson <[email protected]> * Apply suggestions from code review Co-authored-by: M. J. Fromberger <[email protected]> * Remove Sergio from TODO Signed-off-by: Thane Thomson <[email protected]> * Increase hard-coded vote extension max size to 1MB Signed-off-by: Thane Thomson <[email protected]> * state: Remove unnecessary comment Signed-off-by: Thane Thomson <[email protected]> * state: Ensure no of commit sigs equals validator set length Signed-off-by: Thane Thomson <[email protected]> * make format Signed-off-by: Thane Thomson <[email protected]> * types: Minor legibility improvements Signed-off-by: Thane Thomson <[email protected]> * Improve legibility Signed-off-by: Thane Thomson <[email protected]> * types: Remove unused GetVotes function on VoteSet Signed-off-by: Thane Thomson <[email protected]> * Refactor TestMaxProposalBlockSize to construct more realistic extended commit Signed-off-by: Thane Thomson <[email protected]> * Refactor buildExtendedCommitInfo to resemble buildLastCommitInfo Signed-off-by: Thane Thomson <[email protected]> * Apply suggestions from code review Co-authored-by: M. J. Fromberger <[email protected]> * abci++: Disable VerifyVoteExtension call on nil precommits (#8491) Signed-off-by: Thane Thomson <[email protected]> * types: Require vote extensions on non-nil precommits and not otherwise Signed-off-by: Thane Thomson <[email protected]> * Disable lint Signed-off-by: Thane Thomson <[email protected]> * Increase timeout for TestReactorVotingPowerChange to counter flakiness Signed-off-by: Thane Thomson <[email protected]> * Only sign and verify vote extensions in non-nil precommits Signed-off-by: Thane Thomson <[email protected]> * Revert "Disable lint" This reverts commit 6fffbf9. Signed-off-by: Thane Thomson <[email protected]> * Add missing non-nil check uncovered non-deterministically in TestHandshakeReplayAll Signed-off-by: Thane Thomson <[email protected]> * Expand error message for accuracy Signed-off-by: Thane Thomson <[email protected]> * Only call ExtendVote when we make non-nil precommits Signed-off-by: Thane Thomson <[email protected]> * Revert "Increase timeout for TestReactorVotingPowerChange to counter flakiness" This reverts commit af51493. Signed-off-by: Thane Thomson <[email protected]> * Refactor ValidateBasic for ExtendedCommitSig for legibility Signed-off-by: Thane Thomson <[email protected]> Co-authored-by: Sergio Mena <[email protected]> Co-authored-by: M. J. Fromberger <[email protected]>
williambanfield
approved these changes
Dec 8, 2022
williambanfield
left a comment
Contributor
There was a problem hiding this comment.
Did a pass looking at the diff-of-diffs. Looks like a clean cherry-pick.
| // See if there are any blocks to sync. | ||
| first, second := bcR.pool.PeekTwoBlocks() | ||
| first, second, extCommit := bcR.pool.PeekTwoBlocks() | ||
| // bcR.Logger.Info("TrySync peeked", "first", first, "second", second) |
Contributor
There was a problem hiding this comment.
Can we remove this commented out code while we're here?
Contributor
Author
There was a problem hiding this comment.
This is done in the upcoming cherry-pick. Bear with me
| m.On("VerifyVoteExtension", mock.Anything, mock.Anything).Return(&abci.ResponseVerifyVoteExtension{ | ||
| Status: abci.ResponseVerifyVoteExtension_ACCEPT, | ||
| }, nil) | ||
| if !testCase.voteNil { |
Contributor
There was a problem hiding this comment.
Looks like there's a comment missing from the hunk here.
Contributor
Author
There was a problem hiding this comment.
Thanks for catching this! Adding it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9852
The first commit is a cherry-pick of #8433.
Subsequent commits are fixing the build, and the unit tests
N.B: The changelog will be updated once branch
feature/abci++vefis merged back intomainPR checklist
CHANGELOG_PENDING.mdupdated, or no changelog entry neededdocs/) and code comments, or nodocumentation updates needed