From fa3b2b2010a3889e604467a3a304dad8b4b1241a Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 28 Jun 2023 11:03:34 +0200 Subject: [PATCH 1/3] deploy stage --- .openzeppelin/goerli.json | 138 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) diff --git a/.openzeppelin/goerli.json b/.openzeppelin/goerli.json index db382a63..2ee784f8 100644 --- a/.openzeppelin/goerli.json +++ b/.openzeppelin/goerli.json @@ -120,6 +120,16 @@ "address": "0xAE2C84c48272F5a1746150ef333D5E5B51F68763", "txHash": "0x7aa677a741c4b779346c8b179b0f3f47007dd94d90c7073b47a826ba969b86a5", "kind": "uups" + }, + { + "address": "0xd6b633304Db2DD59ce93753FA55076DA367e5b2c", + "txHash": "0x48e42568ba5cea62bddf9f00d348623677ed38fb083acd760f830f454f290500", + "kind": "uups" + }, + { + "address": "0xcDc4423E9ffa9542d4CdDf42a70859C84859d2A9", + "txHash": "0x964e728e77bd4afa121c93bfd55076c36a5de0b764214dbb9ee574fa1976a9ad", + "kind": "uups" } ], "impls": { @@ -6642,6 +6652,134 @@ } } } + }, + "4520774aa64c18c9ddf1ef74c95a2ccf9bb21a0078a21ea1067552fdbd846048": { + "address": "0x74C82BD3F46Ab4F2A98635eaEa1f84E1BA5BE98c", + "txHash": "0x8d83beee85106b30f181eaa1abe432a4d75230e10965422d43bb8678f2cbdba9", + "layout": { + "solcVersion": "0.8.18", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "151", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "152", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_pendingOwner", + "offset": 0, + "slot": "201", + "type": "t_address", + "contract": "Ownable2StepUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol:27" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "Ownable2StepUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol:70" + }, + { + "label": "ssvNetwork", + "offset": 0, + "slot": "251", + "type": "t_contract(ISSVViews)4181", + "contract": "SSVNetworkViews", + "src": "contracts/SSVNetworkViews.sol:19" + }, + { + "label": "private__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)50_storage", + "contract": "SSVNetworkViews", + "src": "contracts/SSVNetworkViews.sol:23" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(ISSVViews)4181": { + "label": "contract ISSVViews", + "numberOfBytes": "20" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } From ad40e9527c981225fa6144c02d1a535d7b11d537 Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 2 Aug 2023 15:16:08 +0200 Subject: [PATCH 2/3] upgrade stage ValidatorsPerOperatorLimit --- .openzeppelin/goerli.json | 108 ++++++++++++++++++ .../stage/SSVNetworkValidatorsPerOperator.sol | 12 ++ 2 files changed, 120 insertions(+) create mode 100644 contracts/upgrades/stage/SSVNetworkValidatorsPerOperator.sol diff --git a/.openzeppelin/goerli.json b/.openzeppelin/goerli.json index 2ee784f8..80a1047a 100644 --- a/.openzeppelin/goerli.json +++ b/.openzeppelin/goerli.json @@ -6780,6 +6780,114 @@ } } } + }, + "3f9800ada4d2a9cecd5dbe695c48130fa7bc0dcdc84b9b238164a16c6a2802fe": { + "address": "0xEcd38CFb1c04C73AEa71350c742dD2A6613861C8", + "txHash": "0x6926c384301d3c540df529e49f0e253be4e178eaba77e9b46d99bc717b990313", + "layout": { + "solcVersion": "0.8.18", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "151", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "152", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_pendingOwner", + "offset": 0, + "slot": "201", + "type": "t_address", + "contract": "Ownable2StepUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol:27" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "Ownable2StepUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol:70" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/contracts/upgrades/stage/SSVNetworkValidatorsPerOperator.sol b/contracts/upgrades/stage/SSVNetworkValidatorsPerOperator.sol new file mode 100644 index 00000000..f0cec467 --- /dev/null +++ b/contracts/upgrades/stage/SSVNetworkValidatorsPerOperator.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.18; + +import "../../SSVNetwork.sol"; + + +contract SSVNetworkValidatorsPerOperator is SSVNetwork { + + function initializev2(uint32 validatorsPerOperatorLimit_) external reinitializer(_getInitializedVersion() + 1) { + SSVStorageProtocol.load().validatorsPerOperatorLimit = validatorsPerOperatorLimit_; + } +} From 5819f808f724e98246773548b7670404e322ffc3 Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 2 Aug 2023 15:26:42 +0200 Subject: [PATCH 3/3] change file name --- contracts/test/SSVNetworkValidatorsPerOperator.sol | 2 +- test/validators/register.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/test/SSVNetworkValidatorsPerOperator.sol b/contracts/test/SSVNetworkValidatorsPerOperator.sol index 52dbb9fc..9ed5b696 100644 --- a/contracts/test/SSVNetworkValidatorsPerOperator.sol +++ b/contracts/test/SSVNetworkValidatorsPerOperator.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.18; import "../SSVNetwork.sol"; -contract SSVNetworkValidatorsPerOperator is SSVNetwork { +contract SSVNetworkValidatorsPerOperatorUpgrade is SSVNetwork { function initializev2(uint32 validatorsPerOperatorLimit_) external reinitializer(_getInitializedVersion() + 1) { SSVStorageProtocol.load().validatorsPerOperatorLimit = validatorsPerOperatorLimit_; diff --git a/test/validators/register.ts b/test/validators/register.ts index 83a151e8..894f19cd 100644 --- a/test/validators/register.ts +++ b/test/validators/register.ts @@ -759,7 +759,7 @@ describe('Register Validator Tests', () => { it('Surpassing max number of validators per operator reverts "ExceedValidatorLimit"', async () => { await helpers.registerValidatorsRaw(2, 50, minDepositAmount, [8, 9, 10, 11]); - const SSVNetworkValidatorsPerOperator = await ethers.getContractFactory("SSVNetworkValidatorsPerOperator"); + const SSVNetworkValidatorsPerOperator = await ethers.getContractFactory("SSVNetworkValidatorsPerOperatorUpgrade"); const ssvNetwork = await upgrades.upgradeProxy(ssvNetworkContract.address, SSVNetworkValidatorsPerOperator, { kind: 'uups', call: {