Skip to content
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

feat: [draft] vaults validators triggerable exits #933

Open
wants to merge 68 commits into
base: feat/vaults
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
9b454a8
feat: add withdrawal credentials lib
mkurayan Dec 19, 2024
3bfe5ac
feat: split full and partial withdrawals
mkurayan Dec 19, 2024
4420a7c
feat: decouple fee allocation strategy from withdrawal request library
mkurayan Dec 21, 2024
1a394bf
feat: rename triggerable withdrawals lib
mkurayan Dec 23, 2024
5183e89
feat: add unit tests for triggerable withdrawals lib
mkurayan Dec 26, 2024
2fc90ec
feat: add unit tests for triggerable withdrawals in the withdrawal va…
mkurayan Dec 26, 2024
5888fac
feat: use lido locator instead of direct VEB address
mkurayan Jan 10, 2025
c251b90
feat: add access control to WithdrawalVault contract
mkurayan Jan 14, 2025
9cf5ea4
Merge commit '49c97519e932f5084d4faa698f14b261befa055d' into feat/wit…
mkurayan Jan 14, 2025
1b2dd97
refactor: remove unnecessary memory allocation
mkurayan Jan 15, 2025
d26dddc
feat: specify fee per request instead of total fee in TW library
mkurayan Jan 17, 2025
66ccbcf
feat: tightly pack pubkeys
mkurayan Jan 20, 2025
96968fe
Merge remote-tracking branch 'origin/feat/withdrawal-credentials' int…
tamtamchik Jan 23, 2025
0f37e51
refactor: format code
mkurayan Jan 27, 2025
93c56a4
Merge branch 'feat/vaults' into feat/waults-triggerable-exits
tamtamchik Jan 27, 2025
6f303e5
refactor: move TriggerableWithdrawals lib from 0.8.9 to common
mkurayan Jan 27, 2025
60ba435
chore: basic refactoring of staking vault validator management
tamtamchik Jan 27, 2025
ade67a7
refactor: improve naming for address validation utility
mkurayan Jan 28, 2025
57cad87
chore: simplify code
tamtamchik Jan 28, 2025
89d583a
test: add unit tests for Withdrawal Vault excess fee refund behavior
mkurayan Jan 28, 2025
a8a9762
feat: add base layer for triggerable exits
tamtamchik Jan 28, 2025
6d31a25
Merge branch 'feat/vaults' into feat/waults-triggerable-exits
tamtamchik Jan 28, 2025
2ce0a1c
chore: cleanup
tamtamchik Jan 28, 2025
d928cf9
Merge branch 'feat/withdrawal-credentials' into feat/waults-triggerab…
tamtamchik Jan 28, 2025
cfadfb4
refactor: improve TriggerableWithdrawals lib methods description
mkurayan Jan 28, 2025
9f268cf
refactor: triggerable withdrawals lib rename errors for clarity
mkurayan Jan 28, 2025
811fdf8
refactor: describe full withdrawal method in withdrawal vault
mkurayan Jan 28, 2025
da8fad2
chore: add fees calculation base
tamtamchik Jan 28, 2025
7743888
Merge branch 'feat/withdrawal-credentials' into feat/waults-triggerab…
tamtamchik Jan 28, 2025
a7447df
chore: tests
tamtamchik Jan 28, 2025
a30cd67
chore: renaming
tamtamchik Jan 29, 2025
8bedfe6
chore: restore request validator exit
tamtamchik Jan 29, 2025
6cdc711
Merge commit '2d11786ebc1f06165c501fa8e9fecef053e12ab9' into feat/wit…
mkurayan Jan 30, 2025
6da1d6f
feat: grant withdrawal request role to ValidatorsExitBusOracle contra…
mkurayan Feb 1, 2025
cd8ec7e
Merge branch 'feat/withdrawal-credentials' into feat/vaults-triggerab…
tamtamchik Feb 3, 2025
9a1a8d8
feat: move to 0x02 wc for vaults
tamtamchik Feb 3, 2025
ab1a048
feat: beacon chain foundation contract
tamtamchik Feb 3, 2025
daf96c4
chore: cleanup staking vault interface
tamtamchik Feb 3, 2025
fde279b
test: update staking vault tests
tamtamchik Feb 3, 2025
8763f26
Merge branch 'feat/vaults' into feat/vaults-triggerable-exits
tamtamchik Feb 3, 2025
7f18488
fix: tests
tamtamchik Feb 3, 2025
1af1d3a
feat: validate withdrawal fee response
mkurayan Feb 4, 2025
c27de34
feat: update eip-7002 contract address
mkurayan Feb 4, 2025
1b11c66
feat: add initiate withdrawal functions
tamtamchik Feb 4, 2025
c9d3226
Merge branch 'feat/withdrawal-credentials' into feat/vaults-triggerab…
tamtamchik Feb 4, 2025
9b52efa
feat: forceValidatorWithdrawals poc
tamtamchik Feb 4, 2025
f27d244
chore: update permissions and dashboard
tamtamchik Feb 4, 2025
939cbb4
chore: update dashboard test coverage
tamtamchik Feb 4, 2025
6722576
chore: cleanup
tamtamchik Feb 4, 2025
748f8c9
chore: fix tests and linter
tamtamchik Feb 5, 2025
33f1d5c
chore: remove controller
tamtamchik Feb 5, 2025
dd67b36
chore: add timelock for force withdrawals
tamtamchik Feb 5, 2025
ebd830d
feat: update timelock logic
tamtamchik Feb 6, 2025
1c7abcb
ci: disable Hardhat / Mainnet tests
tamtamchik Feb 6, 2025
5d3dd3c
chore: refactor the threshold calculation
tamtamchik Feb 6, 2025
c2facaf
chore: fix assessment
tamtamchik Feb 7, 2025
0b91931
chore: update dashboarad
tamtamchik Feb 7, 2025
34bceac
feat: update staking valult
tamtamchik Feb 8, 2025
4895d35
test: fix
tamtamchik Feb 8, 2025
a8b41ab
chore: add tests
tamtamchik Feb 8, 2025
f0d865e
feat: isVaultHealthy function
tamtamchik Feb 8, 2025
60f3e68
feat: revert if partial withdrawals are requested on the unhealthy vault
tamtamchik Feb 10, 2025
5260fcd
Merge branch 'feat/vaults' into feat/vaults-triggerable-exits
tamtamchik Feb 11, 2025
fb94485
chore: some documentation
tamtamchik Feb 12, 2025
7bc6c00
chore: massive renaming
tamtamchik Feb 12, 2025
dd28196
chore: polishing
tamtamchik Feb 12, 2025
b19caf9
test: partially restore negative rebase
tamtamchik Feb 12, 2025
ccd9043
chore: cleanup
tamtamchik Feb 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/0.8.25/interfaces/IStakingRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ interface IStakingRouter {
uint256 precisionPoints
);

function reportRewardsMinted(uint256[] memory _stakingModuleIds, uint256[] memory _totalShares) external;
function reportRewardsMinted(uint256[] calldata _stakingModuleIds, uint256[] calldata _totalShares) external;
}
31 changes: 23 additions & 8 deletions contracts/0.8.25/vaults/Dashboard.sol
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,6 @@ contract Dashboard is Permissions {
SafeERC20.safeTransfer(WETH, _recipient, _amountOfWETH);
}

/**
* @notice Requests the exit of a validator from the staking vault
* @param _validatorPublicKey Public key of the validator to exit
*/
function requestValidatorExit(bytes calldata _validatorPublicKey) external {
_requestValidatorExit(_validatorPublicKey);
}

/**
* @notice Mints stETH tokens backed by the vault to the recipient.
* @param _recipient Address of the recipient
Expand Down Expand Up @@ -462,6 +454,29 @@ contract Dashboard is Permissions {
_resumeBeaconChainDeposits();
}

/**
* @notice Signals to node operators that specific validators should exit from the beacon chain.
* It does not directly trigger exits - node operators must monitor for these events and handle the exits manually.
* @param _pubkeys Concatenated validator public keys, each 48 bytes long.
* @dev Emits `ValidatorExitRequested` event for each validator public key through the StakingVault.
* This is a voluntary exit request - node operators can choose whether to act on it.
*/
function requestValidatorExit(bytes calldata _pubkeys) external {
_requestValidatorExit(_pubkeys);
}

/**
* @notice Triggers validator withdrawals via EIP-7002 triggerable exit mechanism. This allows withdrawing either the full
* validator balance or a partial amount from each validator specified.
* @param _pubkeys The concatenated public keys of the validators to request withdrawal for. Each key must be 48 bytes.
* @param _amounts The withdrawal amounts in wei for each validator. Must match the length of _pubkeys.
* @param _refundRecipient The address that will receive any fee refunds.
* @dev Requires payment of withdrawal fee which is calculated based on the number of validators and must be paid in msg.value.
*/
function triggerValidatorWithdrawal(bytes calldata _pubkeys, uint64[] calldata _amounts, address _refundRecipient) external payable {
_triggerValidatorWithdrawal(_pubkeys, _amounts, _refundRecipient);
}

// ==================== Role Management Functions ====================

/**
Expand Down
13 changes: 11 additions & 2 deletions contracts/0.8.25/vaults/Permissions.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ abstract contract Permissions is AccessControlVoteable {
*/
bytes32 public constant REQUEST_VALIDATOR_EXIT_ROLE = keccak256("StakingVault.Permissions.RequestValidatorExit");

/**
* @notice Permission for triggering validator withdrawal from the StakingVault using EIP-7002 triggerable exit.
*/
bytes32 public constant TRIGGER_VALIDATOR_WITHDRAWAL_ROLE = keccak256("StakingVault.Permissions.TriggerValidatorWithdrawal");

/**
* @notice Permission for voluntary disconnecting the StakingVault.
*/
Expand Down Expand Up @@ -141,8 +146,12 @@ abstract contract Permissions is AccessControlVoteable {
stakingVault().resumeBeaconChainDeposits();
}

function _requestValidatorExit(bytes calldata _pubkey) internal onlyRole(REQUEST_VALIDATOR_EXIT_ROLE) {
stakingVault().requestValidatorExit(_pubkey);
function _requestValidatorExit(bytes calldata _pubkeys) internal onlyRole(REQUEST_VALIDATOR_EXIT_ROLE) {
stakingVault().requestValidatorExit(_pubkeys);
}

function _triggerValidatorWithdrawal(bytes calldata _pubkeys, uint64[] calldata _amounts, address _refundRecipient) internal onlyRole(TRIGGER_VALIDATOR_WITHDRAWAL_ROLE) {
stakingVault().triggerValidatorWithdrawal{value: msg.value}(_pubkeys, _amounts, _refundRecipient);
}

function _voluntaryDisconnect() internal onlyRole(VOLUNTARY_DISCONNECT_ROLE) {
Expand Down
Loading
Loading