proto pr feedback

This commit is contained in:
Danny Ryan 2019-10-18 12:10:36 +09:00
parent fbcc2a4870
commit 58c28349de
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
2 changed files with 6 additions and 6 deletions

View File

@ -192,8 +192,7 @@ def on_attestation(store: Store, attestation: Attestation) -> None:
# Attestations can only affect the fork choice of subsequent slots.
# Delay consideration in the fork choice until their slot is in the past.
attestation_slot = attestation.data.slot
assert store.time >= (attestation_slot + 1) * SECONDS_PER_SLOT
assert store.time >= (attestation.data.slot + 1) * SECONDS_PER_SLOT
# Get state at the `target` to validate attestation and calculate the committees
indexed_attestation = get_indexed_attestation(target_state, attestation)

View File

@ -285,6 +285,11 @@ First, the validator should construct `attestation_data`, an [`AttestationData`]
- Let `head_block` be the result of running the fork choice during the assigned slot.
- Let `head_state` be the state of `head_block` processed through any empty slots up to the assigned slot using `process_slots(state, slot)`.
##### General
* Set `attestation_data.slot = slot` where `slot` is the assigned slot.
* Set `attestation_data.index = index` where `index` is the index associated with the validator's committee.
##### LMD GHOST vote
Set `attestation_data.beacon_block_root = signing_root(head_block)`.
@ -299,10 +304,6 @@ Set `attestation_data.beacon_block_root = signing_root(head_block)`.
- Let `start_slot = compute_start_slot_of_epoch(get_current_epoch(head_state))`.
- Let `epoch_boundary_block_root = signing_root(head_block) if start_slot == head_state.slot else get_block_root(state, start_slot)`.
##### Index
Set `attestation_data.index = index` where `index` is the index associated with the validator's committee.
#### Construct attestation
Next, the validator creates `attestation`, an [`Attestation`](../core/0_beacon-chain.md#attestation) object.