feat: rework execution requests and admit joining validators early to the p2p network #85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates the execution request handling in the finalizer to uphold the following invariants:
VALIDATOR_NUM_WARM_UP_EPOCHSepochs after submitting a valid deposit request. The phase after submitting the deposit request, and before joining the committee is called theonboarding phase.n, then the validator will be removed from the committee at the end of epochn. The withdrawal will be processed in epochn + VALIDATOR_WITHDRAWAL_NUM_EPOCHS.VALIDATOR_WITHDRAWAL_NUM_EPOCHSepochs later.balance, and a withdrawal request with amountamount < balanceis submitted, then the withdrawal request will be processed for the amount ofbalance.VALIDATOR_MINIMUM_STAKE. If a deposit request withamountis submitted, whereamount != VALIDATOR_MINIMUM_STAKE, then the deposit request will be skipped, and a withdrawal request will be initiated immediately.VALIDATOR_MINIMUM_STAKE, then it cannot submit another deposit request with amountVALIDATOR_MINIMUM_STAKE.Additionally, this adds joining validators to the p2p network early. When a validator stakes in epoch
n, they will join the committee in epochn + VALIDATOR_NUM_WARM_UP_EPOCHS. However, they will now be added to the p2p network in epochn + 1. This allows them to sync blocks and catch up their state, without actively participating in consensus.