-
Notifications
You must be signed in to change notification settings - Fork 468
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
PBTS: Proposal's reception time should be persisted to the WAL #2322
Comments
The behaviour of the |
We could add the timestamp as optional to protobuf and only fill it for |
Another thought: as we are not activating PBTS upon upgrade, but via the "enable height" in the future, we don't need to consider backwards compatibility of the We need to consider, tho, that non-PBTS heights may be missing the optional field also in the proposal (which I don't think it is a problem, as BFT Time does not need it). |
PR #2388 improves test
The test passes on #2388 |
If we can indeed make this field option, we are good here. For BFT Time this field is irrelevant, for PBTS, if it was not saved is because we were not using PBTS or we are an incorrect node. |
Closes #2322 --- #### PR checklist - [x] Tests written/updated - [x] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec --------- Co-authored-by: Andy Nogueira <[email protected]> Co-authored-by: Sergio Mena <[email protected]>
Is this solved? |
Closed by #2388 |
Originally: tendermint/tendermint#8954
For implementing PBTS mechanism, in particular for registering the reception time of
Proposal
message, the consensus reactor registers theReceiveTime
of every message in the msgInfo instance delivered to the consensus protocol.Messages received and accepted by the consensus protocol are written to the WAL, allowing nodes to recover from crashes. However, the msgInfo proto, that is written to the WAL, does not include the
ReceiveTime
field.As a result, when replaying messages from the WAL their
ReceiveTime
is nil (zero time), which leads nodes to reject a replayedProposal
message upon recovery, even though the sameProposal
message was accepted during regular execution. This leads recovering validator nodes to equivocate.@sergio-mena has observed this behavior in e2e tests and reported it in detail in tendermint/tendermint#8739. He also proposed a workaround to avoid tests from failing (tendermint/tendermint#8774), by disabling the PBTS
timely
verification of theProposal
's timestamp when in replay mode. The problem of this approach is that it can also lead to equivocating behavior: if theProposal
's timestamp is rejected by PBTS during regular execution, then upon recovery the sameProposal
can be accepted, as thetimely
verification is disabled.The straightforward solution for this issue is to write the
ReceiveTime
field ofmsgInfo
struct to the WAL during regular operation, and to read the same field from the WAL when replaying messages, so that the protocol processesProposal
messages using the same temporal information employed before, during regular operation.The downside of this solution is to increase the size and the amount of the information written to the WAL, with a potential performance impact. The byte-size of a timestamp is typically 13 bytes, but the main point here is that the
ReceiveTime
is not relevant for most of the received and broadcast messages. In fact, this field is only employed forProposal
messages. For all the other messages, having it set to zero (nil) during recovery does not constitute a problem.DoD
msgInfo
written into the WAL #2388e2e
testmsgInfo
written into the WAL #2388 (comment)The text was updated successfully, but these errors were encountered: