Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

abci++: Vote extension cleanup #9848

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

sergio-mena
Copy link
Contributor

@sergio-mena sergio-mena commented Dec 6, 2022

Closes #9846

This is a PR cherry-picking one single PR: #8402

The contents of this patch were necessary in preparation for implementing the solution for vote extension propagation (which will be in an upcoming PR)

N.B: The changelog will be updated once branch feature/abci++vef is merged back into main


PR checklist

  • Tests written/updated, or no tests needed
  • CHANGELOG_PENDING.md updated, or no changelog entry needed
  • Updated relevant documentation (docs/) and code comments, or no
    documentation updates needed

* Split vote verification/validation based on vote extensions

Some parts of the code need vote extensions to be verified and
validated (mostly in consensus), and other parts of the code don't
because its possible that, in some cases (as per RFC 017), we won't have
vote extensions.

This explicitly facilitates that split.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Only sign extensions in precommits, not prevotes

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Update privval/file.go

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

* Apply suggestions from code review

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

* Temporarily disable extension requirement again for E2E testing

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Reorganize comment for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Leave vote validation and pre-call nil check up to caller of VoteToProto

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Split complex vote validation test into multiple tests

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Universally enforce no vote extensions on any vote type but precommits

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Make error messages more generic

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Verify with vote extensions when constructing a VoteSet

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Expand comment for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add extension check for prevotes prior to signing votes

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix supporting test code to only inject extensions into precommits

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Separate vote malleation from signing in vote tests for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add extension signature length check and corresponding test

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Perform basic vote validation in CommitToVoteSet

Signed-off-by: Thane Thomson <connect@thanethomson.com>

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
@sergio-mena sergio-mena requested a review from a team December 6, 2022 20:42
@sergio-mena sergio-mena self-assigned this Dec 6, 2022
Copy link
Contributor

@thanethomson thanethomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a perfect cherry-pick to me 🙂

Weird that the one test group keeps failing though - seems like it's different tests that fail each time though?

@sergio-mena
Copy link
Contributor Author

Seems like a perfect cherry-pick to me 🙂

Weird that the one test group keeps failing though - seems like it's different tests that fail each time though?

There's TestMempoolProgressAfterCreateEmptyBlocksInterval that's driving me crazy, but I think I found a way to reduce the flakines.

I'll push the fix after the dinner (I don't want to push it until I test it well)

// TODO(thane): Remove extension length check once
// https://github.com/tendermint/tendermint/issues/8272 is
// resolved.
if len(vote.Extension) > 0 && len(vote.ExtensionSignature) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The details may be a bit foggy to me, but our decision was to ensure that, once vote extensions are enabled, the vote extension must always have a signature regardless of the extension length.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at #9396, if I understand correctly, that will come in a follow-up PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, then no issue!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thanethomson is right, this is changing in upcoming PRs

@williambanfield
Copy link
Contributor

Looks correct, left a comment making sure my understanding is correct.

@sergio-mena sergio-mena added the S:automerge Automatically merge PR when requirements pass label Dec 7, 2022
@sergio-mena sergio-mena merged commit 78c6437 into feature/abci++vef Dec 7, 2022
@sergio-mena sergio-mena deleted the sergio/9846-vote-extensions-cleanup branch December 7, 2022 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S:automerge Automatically merge PR when requirements pass
Projects
Status: Done/Merged
Development

Successfully merging this pull request may close these issues.

None yet

3 participants