mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-13 04:04:19 +00:00
Update 0_beacon-chain.md
This commit is contained in:
parent
09ed9aea98
commit
66403ad853
@ -1459,8 +1459,7 @@ def get_attestation_deltas(state: BeaconState) -> Tuple[List[Gwei], List[Gwei]]:
|
|||||||
for index in get_unslashed_attesting_indices(state, matching_source_attestations):
|
for index in get_unslashed_attesting_indices(state, matching_source_attestations):
|
||||||
earliest_attestation = get_earliest_attestation(state, matching_source_attestations, index)
|
earliest_attestation = get_earliest_attestation(state, matching_source_attestations, index)
|
||||||
rewards[earliest_attestation.proposer_index] += get_base_reward(state, index) // PROPOSER_REWARD_QUOTIENT
|
rewards[earliest_attestation.proposer_index] += get_base_reward(state, index) // PROPOSER_REWARD_QUOTIENT
|
||||||
attestation_slot = get_attestation_slot(state, earliest_attestation)
|
inclusion_delay = earliest_attestation.inclusion_slot - get_attestation_slot(state, earliest_attestation)
|
||||||
inclusion_delay = earliest_attestation.inclusion_slot - attestation_slot
|
|
||||||
rewards[index] += get_base_reward(state, index) * MIN_ATTESTATION_INCLUSION_DELAY // inclusion_delay
|
rewards[index] += get_base_reward(state, index) * MIN_ATTESTATION_INCLUSION_DELAY // inclusion_delay
|
||||||
|
|
||||||
# Inactivity penalty
|
# Inactivity penalty
|
||||||
@ -1745,9 +1744,8 @@ def process_attestation(state: BeaconState, attestation: Attestation) -> None:
|
|||||||
Process ``Attestation`` operation.
|
Process ``Attestation`` operation.
|
||||||
Note that this function mutates ``state``.
|
Note that this function mutates ``state``.
|
||||||
"""
|
"""
|
||||||
attestation_slot = get_attestation_slot(state, attestation)
|
|
||||||
min_slot = state.slot - SLOTS_PER_EPOCH if get_current_epoch(state) > GENESIS_EPOCH else GENESIS_SLOT
|
min_slot = state.slot - SLOTS_PER_EPOCH if get_current_epoch(state) > GENESIS_EPOCH else GENESIS_SLOT
|
||||||
assert min_slot <= attestation_slot <= state.slot - MIN_ATTESTATION_INCLUSION_DELAY
|
assert min_slot <= get_attestation_slot(state, attestation) <= state.slot - MIN_ATTESTATION_INCLUSION_DELAY
|
||||||
|
|
||||||
# Check target epoch, source epoch, source root, and source crosslink
|
# Check target epoch, source epoch, source root, and source crosslink
|
||||||
data = attestation.data
|
data = attestation.data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user