-
-
Notifications
You must be signed in to change notification settings - Fork 427
Implement initiateMultipleValidatorExits #1764
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
Conversation
| processOp(epochCtx, state, op, verifySignatures); | ||
| }); | ||
| }); | ||
| const indexes = readOnlyMap(body.voluntaryExits, (voluntaryExit) => voluntaryExit.message.validatorIndex); |
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.
What about using
processVoluntaryExits(body.voluntaryExits, epochCtx, state)to not spread the logic in multiple files
| [body.attestations, processAttestation], | ||
| [body.deposits, processDeposit], | ||
| [body.voluntaryExits, processVoluntaryExit], | ||
| [body.voluntaryExits, verifyVoluntaryExit], |
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 wonder if we can modify this entire statement to
processAttesterSlashings(...)
processAttestations(...)
processDeposits(...)And look for similar optimizations in the other opts
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.
the initiateValidatorExit() was called in slashValidator.ts also but we couldn't optimize the same way to this because it's required to process one by one there in order to use validator withdrawableEpoch correctly
other than that I don't see any similar improvement can be made so I keep other functions as is.
packages/lodestar-beacon-state-transition/src/fast/block/initiateValidatorExit.ts
Outdated
Show resolved
Hide resolved
9091847 to
c8f061d
Compare
|
closing this in favor of #1816 as I think the bigger issue is we loop through |
resolves #1761
initiateValidatorExitfor backward reference, it's the same to the specinitiateMultipleValidatorExitswhich loop through validator array inside state only 1 timeinitiateMultipleValidatorExits