-
Notifications
You must be signed in to change notification settings - Fork 290
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
Improve Consensus logic for Multi-BLS Validators with quorum #4799
base: dev
Are you sure you want to change the base?
Conversation
@GheisMohammadi i am good with that PR. Can you do run the same logic with Line 124 in 3b6fde4
return when the leader node already has quorum on the first onPrepare. Goal is to run didReachPrepareQuorum Line 188 in 3b6fde4
|
3b6fde4
to
c6518ec
Compare
done |
quorumFromInitialSignature := hasMultiBlsKeys && isFirstReceivedSignature && quorumPreExisting | ||
quorumPostNewSignatures := consensus.decider.IsQuorumAchieved(quorum.Prepare) | ||
quorumFromNewSignatures := !quorumPreExisting && quorumPostNewSignatures | ||
|
||
if quorumFromInitialSignature || quorumFromNewSignatures { |
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.
old code was fine, as we just need consensus.didReachPrepareQuorum()
to hit once
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.
I removed return
. So, it allows adding new signatures in Prepare Phase despite existing quorum. I think this would fix the issue
could you add PR description, and is this something we can write unit test (for onPrepare and onCommit) here as well ? |
@Frozen please review/approve |
@GheisMohammadi please update PR description |
done |
updated this PR to "ready for review" |
should i run it with make debug-multi-bls or debug-ext or debug? |
@Frozen you should run it with debug-multi-bls as it fixes a bug that only happens when using multi-bls and when the harmony node have quorum |
rebase pls branch on dev |
Issue
This PR improves the consensus logic to handle cases where validators with multiple BLS keys achieve quorum on their initial signatures or commits. Currently, such scenarios can block phase transitions because the condition
if !quorumWasMet && quorumIsMet
doesn't account for quorum being achieved immediately.To fix this, a new function,
checkFirstReceivedSignature
, is introduced. It checks whether quorum is reached on the first batch of signatures or commits. The PR also updates the logic forPrepare
andCommit
phases to properly handle these edge cases. The PR helps to better handling of multi-BLS key validators while maintaining compatibility with single-key setups.