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

Altair: carry-over prev epoch participation #2373

Merged
merged 1 commit into from
May 13, 2021

Conversation

michaelsproul
Copy link
Contributor

Closes #2314

This is a (draft) PR implementing the translation of phase0 participation information into Altair participation flags at the fork, in order to prevent loss of information (and rewards).

It factors out a function from process_attestation which I had already factored out in Lighthouse anyway for use in the op pool (being able to calculate attestation flag bits independent of processing is nice).

Apart from that it adds a small function called translate_participation, which acts on the pre state's previous_epoch_attestations. I initially thought it should translate current_epoch_attestations but the lists have already been swapped by process_participation_record_updates at the time of the upgrade.

I'll start working on tests shortly. I think the main risk is covering all of the possible attestation behaviours, so I'll look into whether it's possible to reuse generators from the attestation tests.

Copy link
Contributor

@hwwhww hwwhww left a comment

Choose a reason for hiding this comment

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

It looks that this solution doesn't increase too much complexity 👍

specs/altair/beacon-chain.md Outdated Show resolved Hide resolved
specs/altair/beacon-chain.md Outdated Show resolved Hide resolved
#### `get_attestation_participation_flags`

```python
def get_attestation_participation_flag_indices(state: BeaconState,
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this refactoring! IMHO we can apply it even if the translate_participation solution doesn't get included.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review!

specs/altair/fork.md Outdated Show resolved Hide resolved
@michaelsproul michaelsproul force-pushed the translate-participation branch from 0461a02 to ea6c042 Compare May 6, 2021 00:55
@djrtwo
Copy link
Contributor

djrtwo commented May 10, 2021

This was discussed on the latest eth2 implementers call, and there was a decent amount of pushback on the complexity and testing tradeoff.

Looking for more engineering input here before a merge or close

@ajsutton
Copy link
Contributor

This looks pretty straight forward to implement to me and particularly with the refactoring to use the get_attestation_participation_flag_indices method for both this transition and normal operation the additional testing load seems very low. The refactoring probably aids testability. So I don't have a problem with this going in.

I'm not overly concerned about validators being penalised for an epoch - the optics aren't great but it's likely to be forgotten pretty quickly. But given we already have to do a special transition to activate Altair and this is a pretty simple change I'd lean in favour of including it.

@terencechain
Copy link
Contributor

I'm also leaning towards inclusion. Reasons:

  • I like the refactoring of get_attestation_participation_flag_indices, that portion is already tested in unit tests and spec tests
  • We just need new spec tests on upgrade_to_altair and further practice + verification with this on live testnet

With that said, I'm also not concerned about stakers getting penalized for one epoch, the social implication won't be good, but they will be forgotten rather quickly

@hwwhww hwwhww added the Altair aka HF1 label May 11, 2021
@michaelsproul michaelsproul changed the title [WIP] Altair: carry-over prev epoch participation Altair: carry-over prev epoch participation May 12, 2021
@djrtwo
Copy link
Contributor

djrtwo commented May 13, 2021

I'm making a PR to this PR handling the merge conflict and adding tests

@djrtwo djrtwo merged commit a2c8e0e into ethereum:dev May 13, 2021
@michaelsproul michaelsproul deleted the translate-participation branch May 15, 2021 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Altair aka HF1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Participation rewards are skipped for epoch prior to Altair upgrade
5 participants