Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add page on pos rewards and penalties #7541

Merged
merged 9 commits into from
Sep 12, 2022
Merged

Conversation

jmcook1186
Copy link
Contributor

Description

Adds a page on rewards and penalties in proof-of-stake ethereum as part of kb.beaconchain migration.
Pinging @wackerow for review and suggest possibly getting someone from consensus dev group to look too.

Related Issue

#2277

@gatsby-cloud
Copy link

gatsby-cloud bot commented Aug 23, 2022

❌ ethereum-org-website-dev deploy preview failed

Your build failed. View the build logs.

Copy link
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmcook1186 This is really great, nice job here! This will be a very nice resource to have on the page.

I left comments for round one, but clearly I'm going to need to peak at those sources myself at the bottom to get a refresher and circle back.


Assuming a 100% `participation_rate`:

- You vote correctly and gets included in the next slot: you get 31/8 \* `base_reward`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmcook1186 Can you help me more with where the 31/8 comes from?

Wouldn't it be 100% participation * 1/1 slot inclusion * 3 correct votes * 7/8 attester reward share * base_reward, which would be 21/8 * base_reward

Same with the others in this section.. maybe I need more clarification on the table above and how exactly that's being determined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is 8/8 * 3 * base_reward for source, target and head votes, plus 7/8 * base_reward = 31/8.

I'm not 100% sure this is right, but it is consistent with the kb.beaconchain info.

- By attesting to a block that "surrounds" another one (effectively changing history)
- By "double voting" by attesting to two candidates for the same block

If these actions are detected, the validator is slashed. This means that 1/64th of their staked ether (up to a maximum of 0.5 ether) is immediately burned, then a 36 day removal period begins. During this removal period the validators stake gradually bleeds away. At the mid-point (Day 18) an additional penalty is applied whose magnitude scales with the total staked ether of all slashed validators in the 36 days prior to slashing event. This means that when more validators are slashed, the magnitude of the slash increases. The maximum slash is the full effective balance of all slashed validators (i.e. if there are lots of validators being slashed they could lose their entire stake). On the other hand, a single, isolated slashing event only burns a small portion of the validator's stake. This midpoint penalty that scales with the number of slashed validators is called the "correlation penalty".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

As of Bellatrix

And similar to above (perhaps this is the better place for it), a note about why this occurs would be good. Reiterating, some version of how the staked ETH needs to remain accessible to the protocol, while banned that validator from casting any further votes. The correlation penalty is because this is perceived as a coordinated attack.

@vercel
Copy link

vercel bot commented Sep 1, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
ethereum-org-website ✅ Ready (Inspect) Visit Preview Sep 6, 2022 at 11:50AM (UTC)

Comment on lines 46 to 55
### Attestation scenarios

Assuming attestations are timely (included in the very next block, inclusion distance of 1) the following table describes the attestation rewards for four scenarios:

| `source` | `target` | `head` | `base_reward` | penalty | `inclusion_delay` | Result |
| ----------------- | ----------------- | ----------------- | ---------------------------------------- | ------------------ | -------------------- | ----------------------------------------------------------------- |
| incorrect/missing | incorrect/missing | incorrect/missing | 0 | 3 \* `base_reward` | 0 | -3 \* `base_reward` |
| correct | incorrect/missing | incorrect/missing | `base_reward` \* `participation_rate` | 2 \* `base_reward` | `base_reward` \* 7/8 | `base_reward` _ `participation_rate` - 9/8 _ `base_reward` |
| correct | correct | incorrect/missing | 2 _ `base_reward` _ `participation_rate` | `base_reward` | `base_reward` \* 7/8 | (2 _ `base_reward` _ `participation_rate`) - 1/8 \* `base_reward` |
| correct | correct | correct | 3 _ `base_reward` _ `participation_rate` | 0 | `base_reward` \* 7/8 | (3 _ `base_reward` _ `participation_rate`) + `base_reward` \* 7/8 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

  • Adds header ID to header
  • Using vote_reward and inclusion_reward to make it more clear these are separate rewards, and being explicit about how the result is the vote_reward + inclusion_reward - penalty
  • Moves inclusion_reward column to the left to consolidate rewards together
  • Simplifies the "results" mathematically, and arranges them all with the base_reward multiplier at the end

(same as screenshot above)

Suggested change
### Attestation scenarios
Assuming attestations are timely (included in the very next block, inclusion distance of 1) the following table describes the attestation rewards for four scenarios:
| `source` | `target` | `head` | `base_reward` | penalty | `inclusion_delay` | Result |
| ----------------- | ----------------- | ----------------- | ---------------------------------------- | ------------------ | -------------------- | ----------------------------------------------------------------- |
| incorrect/missing | incorrect/missing | incorrect/missing | 0 | 3 \* `base_reward` | 0 | -3 \* `base_reward` |
| correct | incorrect/missing | incorrect/missing | `base_reward` \* `participation_rate` | 2 \* `base_reward` | `base_reward` \* 7/8 | `base_reward` _ `participation_rate` - 9/8 _ `base_reward` |
| correct | correct | incorrect/missing | 2 _ `base_reward` _ `participation_rate` | `base_reward` | `base_reward` \* 7/8 | (2 _ `base_reward` _ `participation_rate`) - 1/8 \* `base_reward` |
| correct | correct | correct | 3 _ `base_reward` _ `participation_rate` | 0 | `base_reward` \* 7/8 | (3 _ `base_reward` _ `participation_rate`) + `base_reward` \* 7/8 |
### Attestation scenarios {#attestation-scenarios}
Assuming attestations are timely (included in the very next block, inclusion distance of 1) the following table describes the attestation rewards for four scenarios:
| `source` | `target` | `head` | `vote_reward` | `inclusion_reward` | `penalty` | Result (`vote_reward` + `inclusion_reward` - `penalty`) |
| ----------------- | ----------------- | ----------------- | ------------------------------------------ | -------------------- | ------------------ | ------------------------------------------------------- |
| incorrect/missing | incorrect/missing | incorrect/missing | 0 | 0 | 3 \* `base_reward` | - 3 \* `base_reward` |
| correct | incorrect/missing | incorrect/missing | 1 \* `base_reward` \* `participation_rate` | 7/8 \* `base_reward` | 2 \* `base_reward` | (`participation_rate` - 9/8) \* `base_reward` |
| correct | correct | incorrect/missing | 2 \* `base_reward` \* `participation_rate` | 7/8 \* `base_reward` | 1 \* `base_reward` | (2 \* `participation_rate` - 1/8) \* `base_reward` |
| correct | correct | correct | 3 \* `base_reward` \* `participation_rate` | 7/8 \* `base_reward` | 0 | (3 \* `participation_rate` + 7/8) \* `base_reward` |

Comment on lines 57 to 62
Assuming a 100% `participation_rate`:

- You vote correctly and gets included in the next slot: you get 31/8 \* `base_reward`
- You miss head because you got a late block and it gets included in the next slot: you get 15/8 \* `base_reward`
- You miss head and target cause you got late a block, you get -1/8 \* `base_reward`
- You attest and vote correctly, but the next block is missed, you get 55/16 \* `base_reward`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly just a little style addition to make it easier to compare the coefficients

Suggested change
Assuming a 100% `participation_rate`:
- You vote correctly and gets included in the next slot: you get 31/8 \* `base_reward`
- You miss head because you got a late block and it gets included in the next slot: you get 15/8 \* `base_reward`
- You miss head and target cause you got late a block, you get -1/8 \* `base_reward`
- You attest and vote correctly, but the next block is missed, you get 55/16 \* `base_reward`
Assuming a `participation_rate` of 100% (1), some common scenarios are:
- You vote correctly and it gets included in the next slot: you get **31/8** \* `base_reward`
- You miss head because you got a late block and it gets included in the next slot: you get **15/8** \* `base_reward`
- You miss head and target cause you got late a block, you get **-1/8** \* `base_reward`
- You attest and vote correctly, but the next block is missed, you get **55/16** \* `base_reward`

@wackerow wackerow changed the base branch from dev to post-merge September 12, 2022 09:22
Copy link
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmcook1186 🎉 🥳

@wackerow wackerow merged commit f8a99fc into post-merge Sep 12, 2022
@wackerow wackerow deleted the jc-rewards-and-penalties branch September 12, 2022 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content 🖋️ This involves copy additions or edits
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants