-
Notifications
You must be signed in to change notification settings - Fork 918
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
EIP-6110: Supply validator deposits on chain #13944
base: develop
Are you sure you want to change the base?
Conversation
if uint64(len(body.Deposits())) != maxDeposits { | ||
return nil, fmt.Errorf("incorrect outstanding deposits in block body, wanted: %d, got: %d", | ||
maxDeposits, len(body.Deposits())) | ||
if len(body.Deposits()) != 0 { |
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.
double check as this is changing existing logic or if I need to handle it in a fork specific way
don't forget about this,
|
Amount: receipt.Amount, | ||
WithdrawalCredentials: bytesutil.SafeCopyBytes(receipt.WithdrawalCredentials), | ||
Signature: bytesutil.SafeCopyBytes(receipt.Signature), | ||
}, true) // individually verify signatures instead of batch verify |
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.
should I be batch verifying
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.
might need to change blocks.BatchVerifyDepositsSignatures or process depositsReceipt to handle batch verification...
if err != nil { | ||
return nil, errors.Wrap(err, "could not retrieve receipts start index") | ||
} | ||
eth1DepositIndexLimit := math.Min(canonicalEth1Data.DepositCount, receiptsStartIndex) |
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.
make sure this is safe
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.
added unit test
need to add some spec tests to this |
reverting changes for |
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.
Partial review, will review more later
pbd, err := preState.PendingBalanceDeposits() | ||
if err != nil { | ||
return nil, err |
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.
A genesis state would not have pending balance deposits. Why do you need this change?
case version.Phase0: | ||
if beaconBlock.Version() == version.Phase0 { | ||
state, err = phase0Operations(ctx, state, beaconBlock) | ||
if err != nil { | ||
return nil, err | ||
} | ||
case version.Altair, version.Bellatrix, version.Capella, version.Deneb, version.Electra: | ||
} else { | ||
state, err = altairOperations(ctx, state, beaconBlock) | ||
if err != nil { | ||
return nil, err | ||
} | ||
default: | ||
return nil, errors.New("block does not have correct version") | ||
} |
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.
I think this will change in an upcoming PR when we add electraOperations.
// if has_eth1_withdrawal_credential(validator): | ||
// validator.withdrawal_credentials = COMPOUNDING_WITHDRAWAL_PREFIX + validator.withdrawal_credentials[1:] | ||
// queue_excess_active_balance(state, index) | ||
func SwitchToCompoundingValidator(s state.BeaconState, idx primitives.ValidatorIndex) error { |
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 already exists in develop. Please delete this and use github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra.SwitchToCompoundingValidator
design changing as part of ethereum/consensus-specs#3689, awaiting new tasks that come out of PR 3689 |
What type of PR is this?
Feature
What does this PR do? Why is it needed?
implements eip6110 as defined in https://eips.ethereum.org/EIPS/eip-6110
Note:
Which issues(s) does this PR fix?
part of PSM-371
Other notes for review
related PR: #13943