Skip to content

Commit c19480a

Browse files
authored
Merge pull request #879 from lidofinance/develop
SR 1.5
2 parents 836dc8e + 39caac3 commit c19480a

File tree

94 files changed

+8546
-2918
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+8546
-2918
lines changed

.github/workflows/tests-integration-scratch.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ jobs:
4141
- name: Run integration tests
4242
run: yarn test:integration:fork:local
4343
env:
44-
LOG_LEVEL: debug
44+
LOG_LEVEL: "debug"
45+
INTEGRATION_WITH_CSM: "off"

contracts/0.4.24/nos/NodeOperatorsRegistry.sol

+153-37
Large diffs are not rendered by default.

contracts/0.8.9/DepositSecurityModule.sol

+309-151
Large diffs are not rendered by default.

contracts/0.8.9/StakingRouter.sol

+550-364
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// SPDX-FileCopyrightText: 2024 Lido <[email protected]>
2+
// SPDX-License-Identifier: GPL-3.0
3+
4+
pragma solidity 0.8.9;
5+
6+
/// @title Second Opinion Oracle interface for Lido. See LIP-23 for details.
7+
interface ISecondOpinionOracle {
8+
/// @notice Returns second opinion report for the given reference slot
9+
/// @param refSlot is a reference slot to return report for
10+
/// @return success shows whether the report was successfully generated
11+
/// @return clBalanceGwei is a balance of the consensus layer in Gwei for the ref slot
12+
/// @return withdrawalVaultBalanceWei is a balance of the withdrawal vault in Wei for the ref slot
13+
/// @return totalDepositedValidators is a total number of validators deposited with Lido
14+
/// @return totalExitedValidators is a total number of Lido validators in the EXITED state
15+
function getReport(uint256 refSlot)
16+
external
17+
view
18+
returns (
19+
bool success,
20+
uint256 clBalanceGwei,
21+
uint256 withdrawalVaultBalanceWei,
22+
uint256 totalDepositedValidators,
23+
uint256 totalExitedValidators
24+
);
25+
}
26+

contracts/0.8.9/interfaces/IStakingModule.sol

+20-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface IStakingModule {
2323

2424
/// @notice Returns all-validators summary belonging to the node operator with the given id
2525
/// @param _nodeOperatorId id of the operator to return report for
26-
/// @return isTargetLimitActive shows whether the current target limit applied to the node operator
26+
/// @return targetLimitMode shows whether the current target limit applied to the node operator (0 = disabled, 1 = soft mode, 2 = forced mode)
2727
/// @return targetValidatorsCount relative target active validators limit for operator
2828
/// @return stuckValidatorsCount number of validators with an expired request to exit time
2929
/// @return refundedValidatorsCount number of validators that can't be withdrawn, but deposit
@@ -37,7 +37,7 @@ interface IStakingModule {
3737
/// EXITED state this counter is not decreasing
3838
/// @return depositableValidatorsCount number of validators in the set available for deposit
3939
function getNodeOperatorSummary(uint256 _nodeOperatorId) external view returns (
40-
bool isTargetLimitActive,
40+
uint256 targetLimitMode,
4141
uint256 targetValidatorsCount,
4242
uint256 stuckValidatorsCount,
4343
uint256 refundedValidatorsCount,
@@ -86,6 +86,14 @@ interface IStakingModule {
8686
/// Details about error data: https://docs.soliditylang.org/en/v0.8.9/control-structures.html#error-handling-assert-require-revert-and-exceptions
8787
function onRewardsMinted(uint256 _totalShares) external;
8888

89+
/// @notice Called by StakingRouter to decrease the number of vetted keys for node operator with given id
90+
/// @param _nodeOperatorIds bytes packed array of the node operators id
91+
/// @param _vettedSigningKeysCounts bytes packed array of the new number of vetted keys for the node operators
92+
function decreaseVettedSigningKeysCount(
93+
bytes calldata _nodeOperatorIds,
94+
bytes calldata _vettedSigningKeysCounts
95+
) external;
96+
8997
/// @notice Updates the number of the validators of the given node operator that were requested
9098
/// to exit but failed to do so in the max allowed time
9199
/// @param _nodeOperatorIds bytes packed array of the node operators id
@@ -97,10 +105,10 @@ interface IStakingModule {
97105

98106
/// @notice Updates the number of the validators in the EXITED state for node operator with given id
99107
/// @param _nodeOperatorIds bytes packed array of the node operators id
100-
/// @param _stuckValidatorsCounts bytes packed array of the new number of EXITED validators for the node operators
108+
/// @param _exitedValidatorsCounts bytes packed array of the new number of EXITED validators for the node operators
101109
function updateExitedValidatorsCount(
102110
bytes calldata _nodeOperatorIds,
103-
bytes calldata _stuckValidatorsCounts
111+
bytes calldata _exitedValidatorsCounts
104112
) external;
105113

106114
/// @notice Updates the number of the refunded validators for node operator with the given id
@@ -110,11 +118,11 @@ interface IStakingModule {
110118

111119
/// @notice Updates the limit of the validators that can be used for deposit
112120
/// @param _nodeOperatorId Id of the node operator
113-
/// @param _isTargetLimitActive Active flag
121+
/// @param _targetLimitMode target limit mode
114122
/// @param _targetLimit Target limit of the node operator
115123
function updateTargetValidatorsLimits(
116124
uint256 _nodeOperatorId,
117-
bool _isTargetLimitActive,
125+
uint256 _targetLimitMode,
118126
uint256 _targetLimit
119127
) external;
120128

@@ -163,4 +171,10 @@ interface IStakingModule {
163171

164172
/// @dev Event to be emitted on StakingModule's nonce change
165173
event NonceChanged(uint256 nonce);
174+
175+
/// @dev Event to be emitted when a signing key is added to the StakingModule
176+
event SigningKeyAdded(uint256 indexed nodeOperatorId, bytes pubkey);
177+
178+
/// @dev Event to be emitted when a signing key is removed from the StakingModule
179+
event SigningKeyRemoved(uint256 indexed nodeOperatorId, bytes pubkey);
166180
}

0 commit comments

Comments
 (0)