Skip to content
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

Skip check when the 100% check is achieved. #4625

Merged
merged 4 commits into from
Feb 2, 2024
Merged

Conversation

diego1q2w
Copy link
Contributor

@diego1q2w diego1q2w commented Feb 1, 2024

We are currently experiencing an issue in our devnet, leading to frequent view changes and extending block finality time from 1 second to 10 seconds. This problem became apparent after transitioning the network to operate exclusively on external nodes. These nodes are located in the same datacenter and region, eliminating geographical constraints. As a result, we achieve nearly 100% voting rate for almost every block.

This issue has not occurred in our testnet or mainnet, where nodes are globally distributed, making it rare to reach a 100% voting rate.

Through research conducted by Soph, we identified a specific logic block in the code that bypasses the precommit and propose phases. After reviewing the code, i believe this block is unnecessary. Our primary concern is achieving a 2/3 vote rate. The conditions consensus.decider.IsAllSigsCollected() and consensus.decider.IsQuorumAchieved(quorum.Commit) in the codebase use the same structure to determine if the Commit phase has received sufficient votes. You can see this in the code at line 296, IsQuorumAchieved, and IsAllSigsCollected. Meaning that even if we reach a 100% we will run the same logic as for when we have 2/3 or more the lines of code being run at the commented code are also run at the main block rendering this block of code redundant.

EDIT: I've also added the consensus.decider.IsAllSigsCollected() in case we go from 0 to a 100% signatures in one go, so we run the same logic.

consensus/leader.go Outdated Show resolved Hide resolved
@diego1q2w diego1q2w merged commit ca91cb2 into dev Feb 2, 2024
4 checks passed
@diego1q2w diego1q2w deleted the skip-is-all-collected branch February 2, 2024 09:03
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.

4 participants