-
Notifications
You must be signed in to change notification settings - Fork 284
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
Switch to compounding when consolidating with source==target #8646
Conversation
@@ -379,6 +379,23 @@ private void processConsolidationRequest( | |||
final UInt64 slot = state.getSlot(); | |||
final UInt64 currentEpoch = miscHelpers.computeEpochAtSlot(slot); | |||
|
|||
if (isValidSwitchToCompoundingRequest(state, consolidationRequest)) { | |||
LOG.debug("process_consolidation_request: valid switching validator to compounding address"); |
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.
this would probably be more valuable with context, so that we can see the validator id or abbreviated key?
|
||
// Verify that source != target, so a consolidation cannot be used as an exit | ||
if (consolidationRequest.getSourcePubkey().equals(consolidationRequest.getTargetPubkey())) { | ||
LOG.debug("process_consolidation_request: source_pubkey and target_pubkey must be different"); |
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.
probably would add the abbreviated pubkey here too...
d5b03ec
to
99feb8c
Compare
Need to wait for #8618 to rebase. |
final byte[] withdrawalCredentialsUpdated = | ||
state.getValidators().get(index).getWithdrawalCredentials().toArray(); | ||
withdrawalCredentialsUpdated[0] = COMPOUNDING_WITHDRAWAL_BYTE; | ||
state | ||
.getValidators() | ||
.update( | ||
index, | ||
validator -> | ||
validator.withWithdrawalCredentials(Bytes32.wrap(withdrawalCredentialsUpdated))); | ||
queueExcessActiveBalance(state, index); | ||
} |
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.
nit: probably not super important but this is super unsafe if the index doesn't exist, i wonder if we should put a comment in the description
PRE: validator must exist
It's checked up in the process, but this is also public, and we probably want to be super careful where we attempt this...
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.
LGTM overall
PR Description
Fixed Issue(s)
fixes #8617
Documentation
doc-change-required
label to this PR if updates are required.Changelog