mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-17 13:06:34 +00:00
limit bit-length of justification bitfield to strict 64, prevent SSZ encoding crash due to too large integer size
This commit is contained in:
parent
2baa242ac0
commit
509354582c
@ -1819,6 +1819,8 @@ def update_justification_and_finalization(state: BeaconState) -> None:
|
||||
|
||||
# Rotate the justification bitfield up one epoch to make room for the current epoch
|
||||
state.justification_bitfield <<= 1
|
||||
# Python var length integers: justification bitfield is 64 bits, and may not be bigger (for SSZ serialization)
|
||||
state.justification_bitfield &= (1 << 64) - 1
|
||||
# If the previous epoch gets justified, fill the second last bit
|
||||
previous_boundary_attesting_balance = get_attesting_balance(state, get_previous_epoch_boundary_attestations(state))
|
||||
if previous_boundary_attesting_balance * 3 >= get_previous_total_balance(state) * 2:
|
||||
|
Loading…
x
Reference in New Issue
Block a user