Skip to content

Commit a79cb1e

Browse files
remove middlewareIndex param
1 parent d6f6582 commit a79cb1e

File tree

7 files changed

+18
-61
lines changed

7 files changed

+18
-61
lines changed

src/StakingNode.sol

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -415,13 +415,9 @@ contract StakingNode is IStakingNode, StakingNodeEvents, ReentrancyGuardUpgradea
415415
* number of blocks have passed since withdrawal was queued.
416416
* @param withdrawals The Withdrawals to complete. This withdrawalRoot (keccak hash of the Withdrawal) must match the
417417
* the withdrawal created as part of the queueWithdrawals call.
418-
* @param middlewareTimesIndexes The middlewareTimesIndex parameter has to do
419-
* with the Slasher, which currently does nothing. As of M2, this parameter
420-
* has no bearing on anything and can be ignored
421418
*/
422419
function completeQueuedWithdrawals(
423-
IDelegationManager.Withdrawal[] memory withdrawals,
424-
uint256[] memory middlewareTimesIndexes
420+
IDelegationManager.Withdrawal[] memory withdrawals
425421
) external onlyStakingNodesWithdrawer onlyWhenSynchronized {
426422

427423
uint256 totalWithdrawableShares = 0;
@@ -481,11 +477,9 @@ contract StakingNode is IStakingNode, StakingNodeEvents, ReentrancyGuardUpgradea
481477
/**
482478
* @notice Completes queued withdrawals with receiveAsTokens set to false
483479
* @param withdrawals Array of withdrawals to complete
484-
* @param middlewareTimesIndexes Array of middleware times indexes
485480
*/
486481
function completeQueuedWithdrawalsAsShares(
487-
IDelegationManager.Withdrawal[] calldata withdrawals,
488-
uint256[] calldata middlewareTimesIndexes
482+
IDelegationManager.Withdrawal[] calldata withdrawals
489483
) external onlyDelegator onlyWhenSynchronized {
490484
uint256 totalWithdrawalAmount = 0;
491485

@@ -509,7 +503,6 @@ contract StakingNode is IStakingNode, StakingNodeEvents, ReentrancyGuardUpgradea
509503
delegationManager.completeQueuedWithdrawals(
510504
withdrawals,
511505
tokens,
512-
// middlewareTimesIndexes,
513506
receiveAsTokens
514507
);
515508

src/WithdrawalsProcessor.sol

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,13 @@ contract WithdrawalsProcessor is Initializable, AccessControlUpgradeable, IWithd
6363
* @notice Bundles the completion of queued withdrawals and processing of principal withdrawals for a single node
6464
* @param withdrawalAction The withdrawal action containing node ID and withdrawal amounts
6565
* @param withdrawals Array of withdrawals to complete
66-
* @param middlewareTimesIndexes Array of middleware times indexes for the withdrawals
6766
*/
6867
function completeAndProcessWithdrawalsForNode(
6968
IStakingNodesManager.WithdrawalAction memory withdrawalAction,
70-
IDelegationManager.Withdrawal[] memory withdrawals,
71-
uint256[] memory middlewareTimesIndexes
69+
IDelegationManager.Withdrawal[] memory withdrawals
7270
) external onlyRole(WITHDRAWAL_MANAGER_ROLE) {
7371
// Complete queued withdrawals
74-
stakingNodesManager.nodes(withdrawalAction.nodeId).completeQueuedWithdrawals(withdrawals, middlewareTimesIndexes);
72+
stakingNodesManager.nodes(withdrawalAction.nodeId).completeQueuedWithdrawals(withdrawals);
7573

7674
// Process principal withdrawal
7775
IStakingNodesManager.WithdrawalAction[] memory actions = new IStakingNodesManager.WithdrawalAction[](1);

src/interfaces/IStakingNode.sol

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ import {IEigenPod} from "lib/eigenlayer-contracts/src/contracts/interfaces/IEige
88
import {ISignatureUtils} from "lib/eigenlayer-contracts/src/contracts/interfaces/ISignatureUtils.sol";
99
import {IDelegationManager} from "lib/eigenlayer-contracts/src/contracts/interfaces/IDelegationManager.sol";
1010

11-
struct WithdrawalCompletionParams {
12-
uint256 middlewareTimesIndex;
13-
uint256 amount;
14-
uint32 withdrawalStartBlock;
15-
address delegatedAddress;
16-
uint96 nonce;
17-
}
18-
1911
interface IStakingEvents {
2012
/// @notice Emitted when a user stakes ETH and receives ynETH.
2113
/// @param staker The address of the user staking ETH.
@@ -79,13 +71,11 @@ interface IStakingNode {
7971
) external returns (bytes32[] memory fullWithdrawalRoots);
8072

8173
function completeQueuedWithdrawals(
82-
IDelegationManager.Withdrawal[] memory withdrawals,
83-
uint256[] memory middlewareTimesIndexes
74+
IDelegationManager.Withdrawal[] memory withdrawals
8475
) external;
8576

8677
function completeQueuedWithdrawalsAsShares(
87-
IDelegationManager.Withdrawal[] calldata withdrawals,
88-
uint256[] calldata middlewareTimesIndexes
78+
IDelegationManager.Withdrawal[] calldata withdrawals
8979
) external;
9080

9181
function getInitializedVersion() external view returns (uint64);

test/integration/StakingNode.t.sol

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {IStrategy} from "lib/eigenlayer-contracts/src/contracts/interfaces/IStra
3434
import {StakingNodeTestBase, IEigenPodSimplified} from "./StakingNodeTestBase.sol";
3535
import {IRewardsCoordinator} from "lib/eigenlayer-contracts/src/contracts/interfaces/IRewardsCoordinator.sol";
3636
import {SlashingLib} from "lib/eigenlayer-contracts/src/contracts/libraries/SlashingLib.sol";
37+
import {console} from "forge-std/console.sol";
3738

3839
contract StakingNodeEigenPod is StakingNodeTestBase {
3940

@@ -249,11 +250,11 @@ contract StakingNodeDelegation is StakingNodeTestBase {
249250

250251
vm.expectRevert();
251252
vm.prank(actors.ops.STAKING_NODES_WITHDRAWER);
252-
stakingNodeInstance.completeQueuedWithdrawals(new IDelegationManager.Withdrawal[](1), new uint256[](1));
253+
stakingNodeInstance.completeQueuedWithdrawals(new IDelegationManager.Withdrawal[](1));
253254

254255
vm.expectRevert();
255256
vm.prank(actors.admin.STAKING_NODES_DELEGATOR);
256-
stakingNodeInstance.completeQueuedWithdrawalsAsShares(new IDelegationManager.Withdrawal[](1), new uint256[](1));
257+
stakingNodeInstance.completeQueuedWithdrawalsAsShares(new IDelegationManager.Withdrawal[](1));
257258
}
258259

259260
function testDelegateUndelegateAndDelegateAgain() public {
@@ -427,11 +428,8 @@ contract StakingNodeDelegation is StakingNodeTestBase {
427428

428429
// complete queued withdrawals
429430
{
430-
uint256[] memory middlewareTimesIndexes = new uint256[](calculatedWithdrawals.length);
431-
// all is zeroed out by default
432-
middlewareTimesIndexes[0] = 0;
433431
vm.prank(actors.admin.STAKING_NODES_DELEGATOR);
434-
stakingNodeInstance.completeQueuedWithdrawalsAsShares(calculatedWithdrawals, middlewareTimesIndexes);
432+
stakingNodeInstance.completeQueuedWithdrawalsAsShares(calculatedWithdrawals);
435433
}
436434

437435
finalQueuedShares = stakingNodeInstance.getQueuedSharesAmount();
@@ -528,11 +526,8 @@ contract StakingNodeDelegation is StakingNodeTestBase {
528526

529527
// complete queued withdrawals
530528
{
531-
uint256[] memory middlewareTimesIndexes = new uint256[](calculatedWithdrawals.length);
532-
// all is zeroed out by default
533-
middlewareTimesIndexes[0] = 0;
534529
vm.prank(actors.admin.STAKING_NODES_DELEGATOR);
535-
stakingNodeInstance.completeQueuedWithdrawalsAsShares(calculatedWithdrawals, middlewareTimesIndexes);
530+
stakingNodeInstance.completeQueuedWithdrawalsAsShares(calculatedWithdrawals);
536531
}
537532

538533
finalQueuedShares = stakingNodeInstance.getQueuedSharesAmount();
@@ -660,11 +655,8 @@ contract StakingNodeDelegation is StakingNodeTestBase {
660655

661656
// complete queued withdrawals
662657
{
663-
uint256[] memory middlewareTimesIndexes = new uint256[](calculatedWithdrawals.length);
664-
// all is zeroed out by default
665-
middlewareTimesIndexes[0] = 0;
666658
vm.prank(actors.admin.STAKING_NODES_DELEGATOR);
667-
stakingNodeInstance.completeQueuedWithdrawalsAsShares(calculatedWithdrawals, middlewareTimesIndexes);
659+
stakingNodeInstance.completeQueuedWithdrawalsAsShares(calculatedWithdrawals);
668660
}
669661

670662
uint256 finalQueuedShares = stakingNodeInstance.getQueuedSharesAmount();

test/integration/StakingNodeTestBase.sol

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,12 @@ contract StakingNodeTestBase is IntegrationBaseTest {
9595

9696
// complete queued withdrawals
9797
{
98-
uint256[] memory _middlewareTimesIndexes = new uint256[](_withdrawals.length);
99-
// all is zeroed out by defailt
100-
_middlewareTimesIndexes[0] = 0;
10198
IStakingNode _node = stakingNodesManager.nodes(nodeId);
10299
vm.startPrank(actors.ops.STAKING_NODES_WITHDRAWER);
103100
if (shouldExpectRevert) {
104101
vm.expectRevert();
105102
}
106-
_node.completeQueuedWithdrawals(_withdrawals, _middlewareTimesIndexes);
103+
_node.completeQueuedWithdrawals(_withdrawals);
107104
vm.stopPrank();
108105
}
109106
}
@@ -126,11 +123,8 @@ contract StakingNodeTestBase is IntegrationBaseTest {
126123

127124
// complete queued withdrawals
128125
{
129-
uint256[] memory _middlewareTimesIndexes = new uint256[](_withdrawals.length);
130-
// all is zeroed out by defailt
131-
_middlewareTimesIndexes[0] = 0;
132126
vm.startPrank(actors.admin.STAKING_NODES_DELEGATOR);
133-
stakingNodesManager.nodes(nodeId).completeQueuedWithdrawalsAsShares(_withdrawals, _middlewareTimesIndexes);
127+
stakingNodesManager.nodes(nodeId).completeQueuedWithdrawalsAsShares(_withdrawals);
134128
vm.stopPrank();
135129
}
136130
}

test/scenarios/fork/ynETH/Withdrawals.t.sol

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,8 @@ contract M3WithdrawalsTest is Base {
213213

214214
// complete queued withdrawals
215215
{
216-
uint256[] memory _middlewareTimesIndexes = new uint256[](1);
217-
_middlewareTimesIndexes[0] = 0;
218216
vm.startPrank(actors.ops.STAKING_NODES_WITHDRAWER);
219-
stakingNodesManager.nodes(nodeId).completeQueuedWithdrawals(_withdrawals, _middlewareTimesIndexes);
217+
stakingNodesManager.nodes(nodeId).completeQueuedWithdrawals(_withdrawals);
220218
vm.stopPrank();
221219

222220
// check that queuedSharesAmount is 0, and withdrawnETH is 32 ETH (AMOUNT), and staking pod balance is 32 ETH (AMOUNT)

test/scenarios/fork/ynETH/WithdrawalsScenarioTestBase.sol

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,8 @@ contract WithdrawalsScenarioTestBase is Base {
6262

6363
// complete queued withdrawals
6464
{
65-
uint256[] memory _middlewareTimesIndexes = new uint256[](_withdrawals.length);
66-
// all is zeroed out by defailt
67-
_middlewareTimesIndexes[0] = 0;
6865
vm.startPrank(actors.ops.STAKING_NODES_WITHDRAWER);
69-
stakingNodesManager.nodes(nodeId).completeQueuedWithdrawals(_withdrawals, _middlewareTimesIndexes);
66+
stakingNodesManager.nodes(nodeId).completeQueuedWithdrawals(_withdrawals);
7067
vm.stopPrank();
7168
}
7269
}
@@ -92,11 +89,8 @@ contract WithdrawalsScenarioTestBase is Base {
9289

9390
// complete queued withdrawals
9491
{
95-
uint256[] memory _middlewareTimesIndexes = new uint256[](_withdrawals.length);
96-
// all is zeroed out by defailt
97-
_middlewareTimesIndexes[0] = 0;
9892
vm.startPrank(actors.admin.STAKING_NODES_DELEGATOR);
99-
stakingNodesManager.nodes(nodeId).completeQueuedWithdrawalsAsShares(_withdrawals, _middlewareTimesIndexes);
93+
stakingNodesManager.nodes(nodeId).completeQueuedWithdrawalsAsShares(_withdrawals);
10094
vm.stopPrank();
10195
}
10296
}
@@ -127,12 +121,10 @@ contract WithdrawalsScenarioTestBase is Base {
127121

128122

129123
{
130-
uint256[] memory _middlewareTimesIndexes = new uint256[](_withdrawals.length);
131124
vm.prank(actors.ops.WITHDRAWAL_MANAGER);
132125
withdrawalsProcessor.completeAndProcessWithdrawalsForNode(
133126
withdrawalAction,
134-
_withdrawals,
135-
_middlewareTimesIndexes
127+
_withdrawals
136128
);
137129
}
138130
}

0 commit comments

Comments
 (0)