8000 refactor: remove deprecated refunded validators count functionality by eddort · Pull Request #1174 · lidofinance/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: remove deprecated refunded validators count functionality #1174

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

Merged
merged 1 commit into from
Jun 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 2 additions & 18 deletions contracts/0.8.9/StakingRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -364,22 +364,6 @@ contract StakingRouter is AccessControlEnumerable, BeaconChainDepositor, Version
);
}

/// @notice Updates the number of the refunded validators in the staking module with the given
/// node operator id.
/// @param _stakingModuleId Id of the staking module.
/// @param _nodeOperatorId Id of the node operator.
/// @param _refundedValidatorsCount New number of refunded validators of the node operator.
/// @dev The function is restricted to the `STAKING_MODULE_MANAGE_ROLE` role.
function updateRefundedValidatorsCount(
uint256 _stakingModuleId,
uint256 _nodeOperatorId,
uint256 _refundedValidatorsCount
) external onlyRole(STAKING_MODULE_MANAGE_ROLE) {
_getIStakingModuleById(_stakingModuleId).updateRefundedValidatorsCount(
_nodeOperatorId, _refundedValidatorsCount
);
}

/// @notice Reports the minted rewards to the staking modules with the specified ids.
/// @param _stakingModuleIds Ids of the staking modules.
/// @param _totalShares Total shares minted for the staking modules.
Expand Down Expand Up @@ -767,6 +751,7 @@ contract StakingRouter is AccessControlEnumerable, BeaconChainDepositor, Version

/// @notice The number of validators that can't be withdrawn, but deposit costs were
/// compensated to the Lido by the node operator.
/// @dev [deprecated] Refunded validators processing has been removed, this field is no longer used.
uint256 refundedValidatorsCount;

/// @notice A time when the penalty for stuck validators stops applying to node operator rewards.
Expand Down Expand Up @@ -819,15 +804,14 @@ contract StakingRouter is AccessControlEnumerable, BeaconChainDepositor, Version
uint256 targetLimitMode,
uint256 targetValidatorsCount,
/* uint256 stuckValidatorsCount */,
uint256 refundedValidatorsCount,
/* uint256 refundedValidatorsCount */,
/* uint256 stuckPenaltyEndTimestamp */,
uint256 totalExitedValidators,
uint256 totalDepositedValidators,
uint256 depositableValidatorsCount
) = stakingModule.getNodeOperatorSummary(_nodeOperatorId);
summary.targetLimitMode = targetLimitMode;
summary.targetValidatorsCount = targetValidatorsCount;
summary.refundedValidatorsCount = refundedValidatorsCount;
summary.totalExitedValidators = totalExitedValidators;
summary.totalDepositedValidators = totalDepositedValidators;
summary.depositableValidatorsCount = depositableValidatorsCount;
Expand Down
5 changes: 0 additions & 5 deletions contracts/0.8.9/interfaces/IStakingModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,6 @@ interface IStakingModule {
bytes calldata _exitedValidatorsCounts
) external;

/// @notice Updates the number of the refunded validators for node operator with the given id
/// @param _nodeOperatorId Id of the node operator
/// @param _refundedValidatorsCount New number of refunded validators of the node operator
function updateRefundedValidatorsCount(uint256 _nodeOperatorId, uint256 _refundedValidatorsCount) external;

/// @notice Updates the limit of the validators that can be used for deposit
/// @param _nodeOperatorId Id of the node operator
/// @param _targetLimitMode target limit mode
Expand Down
4 changes: 0 additions & 4 deletions test/0.8.9/contracts/StakingModule__MockForStakingRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,6 @@ contract StakingModule__MockForStakingRouter is IStakingModule {
emit Mock__ExitedValidatorsCountUpdated(_nodeOperatorIds, _stuckValidatorsCounts);
}

function updateRefundedValidatorsCount(uint256 _nodeOperatorId, uint256 _refundedValidatorsCount) external {
emit Mock__RefundedValidatorsCountUpdated(_nodeOperatorId, _refundedValidatorsCount);
}

function updateTargetValidatorsLimits(
uint256 _nodeOperatorId,
uint256 _targetLimitMode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ contract StakingModule__MockForTriggerableWithdrawals is IStakingModule {
return;
}

function updateRefundedValidatorsCount(uint256, uint256) external pure override {
return;
}

function updateExitedValidatorsCount(bytes calldata, bytes calldata) external pure override {
return;
}
Expand Down
21 changes: 1 addition & 20 deletions test/0.8.9/stakingRouter/stakingRouter.module-sync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe("StakingRouter.sol:module-sync", () => {
1, // targetLimitMode
100n, // targetValidatorsCount
0n, // stuckValidatorsCount
5n, // refundedValidatorsCount
0n, // refundedValidatorsCount
0n, // stuckPenaltyEndTimestamp
50, // totalExitedValidators
1000n, // totalDepositedValidators
Expand Down Expand Up @@ -364,25 +364,6 @@ describe("StakingRouter.sol:module-sync", () => {
});
});

context("updateRefundedValidatorsCount", () => {
const NODE_OPERATOR_ID = 0n;
const REFUNDED_VALIDATORS_COUNT = 10n;

it("Reverts if the caller does not have the role", async () => {
await expect(
stakingRouter
.connect(user)
.updateRefundedValidatorsCount(moduleId, NODE_OPERATOR_ID, REFUNDED_VALIDATORS_COUNT),
).to.be.revertedWithOZAccessControlError(user.address, await stakingRouter.STAKING_MODULE_MANAGE_ROLE());
});

it("Redirects the call to the staking module", async () => {
await expect(stakingRouter.updateRefundedValidatorsCount(moduleId, NODE_OPERATOR_ID, REFUNDED_VALIDATORS_COUNT))
.to.emit(stakingModule, "Mock__RefundedValidatorsCountUpdated")
.withArgs(NODE_OPERATOR_ID, REFUNDED_VALIDATORS_COUNT);
});
});

context("reportRewardsMinted", () => {
it("Reverts if the caller does not have the role", async () => {
await expect(
Expand Down
Loading
0