Skip to content

Commit

Permalink
fix: onWithdrawalCredentialsChanged should not clean the queue (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgusakov authored Feb 6, 2025
1 parent 7071c20 commit 175fcde
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
11 changes: 6 additions & 5 deletions src/CSModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -863,16 +863,17 @@ contract CSModule is
}

/// @inheritdoc IStakingModule
/// @dev Wipes out the queue
/// @dev Changing the WC means that the current deposit data in the queue is not valid anymore and can't be deposited
/// So, the key removal charge should be reset to 0 to allow Node Operators to remove the keys without any charge.
/// @dev Does nothing
/// @dev Changing the WC means that the current deposit data in the queue is not valid anymore and can't be deposited.
/// DSM will unvet current keys.
/// The key removal charge should be reset to 0 to allow Node Operators to remove the keys without any charge.
/// After keys removal the DAO should set the new key removal charge.
function onWithdrawalCredentialsChanged()
external
onlyRole(STAKING_ROUTER_ROLE)
{
// skip all existing queue batches to effectively wipe out the queue
depositQueue.head = depositQueue.tail;
// solhint-disable-previous-line no-empty-blocks
// Nothing to do. The key removal charge should be reset separately to 0 to allow Node Operators to remove the keys without any charge.
}

/// @inheritdoc IStakingModule
Expand Down
8 changes: 0 additions & 8 deletions test/CSModule.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2726,14 +2726,6 @@ contract CsmChangeNodeOperatorRewardAddress is CSMCommon {
}
}

contract CsmOnWithdrawalCredentialsChanged is CSMCommon {
function test_onWithdrawalCredentialsChanged() public assertInvariants {
csm.onWithdrawalCredentialsChanged();

// TODO: Add queue assert
}
}

contract CsmVetKeys is CSMCommon {
function test_vetKeys_OnUploadKeys() public assertInvariants {
uint256 noId = createNodeOperator(2);
Expand Down

0 comments on commit 175fcde

Please sign in to comment.