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

reduce justification and finalization Altair diff #2258

Merged
merged 2 commits into from
Mar 22, 2021
Merged

Conversation

protolambda
Copy link
Contributor

No functional changes, just presentation:

  • Split Phase 0 process_justification_and_finalization into calculation of target stake and weigh_justification_and_finalization to consider the stake totals and update state.
  • Update Altair to first calculate target stake, then run weigh_justification_and_finalization

This helps reduce the diff, avoids duplicate code, and improves the performance of the spec implementation (get_total_active_balance(state) only has to be called once).

Suggestions for variable and function naming welcome.

@protolambda protolambda added general:presentation Presentation (as opposed to content) Altair aka HF1 labels Mar 21, 2021
@protolambda protolambda requested a review from djrtwo March 21, 2021 03:37
Copy link
Contributor

@djrtwo djrtwo left a comment

Choose a reason for hiding this comment

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

Nits. I'm happy to do the edits

specs/altair/beacon-chain.md Outdated Show resolved Hide resolved
specs/phase0/beacon-chain.md Outdated Show resolved Hide resolved
specs/phase0/beacon-chain.md Outdated Show resolved Hide resolved
@djrtwo djrtwo force-pushed the justification-altair branch from 287b4b2 to bb85ef5 Compare March 22, 2021 16:53
@djrtwo djrtwo merged commit 4407c59 into dev Mar 22, 2021
@djrtwo djrtwo deleted the justification-altair branch March 22, 2021 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Altair aka HF1 general:presentation Presentation (as opposed to content)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants