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

feat: update the calculation logic of BLS signature threshold #236

Closed
wants to merge 1 commit into from

Conversation

yutianwu
Copy link
Collaborator

@yutianwu yutianwu commented Jul 6, 2023

Description

This pr will update the calculation logic of BLS signature threshold.

Before we just use len(validators)*2/3 to get the BLS signature threshold. This pr will change the calculation logic of the threshold:

func CeilDiv(x, y int) int {
	if y == 0 {
		return 0
	}
	return (x + y - 1) / y
}

For example, there are total 3 validators.

Before, the threshold of valid signed validator count is 3. If we change the calculation logic, the threshold is 2.

Rationale

To change the calculation logic of BLS signature threshold to be consistent with BSC.

Example

n/a

Changes

Notable changes:

  • update the calculation logic of BLS signature threshold

@unclezoro unclezoro closed this Jul 6, 2023
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.

2 participants