From ce5599db2fb4a8f96325af9900c379efb7c0e60f Mon Sep 17 00:00:00 2001 From: vbuterin Date: Sat, 2 Mar 2019 00:42:20 -0600 Subject: [PATCH] Made crosslink processing a function --- specs/core/0_beacon-chain.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index fac0cb640..70ffcf858 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1918,14 +1918,15 @@ def update_justification_and_finalization(state: BeaconState) -> None: Run the following function: ```python -for slot in range(get_epoch_start_slot(previous_epoch), get_epoch_start_slot(next_epoch)): - for crosslink_committee, shard in get_crosslink_committees_at_slot(state, slot): - winning_root, participants = get_winning_root_and_participants(state, shard) - if 3 * total_balance(participants) >= 2 * total_balance(crosslink_committee): - state.latest_crosslinks[shard] = Crosslink( - epoch=slot_to_epoch(slot), - crosslink_data_root=winning_root - ) +def process_crosslinks(state: BeaconState) -> None: + for slot in range(get_epoch_start_slot(previous_epoch), get_epoch_start_slot(next_epoch)): + for crosslink_committee, shard in get_crosslink_committees_at_slot(state, slot): + winning_root, participants = get_winning_root_and_participants(state, shard) + if 3 * total_balance(participants) >= 2 * total_balance(crosslink_committee): + state.latest_crosslinks[shard] = Crosslink( + epoch=slot_to_epoch(slot), + crosslink_data_root=winning_root + ) ``` #### Eth1 data