From 36a22830526fed478a143c85c6cb2e4277b957b2 Mon Sep 17 00:00:00 2001 From: vbuterin Date: Wed, 7 Aug 2019 12:13:02 -0400 Subject: [PATCH] Shard receipts cannot penalize withdrawn validators --- specs/core/1_beacon-chain-misc.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/specs/core/1_beacon-chain-misc.md b/specs/core/1_beacon-chain-misc.md index a8768d8b5a..c1d6283ca9 100644 --- a/specs/core/1_beacon-chain-misc.md +++ b/specs/core/1_beacon-chain-misc.md @@ -156,8 +156,9 @@ def process_shard_receipt(state: BeaconState, receipt_proof: ShardReceiptProof): root=state.current_crosslinks[shard].data_root ) for delta in receipt_proof.receipt: - increase_balance(state, delta.index, state.validators[delta.index].effective_balance * delta.reward_coefficient // REWARD_COEFFICIENT_BASE) - decrease_balance(state, delta.index, delta.block_fee) + if get_current_epoch(state) < state.validators[delta.index].withdrawable_epoch: + increase_balance(state, delta.index, state.validators[delta.index].effective_balance * delta.reward_coefficient // REWARD_COEFFICIENT_BASE) + decrease_balance(state, delta.index, delta.block_fee) state.next_shard_receipt_period[receipt_proof.shard] += 1 increase_balance(state, get_beacon_proposer_index(state), MICRO_REWARD) ```