From 6f0f2a8f5373f94652f45ce3f36af47fa01ab6b8 Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Sat, 30 Mar 2019 16:21:09 -0700 Subject: [PATCH 1/4] Update the descriptive text to refer to the correct type of root --- specs/core/0_beacon-chain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index d08828692..629d2990c 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -942,7 +942,7 @@ def get_block_root(state: BeaconState, return state.latest_block_roots[slot % SLOTS_PER_HISTORICAL_ROOT] ``` -`get_block_root(_, s)` should always return `hash_tree_root` of the block in the beacon chain at slot `s`, and `get_crosslink_committees_at_slot(_, s)` should not change unless the [validator](#dfn-validator) registry changes. +`get_block_root(_, s)` should always return `signed_root` of the block in the beacon chain at slot `s`, and `get_crosslink_committees_at_slot(_, s)` should not change unless the [validator](#dfn-validator) registry changes. ### `get_state_root` From a4d87d44fb664d68a5d6500bb5ecf23eedcc32ba Mon Sep 17 00:00:00 2001 From: Justin Date: Wed, 17 Apr 2019 22:22:53 +1000 Subject: [PATCH 2/4] Remove custody_bitfield from PendingAttestation I don't think we need it :) --- specs/core/0_beacon-chain.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index edd52b2e3..2e8c0b593 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -425,8 +425,6 @@ The types are defined topologically to aid in facilitating an executable version 'aggregation_bitfield': 'bytes', # Attestation data 'data': AttestationData, - # Custody bitfield - 'custody_bitfield': 'bytes', # Inclusion slot 'inclusion_slot': 'uint64', } @@ -2130,7 +2128,6 @@ def process_attestation(state: BeaconState, attestation: Attestation) -> None: pending_attestation = PendingAttestation( data=attestation.data, aggregation_bitfield=attestation.aggregation_bitfield, - custody_bitfield=attestation.custody_bitfield, inclusion_slot=state.slot ) if target_epoch == get_current_epoch(state): From 4bffa87646f3f42ca91ac2c0cdf408762d3dfadc Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Wed, 17 Apr 2019 08:57:23 -0600 Subject: [PATCH 3/4] fix finalization bug --- specs/core/0_beacon-chain.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index edd52b2e3..6f829821e 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1711,11 +1711,11 @@ def update_justification_and_finalization(state: BeaconState) -> None: state.finalized_epoch = antepenultimate_justified_epoch state.finalized_root = get_block_root(state, get_epoch_start_slot(state.finalized_epoch)) # The 1st/2nd/3rd most recent epochs are justified, the 1st using the 3rd as source - if (bitfield >> 0) % 8 == 0b111 and state.previous_justified_root == current_epoch - 2: + if (bitfield >> 0) % 8 == 0b111 and state.previous_justified_epoch == current_epoch - 2: state.finalized_epoch = state.previous_justified_root state.finalized_root = get_block_root(state, get_epoch_start_slot(state.finalized_epoch)) # The 1st/2nd most recent epochs are justified, the 1st using the 2nd as source - if (bitfield >> 0) % 4 == 0b11 and state.previous_justified_root == current_epoch - 1: + if (bitfield >> 0) % 4 == 0b11 and state.previous_justified_epoch == current_epoch - 1: state.finalized_epoch = state.previous_justified_root state.finalized_root = get_block_root(state, get_epoch_start_slot(state.finalized_epoch)) ``` From 73bd821417bd972b886fc33a475b01e897c18cde Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Wed, 17 Apr 2019 09:26:23 -0600 Subject: [PATCH 4/4] bug fix --- specs/core/0_beacon-chain.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 6f829821e..874d253f8 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1712,11 +1712,11 @@ def update_justification_and_finalization(state: BeaconState) -> None: state.finalized_root = get_block_root(state, get_epoch_start_slot(state.finalized_epoch)) # The 1st/2nd/3rd most recent epochs are justified, the 1st using the 3rd as source if (bitfield >> 0) % 8 == 0b111 and state.previous_justified_epoch == current_epoch - 2: - state.finalized_epoch = state.previous_justified_root + state.finalized_epoch = state.previous_justified_epoch state.finalized_root = get_block_root(state, get_epoch_start_slot(state.finalized_epoch)) # The 1st/2nd most recent epochs are justified, the 1st using the 2nd as source if (bitfield >> 0) % 4 == 0b11 and state.previous_justified_epoch == current_epoch - 1: - state.finalized_epoch = state.previous_justified_root + state.finalized_epoch = state.previous_justified_epoch state.finalized_root = get_block_root(state, get_epoch_start_slot(state.finalized_epoch)) ```