Fix delay-based attestation inclusion reward

Modify the delay-based reward function from the current `r = (65-d)/64` to `r = 1/d`.

Rationale is that in the normal case delay is close to 1, so we want a larger incentive to get included more quickly to encourage stability of the fork choice. Particularly, in the status quo if you know that you will be a proposer <4 slots in the future, you can maximize earnings by delaying inclusion of your attestation until you can include it yourself and get the proposer reward; this adjustment fixes this in the normal case.
This commit is contained in:
vbuterin 2019-10-17 10:39:21 +08:00 committed by GitHub
parent fffdb24708
commit 8de3b83157
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -1365,9 +1365,7 @@ def get_attestation_deltas(state: BeaconState) -> Tuple[Sequence[Gwei], Sequence
rewards[attestation.proposer_index] += proposer_reward rewards[attestation.proposer_index] += proposer_reward
max_attester_reward = get_base_reward(state, index) - proposer_reward max_attester_reward = get_base_reward(state, index) - proposer_reward
rewards[index] += Gwei( rewards[index] += Gwei(
max_attester_reward max_attester_reward // attestation.inclusion_delay
* (SLOTS_PER_EPOCH + MIN_ATTESTATION_INCLUSION_DELAY - attestation.inclusion_delay)
// SLOTS_PER_EPOCH
) )
# Inactivity penalty # Inactivity penalty