Skip to content

fix(driver): decide in a future round if this is possible#1

Closed
cason wants to merge 6 commits intomainfrom
commit-future-round
Closed

fix(driver): decide in a future round if this is possible#1
cason wants to merge 6 commits intomainfrom
commit-future-round

Conversation

@cason
Copy link
Copy Markdown
Owner

@cason cason commented Feb 13, 2026

When a process receives a Precommit from round r and can produce both SkipRound(r) and PrecommitValue(v), it opts for the first - therefore postponing the decision. This is problematic for two reasons:

  1. The application is supposed to report again ProposedValue(v, validity) when starting round r
  2. If instead of a Precommit, a Commit certificate for (r, v) is received, the decision is immediate

This PR is an attempt to solve this undesired behaviour without making changes in the vote keeper logic.

&mut self,
new_threshold: VKOutput<ValueId<Ctx>>,
threshold_round: Round,
vote_value: Option<ValueId<Ctx>>,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why not take NilOrVal here?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I think that is because of Threshold::Value(id), which receives a ValueId

Comment on lines +305 to +321
// Check for a concurrent PrecommitValue(v) output
if let Some(v) = vote_value {
if self.vote_keeper.is_threshold_met(
&r,
VoteType::Precommit,
Threshold::Value(v.clone()),
) {
if let Some(proposal) =
self.valid_proposal_for_round_and_value(threshold_round, v)
{
return (
threshold_round,
RoundInput::ProposalAndPrecommitValue(proposal.message.clone()),
);
}
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I know the point was to not modify the vote keeper, but I am wondering if it would not be simpler to make this change there instead?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not sure if you mean the same thing but I would rather go with the approach where instead of having the mux re-check is_threshold_met after getting a SkipRound, I'd prefer we change apply_vote to return all thresholds crossed by a vote. That way both SkipRound and PrecommitValue would come back from the votekeeper directly, and the driver can just pick the highest-priority one without special-casing it here.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I am creating another version with this change in the vote keeper. I am just wondering if this wouldn't break other stuff...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I'd prefer we change apply_vote to return all thresholds crossed by a vote

I like this a idea too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants