Skip to content

Commit

Permalink
Merge pull request #879 from lidofinance/develop
Browse files Browse the repository at this point in the history
SR 1.5
  • Loading branch information
TheDZhon authored Nov 27, 2024
2 parents 836dc8e + 39caac3 commit c19480a
Show file tree
Hide file tree
Showing 94 changed files with 8,546 additions and 2,918 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/tests-integration-scratch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ jobs:
- name: Run integration tests
run: yarn test:integration:fork:local
env:
LOG_LEVEL: debug
LOG_LEVEL: "debug"
INTEGRATION_WITH_CSM: "off"
190 changes: 153 additions & 37 deletions contracts/0.4.24/nos/NodeOperatorsRegistry.sol

Large diffs are not rendered by default.

460 changes: 309 additions & 151 deletions contracts/0.8.9/DepositSecurityModule.sol

Large diffs are not rendered by default.

914 changes: 550 additions & 364 deletions contracts/0.8.9/StakingRouter.sol

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions contracts/0.8.9/interfaces/ISecondOpinionOracle.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-FileCopyrightText: 2024 Lido <[email protected]>
// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.8.9;

/// @title Second Opinion Oracle interface for Lido. See LIP-23 for details.
interface ISecondOpinionOracle {
/// @notice Returns second opinion report for the given reference slot
/// @param refSlot is a reference slot to return report for
/// @return success shows whether the report was successfully generated
/// @return clBalanceGwei is a balance of the consensus layer in Gwei for the ref slot
/// @return withdrawalVaultBalanceWei is a balance of the withdrawal vault in Wei for the ref slot
/// @return totalDepositedValidators is a total number of validators deposited with Lido
/// @return totalExitedValidators is a total number of Lido validators in the EXITED state
function getReport(uint256 refSlot)
external
view
returns (
bool success,
uint256 clBalanceGwei,
uint256 withdrawalVaultBalanceWei,
uint256 totalDepositedValidators,
uint256 totalExitedValidators
);
}

26 changes: 20 additions & 6 deletions contracts/0.8.9/interfaces/IStakingModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface IStakingModule {

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

/// @notice Called by StakingRouter to decrease the number of vetted keys for node operator with given id
/// @param _nodeOperatorIds bytes packed array of the node operators id
/// @param _vettedSigningKeysCounts bytes packed array of the new number of vetted keys for the node operators
function decreaseVettedSigningKeysCount(
bytes calldata _nodeOperatorIds,
bytes calldata _vettedSigningKeysCounts
) external;

/// @notice Updates the number of the validators of the given node operator that were requested
/// to exit but failed to do so in the max allowed time
/// @param _nodeOperatorIds bytes packed array of the node operators id
Expand All @@ -97,10 +105,10 @@ interface IStakingModule {

/// @notice Updates the number of the validators in the EXITED state for node operator with given id
/// @param _nodeOperatorIds bytes packed array of the node operators id
/// @param _stuckValidatorsCounts bytes packed array of the new number of EXITED validators for the node operators
/// @param _exitedValidatorsCounts bytes packed array of the new number of EXITED validators for the node operators
function updateExitedValidatorsCount(
bytes calldata _nodeOperatorIds,
bytes calldata _stuckValidatorsCounts
bytes calldata _exitedValidatorsCounts
) external;

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

/// @notice Updates the limit of the validators that can be used for deposit
/// @param _nodeOperatorId Id of the node operator
/// @param _isTargetLimitActive Active flag
/// @param _targetLimitMode target limit mode
/// @param _targetLimit Target limit of the node operator
function updateTargetValidatorsLimits(
uint256 _nodeOperatorId,
bool _isTargetLimitActive,
uint256 _targetLimitMode,
uint256 _targetLimit
) external;

Expand Down Expand Up @@ -163,4 +171,10 @@ interface IStakingModule {

/// @dev Event to be emitted on StakingModule's nonce change
event NonceChanged(uint256 nonce);

/// @dev Event to be emitted when a signing key is added to the StakingModule
event SigningKeyAdded(uint256 indexed nodeOperatorId, bytes pubkey);

/// @dev Event to be emitted when a signing key is removed from the StakingModule
event SigningKeyRemoved(uint256 indexed nodeOperatorId, bytes pubkey);
}
Loading

0 comments on commit c19480a

Please sign in to comment.