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

Simplify is_better_update condition #3816

Merged
merged 1 commit into from
Aug 30, 2024
Merged

Simplify is_better_update condition #3816

merged 1 commit into from
Aug 30, 2024

Conversation

dapplion
Copy link
Collaborator

If new_has_supermajority != old_has_supermajority

new old new > old
1 0 1
0 1 0

So the statement is equivalent to just new_has_supermajority

@hwwhww
Copy link
Contributor

hwwhww commented Jun 25, 2024

While it is more brief, I'm not sure if it is more readable as well.

@hwwhww hwwhww added the general:presentation Presentation (as opposed to content) label Jun 25, 2024
@dapplion
Copy link
Collaborator Author

It's already used in the same function in

if new_has_relevant_sync_committee != old_has_relevant_sync_committee:
return new_has_relevant_sync_committee

and

if new_has_finality != old_has_finality:
return new_has_finality

@hwwhww hwwhww merged commit 2b4d94a into dev Aug 30, 2024
26 checks passed
@hwwhww hwwhww deleted the dapplion-patch-2 branch August 30, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
general:presentation Presentation (as opposed to content) scope:light-clients
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants