mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-12 19:54:34 +00:00
Update 0_beacon-chain.md
This commit is contained in:
parent
e36593b155
commit
05842f8371
@ -1294,14 +1294,15 @@ def process_justification_and_finalization(state: BeaconState) -> None:
|
|||||||
|
|
||||||
# Process justifications
|
# Process justifications
|
||||||
state.previous_justified_checkpoint = state.current_justified_checkpoint
|
state.previous_justified_checkpoint = state.current_justified_checkpoint
|
||||||
state.justification_bits = [0b0] + state.justification_bits[:JUSTIFICATION_BITS_LENGTH - 1] # Bitshift
|
state.justification_bits[1:] == state.justification_bits[:JUSTIFICATION_BITS_LENGTH - 1]
|
||||||
|
state.justification_bits[0] = 0b0
|
||||||
matching_target_attestations = get_matching_target_attestations(state, previous_epoch) # Previous epoch
|
matching_target_attestations = get_matching_target_attestations(state, previous_epoch) # Previous epoch
|
||||||
if get_attesting_balance(state, matching_target_attestations) * 3 >= get_total_active_balance(state) * 2:
|
if get_attesting_balance(state, matching_target_attestations) * 3 >= get_total_active_balance(state) * 2:
|
||||||
state.current_justified_checkpoint = Checkpoint(previous_epoch, get_block_root(state, previous_epoch))
|
state.current_justified_checkpoint = Checkpoint(epoch=previous_epoch, root=get_block_root(state, previous_epoch))
|
||||||
state.justification_bits[1] = 0b1
|
state.justification_bits[1] = 0b1
|
||||||
matching_target_attestations = get_matching_target_attestations(state, current_epoch) # Current epoch
|
matching_target_attestations = get_matching_target_attestations(state, current_epoch) # Current epoch
|
||||||
if get_attesting_balance(state, matching_target_attestations) * 3 >= get_total_active_balance(state) * 2:
|
if get_attesting_balance(state, matching_target_attestations) * 3 >= get_total_active_balance(state) * 2:
|
||||||
state.current_justified_checkpoint = Checkpoint(current_epoch, get_block_root(state, current_epoch))
|
state.current_justified_checkpoint = Checkpoint(epoch=current_epoch, root=get_block_root(state, current_epoch))
|
||||||
state.justification_bits[0] = 0b1
|
state.justification_bits[0] = 0b1
|
||||||
|
|
||||||
# Process finalizations
|
# Process finalizations
|
||||||
|
Loading…
x
Reference in New Issue
Block a user