Skip to content

Commit

Permalink
bulk register: revert when empty public keys list
Browse files Browse the repository at this point in the history
  • Loading branch information
mtabasco committed Apr 12, 2024
1 parent 1e41ffe commit 7b61d4f
Show file tree
Hide file tree
Showing 5 changed files with 182 additions and 110 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Unreleased]

### [v1.1.1] 2024-04-12

## [Released]

### [v1.1.0] 2024-01-08
- [c80dc3b](https://github.com/bloxapp/ssv-network/commit/c80dc3b) - [Feature] Bulk exit of validators.
- [6431a00](https://github.com/bloxapp/ssv-network/commit/6431a00) - [Feature] Bulk removal of validators.
Expand All @@ -15,8 +19,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- [7564dfe](https://github.com/bloxapp/ssv-network/commit/7564dfe) - [Feature] Integration ssv-keys in ssv-network for generating keyshares.
- [8647401](https://github.com/bloxapp/ssv-network/commit/8647401) - [Update]: Configuration for publishing npm package.

## [Released]

### [v1.0.2] 2023-11-08
- [8f5df42](https://github.com/bloxapp/ssv-network/commit/8f5df42633d2b92c6bb70253a41e6afa80b9f111) - Change ValidatorExited signature: owner indexed.

Expand Down
1 change: 1 addition & 0 deletions contracts/interfaces/ISSVNetworkCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ interface ISSVNetworkCore {
error PublicKeysSharesLengthMismatch(); // 0x9ad467b8
error IncorrectValidatorStateWithData(bytes publicKey); // 0x89307938

Check failure on line 90 in contracts/interfaces/ISSVNetworkCore.sol

View workflow job for this annotation

GitHub Actions / ci

Expected indentation of 4 spaces but found 42
error ValidatorAlreadyExistsWithData(bytes publicKey); // 0x388e7999

Check failure on line 91 in contracts/interfaces/ISSVNetworkCore.sol

View workflow job for this annotation

GitHub Actions / ci

Expected indentation of 4 spaces but found 41
error EmptyPublicKeysList(); // df83e679

// legacy errors
error ValidatorAlreadyExists(); // 0x8d09a73e
Expand Down
7 changes: 4 additions & 3 deletions contracts/modules/SSVClusters.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ contract SSVClusters is ISSVClusters {
uint256 amount,
Cluster memory cluster
) external override {
if (publicKeys.length != sharesData.length) revert PublicKeysSharesLengthMismatch();
uint256 validatorsLength = publicKeys.length;

if (validatorsLength == 0) revert EmptyPublicKeysList();
if (validatorsLength != sharesData.length) revert PublicKeysSharesLengthMismatch();

StorageData storage s = SSVStorage.load();
StorageProtocol storage sp = SSVStorageProtocol.load();

uint256 validatorsLength = publicKeys.length;

ValidatorLib.validateOperatorsLength(operatorIds);

for (uint i; i < validatorsLength; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ssv-network",
"version": "1.0.2",
"version": "1.1.1",
"description": "Solidity smart contracts for the SSV Network",
"author": "SSV.Network",
"repository": {
Expand Down
Loading

0 comments on commit 7b61d4f

Please sign in to comment.