-
Notifications
You must be signed in to change notification settings - Fork 645
Fix deficiency in ABCI interface: SignedLastBlock
#540
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
Fix deficiency in ABCI interface: SignedLastBlock
#540
Conversation
if len(vote.VoteExtension) != 0 { | ||
return 0, fmt.Errorf("non-empty vote extension at height %d, which has extensions disabled", currentHeight) | ||
return 0, fmt.Errorf("non-empty vote extension at height %d, for a vote with blockID flag %d", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essentially, if this validator had voted correctly, and there is an extension, the flag had to have been Commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly:
- BlockIDFlagAbsent means it didn't precommit so, how come we got a vote extension?
- BlockIDFlagNil means it precommitted for
nil
, butnil
precommits don't have vote extensions
In both cases the info we get is contradictory, so we should reject it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, did you mean that we could simplify the condition in line 583 like this?
if vote.BlockIdFlag != cmtproto.BlockIDFlagCommit {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments, otherwise good.
Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com>
Contributes to #485
Current ABCI 2.0 implementation has
VoteInfo
andExtendedVoteInfo
to send vote signature information to the application at several points in the interaction:PrepareProposal
ProcessProposal
FinalizeBlock
The problem with
VoteInfo
andExtendedVoteInfo
is that they contain abool
, calledSignedLastBlock
, which collapses several cases: (a) did the sending validator precommit fornil
? (b) did it precommit for the decided block? (c) did they not precommit (or no precommit received, absent)?SignedLastBlock
is collapsing cases (a) and (b) into valuetrue
of the boolean, hiding potentially useful information to the application.With vote extensions, this has become a bigger problem, as we are unable to "ensure" from a testing application that the vote extensions are present or absent at the right time. If we (CometBFT team) are unable to test this properly, then real apps may have a very hard time troubleshooting potential problems on the field, due to some info being trapped south of ABCI.
After a discussion with @ebuchman, we have decided to fix this problem, which was already fixed long ago in the block-related protos (see discussion). The conclusion was that this is the right moment, as we are heavily changing ABCI in this release, and it's not certain when we will need to make substantial changes to it in the mid-term.
This PR contains the changes needed in the protobufs and in the code.
PR checklist
.changelog
(we use unclog to manage our changelog)docs/
orspec/
) and code comments