-
Notifications
You must be signed in to change notification settings - Fork 298
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
Change consolidated balance calculation + small refactor #8908
Conversation
.../java/tech/pegasys/teku/spec/logic/versions/electra/helpers/BeaconStateAccessorsElectra.java
Outdated
Show resolved
Hide resolved
/* | ||
Implements process_deposit_request from consensus-specs (EIP-6110) | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moving all of these fns does make it a lot harder to determine if there were changes in githubs ui...
a9b079f
to
e99e85b
Compare
final UInt64 activeBalance = | ||
stateAccessorsElectra.getActiveBalance(state, pendingConsolidation.getSourceIndex()); | ||
// Calculate the consolidated balance | ||
final UInt64 sourceEffectiveBalance = | ||
state | ||
.getBalances() | ||
.get(pendingConsolidation.getSourceIndex()) | ||
.get() | ||
.min(sourceValidator.getEffectiveBalance()); | ||
// Move active balance to target. Excess balance is withdrawable. | ||
beaconStateMutators.decreaseBalance( | ||
state, pendingConsolidation.getSourceIndex(), activeBalance); | ||
state, pendingConsolidation.getSourceIndex(), sourceEffectiveBalance); | ||
beaconStateMutators.increaseBalance( | ||
state, pendingConsolidation.getTargetIndex(), activeBalance); | ||
state, pendingConsolidation.getTargetIndex(), sourceEffectiveBalance); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep next time i think this can be a PR and refactor can be separate for sanity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, noted for next time.
e99e85b
to
baef17e
Compare
baef17e
to
8441b42
Compare
change from Consensys#8908 Signed-off-by: Paul Harris <[email protected]>
PR Description
ELECTRA
ref tests while waiting forv1.5.0-alpha.10
releaseEpochProcessorElectra
Fixed Issue(s)
fixes #8891
Documentation
doc-change-required
label to this PR if updates are required.Changelog