-
Notifications
You must be signed in to change notification settings - Fork 368
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
ProcessProposal
: avoid calls when we know one correct process has already accepted it
#1230
Comments
We can go even further than proposed. The minimal condition would be receiving Since all proposed cases satisfy the minimal condition presented here, they are safe. |
In terms of the pseudo-code, the final version of lines 23 and 29 would be: Is it correct? |
Seems correct. But to make it explicit the short-circuiting that should take place, maybe we should 23 as
This will avoid the check when
|
Thanks, I realise my initial pseudocode didn't account for Or maybe it's equivalent (in term of logic algebra) to what you're proposing? |
As discussed, the following rule for line 23 is probably the simpler, that does not change the algorithm validVMatch = (validRoundp != -1 && validValuep=v) |
Thanks for your comment, @nenadmilosevic95 There could be gains in line 23, but that would require more involved changes and would also help only in the uncommon case of needing multiple rounds to decide. Hence we need to further discuss this change as well, possibly in the context of porting PBTS. It is non-blocking for this PR. Also, I would like to note that even if ProcessProposal is non-deterministic, your proposal would be valid. The reason is validators don't really reject invalid proposals, but simply abstain from voting on them. So as long as the number of acceptance votes grows across rounds, at some point the value will be considered valid without querying the app, but this should also be further discussed in the context of porting PBTS and closing #1174 |
In the current implementation of
ProcessProposal
(and spec?), it is called just after doing Comet-level validations on the received proposal block.However, there are some cases where the local node can conclude that the received proposal has already been processed and accepted by another correct node's
ProcessProposal
.Since
ProcessProposal
's main goal is to detect and drop bad proposals from byzantine validators, callingProcessProposal
on a proposal that we know has passedProcessProposal
elsewhere is, at minimum, suboptimal.These are the cases where we know
ProcessProposal
has already accepted the proposal at some correct node:POLRound
is -1 and the proposed block matches the one locally locked (part of line 23 of the arXiv algorithm)POLRound
is not -1 and less than the current round, andPOLRound
, andPOLRound
is greater than or `LockedRound?ValidBlock
In the arXiv algorithm, this is equivalent to removing$valid(v)$ from line 29, and changing line 23 as follows:
$(lockedRound_p = −1 ∧ valid(v)) ∨ lockedValue_p = v$ $valid(v)$ does not include $valid(v)$ at all there?).
if
then
.Also, we assume that
ProcessProposal
in lines 36 and 50 (do we really need to callThis is a similar reasoning to the one followed to minimize calls to
timely
in the Proposer-Based Timestamp (PBTS) specification.@hvanz @lasarojc @BrendanChou
The text was updated successfully, but these errors were encountered: