Skip to content

Commit

Permalink
Merge pull request #860 from lidofinance/feat/sr-1.5
Browse files Browse the repository at this point in the history
feat: Staking Router 1.5
  • Loading branch information
krogla authored Nov 26, 2024
2 parents f3a4a14 + 957fd2f commit 39caac3
Show file tree
Hide file tree
Showing 80 changed files with 6,867 additions and 2,742 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: 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);
}
31 changes: 0 additions & 31 deletions contracts/0.8.9/lib/SafeCastExt.sol

This file was deleted.

Loading

0 comments on commit 39caac3

Please sign in to comment.