mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-13 12:14:19 +00:00
upate validator guide to new crosslink format
This commit is contained in:
parent
a6b3b11356
commit
9489ae5dcd
@ -38,13 +38,13 @@ __NOTICE__: This document is a work-in-progress for researchers and implementers
|
|||||||
- [Attestations](#attestations-1)
|
- [Attestations](#attestations-1)
|
||||||
- [Attestation data](#attestation-data)
|
- [Attestation data](#attestation-data)
|
||||||
- [Slot](#slot-1)
|
- [Slot](#slot-1)
|
||||||
- [Shard](#shard)
|
|
||||||
- [Beacon block root](#beacon-block-root)
|
- [Beacon block root](#beacon-block-root)
|
||||||
- [Target root](#target-root)
|
|
||||||
- [Crosslink data root](#crosslink-data-root)
|
|
||||||
- [Latest crosslink](#latest-crosslink)
|
|
||||||
- [Source epoch](#source-epoch)
|
- [Source epoch](#source-epoch)
|
||||||
- [Source root](#source-root)
|
- [Source root](#source-root)
|
||||||
|
- [Target root](#target-root)
|
||||||
|
- [Shard](#shard)
|
||||||
|
- [Previous crosslink root](#previous-crosslink-root)
|
||||||
|
- [Crosslink data root](#crosslink-data-root)
|
||||||
- [Construct attestation](#construct-attestation)
|
- [Construct attestation](#construct-attestation)
|
||||||
- [Data](#data)
|
- [Data](#data)
|
||||||
- [Aggregation bitfield](#aggregation-bitfield)
|
- [Aggregation bitfield](#aggregation-bitfield)
|
||||||
@ -250,14 +250,18 @@ First the validator should construct `attestation_data`, an [`AttestationData`](
|
|||||||
|
|
||||||
Set `attestation_data.slot = head_state.slot`.
|
Set `attestation_data.slot = head_state.slot`.
|
||||||
|
|
||||||
##### Shard
|
|
||||||
|
|
||||||
Set `attestation_data.shard = shard` where `shard` is the shard associated with the validator's committee defined by `get_crosslink_committees_at_slot`.
|
|
||||||
|
|
||||||
##### Beacon block root
|
##### Beacon block root
|
||||||
|
|
||||||
Set `attestation_data.beacon_block_root = signing_root(head_block)`.
|
Set `attestation_data.beacon_block_root = signing_root(head_block)`.
|
||||||
|
|
||||||
|
##### Source epoch
|
||||||
|
|
||||||
|
Set `attestation_data.source_epoch = head_state.justified_epoch`.
|
||||||
|
|
||||||
|
##### Source root
|
||||||
|
|
||||||
|
Set `attestation_data.source_root = head_state.current_justified_root`.
|
||||||
|
|
||||||
##### Target root
|
##### Target root
|
||||||
|
|
||||||
Set `attestation_data.target_root = signing_root(epoch_boundary)` where `epoch_boundary` is the block at the most recent epoch boundary.
|
Set `attestation_data.target_root = signing_root(epoch_boundary)` where `epoch_boundary` is the block at the most recent epoch boundary.
|
||||||
@ -266,24 +270,20 @@ _Note:_ This can be looked up in the state using:
|
|||||||
* Let `epoch_start_slot = get_epoch_start_slot(get_current_epoch(head_state))`.
|
* Let `epoch_start_slot = get_epoch_start_slot(get_current_epoch(head_state))`.
|
||||||
* Set `epoch_boundary = head if epoch_start_slot == head_state.slot else get_block_root(state, epoch_start_slot)`.
|
* Set `epoch_boundary = head if epoch_start_slot == head_state.slot else get_block_root(state, epoch_start_slot)`.
|
||||||
|
|
||||||
|
##### Shard
|
||||||
|
|
||||||
|
Set `attestation_data.shard = shard` where `shard` is the shard associated with the validator's committee defined by `get_crosslink_committees_at_slot`.
|
||||||
|
|
||||||
|
##### Previous crosslink root
|
||||||
|
|
||||||
|
Set `attestation_data.previous_crosslink_root = hash_tree_root(head_state.current_crosslinks[shard])`.
|
||||||
|
|
||||||
##### Crosslink data root
|
##### Crosslink data root
|
||||||
|
|
||||||
Set `attestation_data.crosslink_data_root = ZERO_HASH`.
|
Set `attestation_data.crosslink_data_root = ZERO_HASH`.
|
||||||
|
|
||||||
_Note:_ This is a stub for phase 0.
|
_Note:_ This is a stub for phase 0.
|
||||||
|
|
||||||
##### Latest crosslink
|
|
||||||
|
|
||||||
Set `attestation_data.previous_crosslink = head_state.latest_crosslinks[shard]`.
|
|
||||||
|
|
||||||
##### Source epoch
|
|
||||||
|
|
||||||
Set `attestation_data.source_epoch = head_state.justified_epoch`.
|
|
||||||
|
|
||||||
##### Source root
|
|
||||||
|
|
||||||
Set `attestation_data.source_root = head_state.current_justified_root`.
|
|
||||||
|
|
||||||
#### Construct attestation
|
#### Construct attestation
|
||||||
|
|
||||||
Next the validator creates `attestation`, an [`Attestation`](../core/0_beacon-chain.md#attestation) object.
|
Next the validator creates `attestation`, an [`Attestation`](../core/0_beacon-chain.md#attestation) object.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user