From 0f222171ca3d43541c7104990fdec26686be6468 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Thu, 21 Feb 2019 15:14:59 -0700 Subject: [PATCH 1/3] fix epoch boundary root per #652 --- specs/validator/0_beacon-chain-validator.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/specs/validator/0_beacon-chain-validator.md b/specs/validator/0_beacon-chain-validator.md index 6fdeafb49..1379e49ae 100644 --- a/specs/validator/0_beacon-chain-validator.md +++ b/specs/validator/0_beacon-chain-validator.md @@ -262,7 +262,9 @@ Set `attestation_data.beacon_block_root = hash_tree_root(head)` where `head` is Set `attestation_data.epoch_boundary_root = hash_tree_root(epoch_boundary)` where `epoch_boundary` is the block at the most recent epoch boundary in the chain defined by `head` -- i.e. the `BeaconBlock` where `block.slot == get_epoch_start_slot(slot_to_epoch(head.slot))`. -_Note:_ This can be looked up in the state using `get_block_root(state, get_epoch_start_slot(slot_to_epoch(head.slot)))`. +_Note:_ This can be looked up in the state using: +* Let `epoch_start_slot = get_epoch_start_slot(slot_to_epoch(head.slot))`. `get_block_root(state, get_epoch_start_slot(slot_to_epoch(head.slot)))`. +* Set `epoch_boundary_root = hash_tree_root(head) if epoch_start_slot == head.slot else get_block_root(state, epoch_start_slot)`. ##### Shard block root From d31aeacd3c9937d0ebc32f5370667733a9529f68 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Thu, 21 Feb 2019 15:18:41 -0700 Subject: [PATCH 2/3] fix minor errors per #628 --- specs/validator/0_beacon-chain-validator.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/validator/0_beacon-chain-validator.md b/specs/validator/0_beacon-chain-validator.md index 1379e49ae..f20fe587b 100644 --- a/specs/validator/0_beacon-chain-validator.md +++ b/specs/validator/0_beacon-chain-validator.md @@ -263,7 +263,7 @@ Set `attestation_data.beacon_block_root = hash_tree_root(head)` where `head` is Set `attestation_data.epoch_boundary_root = hash_tree_root(epoch_boundary)` where `epoch_boundary` is the block at the most recent epoch boundary in the chain defined by `head` -- i.e. the `BeaconBlock` where `block.slot == get_epoch_start_slot(slot_to_epoch(head.slot))`. _Note:_ This can be looked up in the state using: -* Let `epoch_start_slot = get_epoch_start_slot(slot_to_epoch(head.slot))`. `get_block_root(state, get_epoch_start_slot(slot_to_epoch(head.slot)))`. +* Let `epoch_start_slot = get_epoch_start_slot(slot_to_epoch(head.slot))`. * Set `epoch_boundary_root = hash_tree_root(head) if epoch_start_slot == head.slot else get_block_root(state, epoch_start_slot)`. ##### Shard block root @@ -282,7 +282,7 @@ Set `attestation_data.justified_epoch = state.justified_epoch` where `state` is ##### Justified block root -Set `attestation_data.justified_block_root = hash_tree_root(justified_block)` where `justified_block` is the block at `state.justified_epoch` in the chain defined by `head`. +Set `attestation_data.justified_block_root = hash_tree_root(justified_block)` where `justified_block` is the block at the slot `get_epoch_start_slot(state.justified_epoch)` in the chain defined by `head`. _Note:_ This can be looked up in the state using `get_block_root(state, justified_epoch)`. From e8d41fd8895b60742e2a24d0001763aae711e1bf Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Fri, 22 Feb 2019 14:30:07 +0800 Subject: [PATCH 3/3] Fix missing `get_epoch_start_slot()` --- specs/validator/0_beacon-chain-validator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/validator/0_beacon-chain-validator.md b/specs/validator/0_beacon-chain-validator.md index f20fe587b..c469e5970 100644 --- a/specs/validator/0_beacon-chain-validator.md +++ b/specs/validator/0_beacon-chain-validator.md @@ -284,7 +284,7 @@ Set `attestation_data.justified_epoch = state.justified_epoch` where `state` is Set `attestation_data.justified_block_root = hash_tree_root(justified_block)` where `justified_block` is the block at the slot `get_epoch_start_slot(state.justified_epoch)` in the chain defined by `head`. -_Note:_ This can be looked up in the state using `get_block_root(state, justified_epoch)`. +_Note:_ This can be looked up in the state using `get_block_root(state, get_epoch_start_slot(state.justified_epoch))`. #### Construct attestation