Skip to content

Commit

Permalink
sync with main
Browse files Browse the repository at this point in the history
  • Loading branch information
mtabasco committed Apr 16, 2024
2 parents f17d5dc + 3c12e52 commit d7d6c32
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [Unreleased]

### [v1.1.1] 2024-04-12
- [Update] Update project dependencies.
- [7b61d4f](https://github.com/bloxapp/ssv-network/commit/7b61d4f) - [Fix] Revert when passing an empty public keys list.

## [Released]

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
error ValidatorAlreadyExistsWithData(bytes publicKey); // 0x388e7999
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 test/helpers/gas-usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const MAX_GAS_PER_GROUP: any = {
[GasGroup.REDUCE_OPERATOR_FEE]: 51900,

[GasGroup.REGISTER_VALIDATOR_EXISTING_CLUSTER]: 202000,
[GasGroup.REGISTER_VALIDATOR_NEW_STATE]: 235500,
[GasGroup.REGISTER_VALIDATOR_NEW_STATE]: 236000,
[GasGroup.REGISTER_VALIDATOR_WITHOUT_DEPOSIT]: 180600,

[GasGroup.BULK_REGISTER_10_VALIDATOR_NEW_STATE_4]: 835500,
Expand Down

0 comments on commit d7d6c32

Please sign in to comment.