Defragment: Feature Lists of EIP-7251 (MaxEB)
=====
TL;DR:
======
1. [EIP-7251](https://eips.ethereum.org/EIPS/eip-7251) improves MaxEB, and is [scoping](https://eips.ethereum.org/EIPS/eip-7600) into [Electra](https://ethereum.github.io/consensus-specs/specs/electra/beacon-chain/) Upgrade ([~2025/Q1](https://x.com/TimBeiko/status/1793684244612407687)), and with the mission to [sustain validator set size growth](https://ethresear.ch/t/sticking-to-8192-signatures-per-slot-post-ssf-how-and-why/17989), and preparing for [SSF](https://ethereum.org/en/roadmap/single-slot-finality/) and [ePBS](https://ethereum.org/en/roadmap/pbs/).
2. I have studied that [EIP-7251](https://eips.ethereum.org/EIPS/eip-7251) has 6 features and explains what they are. Some features are left post Electra implementation after breakout calls.
3. This article aims to explain how to implement all these features for [Electra](https://ethereum.github.io/consensus-specs/specs/electra/beacon-chain/) Upgrade at coding level ([Spec](https://ethereum.github.io/consensus-specs/specs/electra/beacon-chain/) and [Test](https://github.com/ethereum/execution-spec-tests)). In summary,
1. Feature `1, 2, 3, 4` are fully implemented.
2. Feature `5` needs to be completed by implementing one missing part and Feature `6` needs to be fully implemented.
4. My other relevent articles on EIP-7251:
- [BeaconState and Validator Balance for EIP-7251](https://hackmd.io/@georgesheth/BJGl24HYA)
- [History of EIP-7251](https://hackmd.io/@georgesheth/rJxnQBrtC)
- [Feature Lists of EIP-7251](https://hackmd.io/@georgesheth/HJKkx3NSR)
- [Implement EIP-7251](https://hackmd.io/@georgesheth/Hk2r2BHFC)
- [Develop Push Based Custom Ceiling Partial Feature Withdraw for EIP-7251](https://hackmd.io/@georgesheth/BJ5tkLBtA)
Remark:
=======
1. The [initial version](https://github.com/ethereum/EIPs/commit/be77ddfa7778fc4b82262cedce563b33933614a0) of EIP-7251 written by Mike Neuder ([@michaelneuder](https://github.com/michaelneuder)) on 2023/06/28 listed four features to be designed and implemented. It did not contain much pseudocode in the EIP. Mike also briefly summarises his view of the feature list in this [article](https://notes.ethereum.org/@mikeneuder/eip7251-features).
2. Mikhail Kalinin ([@mkalinin](https://github.com/mkalinin)) added [initial pseudocode](https://github.com/ethereum/EIPs/commit/59843422c15649a521863d16fede003eeb35a356) on 2024/06/11.
3. Meanwhile, [multiple people](https://github.com/ethereum/consensus-specs/commits/dev/specs/electra/beacon-chain.md) worked to implement EIP-7251 on Electra BeaconChain Spec.
4. After reviewing all these works, I summarize the feature list into 6, some features are proposed to be implemented post Electra. So I write this article to discuss them and be easiler to check on the implementation progress.
5. Welcome suggestion and collaboration.
EIP-7251 Feature Lists:
=======================
1. **Feature 1**: Elastic `validator.effective_balance`, by increasing the `MAX_EFFECTIVE_BALANCE`, while creating a `MIN_ACTIVATION_BALANCE`.
1. **Before EIP-7251**:
1. `MAX_EFFECTIVE_BALANCE` sets the threadhold to activate a validator, which is `32 ETH` fixed.
2. `MAX_EFFECTIVE_BALANCE` also sets the threadhold to cap for `validator.active_balance` which is `32 ETH` fixed.
3. `validator.active_balance` is an integer value from `[0, 1, ..., 31, 32]` ETH which is controlled by `EFFECTIVE_BALANCE_INCREMENT` (`1 ETH` fixed)
2. **After EIP-7251**:
1. `MIN_ACTIVATION_BALANCE` sets the threadhold to activate a validator, which is `32 ETH` fixed.
2. `MAX_EFFECTIVE_BALANCE` also sets the threadhold to cap for `validator.active_balance` which is `2048 ETH` fixed.
3. `validator.active_balance` is an integer value from `[0, 1, ..., 31, 32, ..., 2047, 2048] ETH` which is controlled by `EFFECTIVE_BALANCE_INCREMENT` (`1 ETH` fixed)
2. **Feature 2: Enable validator consolidation (optional):**
1. **Before EIP-7251**: not possible, have to exit and re-entry
2. **After EIP-7251**: Rely on [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685) to generate a validator consolidation request.
3. **Feature 3: Enable compounding rewards.**
1. **Before EIP-7251**: No compounding rewards when `validator.effective_balance` > `32 ETH`.
2. **After EIP-7251**: Earn compounding rewards when `validator.effective_balance` > `32 ETH`, and only stop when `validator.effective_balance` > `2048 ETH`.
4. **Feature 4: Extend deposit and top-up.**
1. **Before EIP-7251**: either one of these.
1. **Deposit for activation**: Staker should deposit `32 ETH` in one go for validator activation, and avoid [edge case](https://eth2book.info/capella/part2/incentives/balances/#an-edge-case). Validator can not earn extra or compounding rewards if deposit more than `32 ETH`.
2. **Top-up to avoid ejection**: Staker may only deposit again if `validator.effective_balance` is under `32 ETH`to top-up into `32 ETH` again.
2. **After EIP-7251**: additionally
1. **Deposit for activation and top-up for weight**: Staker would like to deposit more than `32 ETH` in one go for validator activation to increase weight and earn compounding rewards.
2. **Top-up for weight**: Staker would like to continue to top-up ETH to increase weight and earn compounding rewards
5. **Feature 5: Extend withdraw and exit:**
1. **Before EIP-7251**: either
1. **Voluntary Full Exit**: unstake everything and become excited.
2. **Rewards Sweep above MaxEB**: automatic partial withdrawal (gaslessly) excess balance when `validator.active_balance` is larger than `32 ETH` to maintain `32 ETH` consistently.
2. **After EIP-7251**: additionally
1. **Rewards Sweep above MaxEB**: automatic partial withdrawal (gaslessly) excess balance when `validator.active_balance` is larger than 2048 ETH.
3. **Rewards Sweep above custom ceiling but less MaxEB**: (TODO)
1. A validator can setup a custom ceiling for auto sweep. The custom ceiling should be a value between `32 ETH` to `2048 ETH`.
2. Automatic partial withdrawal (gaslessly) excess balance when `validator.active_balance` is larger than custom ceiling.
6. **Feature 6: Update slashing and penalty:**
1. **Before EIP-7251**:
1. **Initial slashing penalty**:
1. Once the offence is identified, `1/32` (or `1 ETH`) of the validator's effective balance is penalty, validator's status is set to `slashed_exiting`.
2. For about 36 days, the validator is removed from the active validation set and is placed in the exit queue. During this period, the validator not only stops earning new rewards but also incurs a penalty of about 8k GWei for every epoch that it misses performing its duties. This leads to an additional penalty of ~0.07 ETH.
3. Correlated penalties: [may lose everything](https://eth2book.info/capella/part2/incentives/slashing/).
2. **After EIP-7251**: still under discussion, but with below [proposal](https://ethresear.ch/t/slashing-penalty-analysis-eip-7251/16509) from Mike
1. **Initial slashing penalty**: fixed to a constant amount (`1 ETH` fixed, not `2048*1/32`) or modified to scale sublinearly
2. The between of initial slashing penalty and correlation penalty are same as before.
3. **Correlation penalty**: is modified to scale quadratically rather than linearly.
EIP-7251 Features linking to other EIPs
===========================================
| ID | Feature | [Beacon Spec](https://ethereum.github.io/consensus-specs/specs/electra/beacon-chain/) | [EIP7002](https://eips.ethereum.org/EIPS/eip-7002) | [EIP7685](https://eips.ethereum.org/EIPS/eip-7685) | [EIP6110](https://eips.ethereum.org/EIPS/eip-6110) |
| ---- | ---- | ---- | ---- | ---- | ----|
| 1 | Elastic `validator.effective_balance` | YES | | | |
| 2 | Enable validator consolidation (opt) | Yes | | Yes | |
| 3 | Enable compounding rewards | Yes | | | |
| 4 | Extend deposit and top-up | Yes | | | Yes |
| 5 | Extend withdraw and exit | TODO: Add custom ceiling | Yes | | |
| 6 | Update slashing and penalty | TODO: to modify `slash_validator()` TODO: to modify `process_slashings()` | | | |
EIP-7251 Features Progress Track: (WIP and will continue to update)
===================================================================
| ID | Feature | EIP-7251 Pseudocode | Beacon Chain Spec | CL Test | EL Test |
| ---- | ---- | ---- | ---- | ---- | ---- |
| 1 | Elastic `validator.effective_balance` | Yes | Yes | [Yes](https://media.githubusercontent.com/media/ethereum/consensus-spec-tests/master/presets/mainnet/electra.yaml) | |
| 2 | Enable validator consolidation (opt) | Yes | Yes | [Yes](https://github.com/ethereum/consensus-spec-tests/tree/master/tests/mainnet/electra/ssz_static/ConsolidationRequest/ssz_random) | [Yes](https://github.com/ethereum/execution-spec-tests/tree/main/tests/prague/eip7251_consolidations) and [Yes](https://github.com/ethereum/execution-spec-tests/tree/main/tests/prague/eip7685_general_purpose_el_requests) |
| 3 | Enable compounding rewards | | Yes | [Yes](https://github.com/ethereum/consensus-spec-tests/tree/master/tests/mainnet/electra/ssz_static/PendingBalanceDeposit) | |
| 4 | Extend deposit and top-up | | Yes | [Yes](https://github.com/ethereum/consensus-spec-tests/tree/master/tests/mainnet/electra/ssz_static/PendingBalanceDeposit) | [Yes](https://github.com/ethereum/execution-spec-tests/tree/main/tests/prague/eip6110_deposits) |
| 5 | Extend withdraw and exit | | TODO: Custom Ceiling | [Yes](https://github.com/ethereum/consensus-spec-tests/tree/master/tests/mainnet/electra/ssz_static/PendingPartialWithdrawal) | [Yes](https://github.com/ethereum/execution-spec-tests/tree/main/tests/prague/eip7002_el_triggerable_withdrawals) |
| 6 | Update slashing and penalty | | | | |