Merge pull request #3816 from ethereum/dapplion-patch-2

Simplify is_better_update condition
This commit is contained in:
Hsiao-Wei Wang 2024-08-30 23:33:10 +08:00 committed by GitHub
commit 2b4d94ab08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -232,7 +232,7 @@ def is_better_update(new_update: LightClientUpdate, old_update: LightClientUpdat
new_has_supermajority = new_num_active_participants * 3 >= max_active_participants * 2
old_has_supermajority = old_num_active_participants * 3 >= max_active_participants * 2
if new_has_supermajority != old_has_supermajority:
return new_has_supermajority > old_has_supermajority
return new_has_supermajority
if not new_has_supermajority and new_num_active_participants != old_num_active_participants:
return new_num_active_participants > old_num_active_participants