Skip to content

Tighten the checks we do on vote extensions in e2e app#509

Merged
sergio-mena merged 5 commits intofeature/abci++veffrom
sergio/485-tighten-vote-ext-checks-e2e-app
Mar 16, 2023
Merged

Tighten the checks we do on vote extensions in e2e app#509
sergio-mena merged 5 commits intofeature/abci++veffrom
sergio/485-tighten-vote-ext-checks-e2e-app

Conversation

@sergio-mena
Copy link
Collaborator

@sergio-mena sergio-mena commented Mar 13, 2023

Contributes to #485

The current checks on vote extensions in the e2e app take vote extensions as something always optional. This is OK, but we can leverage the app to more thoroughly test several cases:

  • upgrade path: make sure extensions are present iff they are active
  • test the subtleties of the upgrade height: PrepareProposal/ProcessProposal don't have extensions, ExtendVote/VerifyVoteExtension do.
  • Decide what to do with Nil votes in a commit

PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments

@sergio-mena sergio-mena added the abci Application blockchain interface label Mar 13, 2023
@sergio-mena sergio-mena requested a review from a team as a code owner March 13, 2023 11:45
@sergio-mena sergio-mena self-assigned this Mar 13, 2023
Base automatically changed from sergio/485-pass-vote-extension-sign-prepareproposal to feature/abci++vef March 14, 2023 15:13
@sergio-mena sergio-mena force-pushed the sergio/485-tighten-vote-ext-checks-e2e-app branch from 5b038a9 to a1430d0 Compare March 14, 2023 15:39
}
continue
}
if len(vote.VoteExtension) == 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

One last question related to the comment above. Here the length is allowed to be 0 (as it is supposed to be), but then it will fail later? I am just asking to confirm that you don't want to impose your more stringent condition here as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's an excellent question. :-)
The answer is coming in one of my next PRs. The problem is that the current ABCI data structures can only say if the sender of the vote "signed or not" (i.e., a boolean). But if the sending validator has signed for nil, SignedLastBlock will also be true; however as it is a nil precommit it won't have an extension.
It took me a few hours of troubleshooting with e2e tests to find this out.
We discussed this in @ebuchman's office hours on Monday, and we decided we're gonna fix the ABCI interface (a boolean is not enough), since anyway we're introducing breaking changes.
This is what's coming in one of my next PRs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@jmalicevic jmalicevic left a comment

Choose a reason for hiding this comment

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

Other than the comment, LGTM.

@sergio-mena sergio-mena merged commit f74f056 into feature/abci++vef Mar 16, 2023
@sergio-mena sergio-mena deleted the sergio/485-tighten-vote-ext-checks-e2e-app branch March 16, 2023 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

abci Application blockchain interface

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants