mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-17 00:47:03 +00:00
Fix an overflow in the justification bits processing
This commit is contained in:
parent
5a1a878bbd
commit
c39d4f1817
@ -200,7 +200,11 @@ proc process_justification_and_finalization*(
|
||||
## Spec:
|
||||
## state.justification_bits[1:] = state.justification_bits[:-1]
|
||||
## state.justification_bits[0] = 0b0
|
||||
state.justification_bits = state.justification_bits shl 1
|
||||
# TODO JUSTIFICATION_BITS_LENGTH is a constant in spec, move there or fix
|
||||
# BitVector serialization in SSZ layer
|
||||
const JUSTIFICATION_BITS_LENGTH = 4
|
||||
state.justification_bits = (state.justification_bits shl 1) and
|
||||
cast[uint8]((2^JUSTIFICATION_BITS_LENGTH) - 1)
|
||||
|
||||
# This is a somewhat expensive approach
|
||||
let active_validator_indices =
|
||||
|
Loading…
x
Reference in New Issue
Block a user