feat: move deposit/withdrawal/stake processing into ConsensusState#440
Open
matthias-wright wants to merge 35 commits into
Open
feat: move deposit/withdrawal/stake processing into ConsensusState#440matthias-wright wants to merge 35 commits into
matthias-wright wants to merge 35 commits into
Conversation
417d76d to
05d0b07
Compare
…cle/edge-case tests
05d0b07 to
6ffc5ec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 reworks how Summit handles deposits, withdrawals, staking, and committee transitions: the logic moves out of the finalizer actor and into
ConsensusState, making the state transition self-contained, deterministic, and unit-testable without the finalizer/EL harness.This also addresses #339 and #362, superseding #379 and #397.
Changes:
ConsensusState.MinimumStake.MaximumStakeparam, validators can stake as much as they want.MinimumStakeis increased, validators withbalance < MinimumStakeare still removed from the committee (if the resulting committee size is still larger than a defined minimum), but the remaining balance is no longer withdrawn automatically. Removed validators may withdraw their balance at any time.has_pending_depositandhas_pending_withdrawalfields from the validator accounts.FullPayoutPendingto distinguish a validator that has left the committee with its full balance committed to a pending payout (must not rejoin) from a plainInactivevalidator (out of committee, keeps its balance, may rejoin via a top-up and may hold a pending partial withdrawal). Without theFullPayoutPending, an incoming deposit would re-activate a validator whose entire balance is about to be withdrawn.