From e894a2dc1861deda97bd349f033f994cd9611f92 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Wed, 5 Dec 2018 13:55:56 -0600 Subject: [PATCH] fix issues in justificaiton/finality --- specs/core/0_beacon-chain.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index e77774b76..bdd9e4495 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1422,14 +1422,14 @@ If `state.slot % POW_RECEIPT_ROOT_VOTING_PERIOD == 0`: * Set `state.previous_justified_slot = state.justified_slot`. * Set `state.justification_bitfield = (state.justification_bitfield * 2) % 2**64`. -* Set `state.justification_bitfield &= 2` and `state.justified_slot = s - EPOCH_LENGTH` if `3 * previous_epoch_boundary_attesting_balance >= 2 * total_balance`. -* Set `state.justification_bitfield &= 1` and `state.justified_slot = s` if `3 * this_epoch_boundary_attesting_balance >= 2 * total_balance`. +* Set `state.justification_bitfield |= 2` and `state.justified_slot = s - EPOCH_LENGTH` if `3 * previous_epoch_boundary_attesting_balance >= 2 * total_balance`. +* Set `state.justification_bitfield |= 1` and `state.justified_slot = s` if `3 * this_epoch_boundary_attesting_balance >= 2 * total_balance`. -### Finalization +# Finalization -* Set `state.finalized_slot = state.justified_slot` if `state.justified_slot == s - 1 * EPOCH_LENGTH and state.justification_bitfield % 4 == 3`. -* Set `state.finalized_slot = state.justified_slot` if `state.justified_slot == s - 2 * EPOCH_LENGTH and state.justification_bitfield % 8 == 7`. -* Set `state.finalized_slot = state.justified_slot` If `state.justified_slot == s - 3 * EPOCH_LENGTH and state.justification_bitfield % 16 in (15, 14)`. +* Set `state.finalized_slot = state.justified_slot - EPOCH_LENGTH` if `state.justified_slot == s and state.justification_bitfield % 4 == 3`. +* Set `state.finalized_slot = state.justified_slot - EPOCH_LENGTH` if `state.justified_slot == s - EPOCH_LENGTH and state.justification_bitfield % 8 == 7`. +* Set `state.finalized_slot = state.justified_slot - EPOCH_LENGTH` if `state.justified_slot == s - 2 * EPOCH_LENGTH and state.justification_bitfield % 16 in (15, 14)`. ### Crosslinks