Electra: EIP-7251 Update process_voluntary_exit#14176
Conversation
| ) | ||
| } | ||
|
|
||
| if st.Version() >= version.Electra { |
There was a problem hiding this comment.
do we want to break this out from the core blocks into electra?
There was a problem hiding this comment.
Eventually. Breaking this out would involve breaking the other forks out and it would be a large change. Currently trying to get to devnet-1 while taking note of this. I'll take a note of this, thanks
e6d3240 to
ae696b6
Compare
ae696b6 to
f5e6376
Compare
| // initiate_validator_exit(state, voluntary_exit.validator_index) | ||
| func verifyExitConditions(validator state.ReadOnlyValidator, currentSlot primitives.Slot, exit *ethpb.VoluntaryExit) error { | ||
| func verifyExitConditions(st state.ReadOnlyBeaconState, validator state.ReadOnlyValidator, currentSlot primitives.Slot, exit *ethpb.VoluntaryExit) error { | ||
| currentEpoch := slots.ToEpoch(currentSlot) |
There was a problem hiding this comment.
I am worried about the new state not being compatible with currentSlot here. Either the state should have state.Slot() == currentSlot in which case you can just not pass this old parameter, or you need to ensure compatibility. One may be acting on an exit for a slot with data from an old state.
There was a problem hiding this comment.
OK that is fair, I will remove the state parameter and require the fork parameter.
There was a problem hiding this comment.
Oh, actually, we must have the state. So the correct solution is to remove currentSlot and reference state.Slot() as you mentioned
* Electra: EIP-7251 Update `process_voluntary_exit` * Add unit test for VerifyExitAndSignature EIP-7251 * @potuz peer feedback
* add http endpoint * add tests * Gaz * Add pointers * add endpoint to test * Electra: EIP-7251 Update `process_voluntary_exit` (#14176) * Electra: EIP-7251 Update `process_voluntary_exit` * Add unit test for VerifyExitAndSignature EIP-7251 * @potuz peer feedback * Avoid Cloning When Creating a New Gossip Message (#14201) * Add Current Changes * add back check * Avoid a Panic * fix: Multiple network flags should prevent the BN to start (#14169) * Implement Initial Logic * Include check in main.go * Add tests for multiple flags * remove usage of append * remove config/features dependency * Move ValidateNetworkFlags to config/features * Nit * removed NetworkFlags from cmd * remove usage of empty string literal * add comment * add flag validation to prysctl validator-exit --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * fix tests * Radek' review + tests * fix tests * Radek' review * forgot one * almost forgot the tests --------- Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com> Co-authored-by: Nishant Das <nishdas93@gmail.com> Co-authored-by: kira <shyampkira@gmail.com> Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> Co-authored-by: Radosław Kapka <rkapka@wp.pl>
What type of PR is this?
Feature
What does this PR do? Why is it needed?
Updates process_voluntary_exit to the spec changes at v1.5.0-alpha.3
Which issues(s) does this PR fix?
Other notes for review
Introduced in ethereum/consensus-specs#3668