Skip to content

Commit 3ba2b34

Browse files
authored
chore: remove maxPods (#463)
* chore: remove maxPods * docs: update docs * refactor: set to private
1 parent 9ac0ef8 commit 3ba2b34

16 files changed

+7
-195
lines changed

certora/specs/pods/EigenPodManager.spec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ methods {
4646
function slasher() external returns (address) envfree;
4747
function hasPod(address podOwner) external returns (bool) envfree;
4848
function numPods() external returns (uint256) envfree;
49-
function maxPods() external returns (uint256) envfree;
5049
function podOwnerShares(address podOwner) external returns (int256) envfree;
5150
function beaconChainETHStrategy() external returns (address) envfree;
5251

docs/core/EigenPodManager.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -527,24 +527,9 @@ This method loops over up to `maxNumberOfDelayedWithdrawalsToClaim` withdrawals,
527527

528528
### System Configuration
529529

530-
* [`EigenPodManager.setMaxPods`](#eigenpodmanagersetmaxpods)
531530
* [`EigenPodManager.updateBeaconChainOracle`](#eigenpodmanagerupdatebeaconchainoracle)
532531
* [`DelayedWithdrawalRouter.setWithdrawalDelayBlocks`](#delayedwithdrawalroutersetwithdrawaldelayblocks)
533532

534-
#### `EigenPodManager.setMaxPods`
535-
536-
```solidity
537-
function setMaxPods(uint256 newMaxPods) external onlyUnpauser
538-
```
539-
540-
Allows the unpauser to update the maximum number of `EigenPods` that the `EigenPodManager` can create.
541-
542-
*Effects*:
543-
* Updates `EigenPodManager.maxPods`
544-
545-
*Requirements*:
546-
* Caller MUST be the unpauser
547-
548533
#### `EigenPodManager.updateBeaconChainOracle`
549534

550535
```solidity

script/deploy/mainnet/M2Deploy.s.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ contract M2Deploy is Script, Test {
6262
uint256 public withdrawalDelayBlocks;
6363
bytes32 public delegationManagerDomainSeparator;
6464
uint256 public numPods;
65-
uint256 public maxPods;
6665

6766
// Pointers to pre-upgrade values for lstDepositor
6867
address public lstDepositor;
@@ -122,7 +121,6 @@ contract M2Deploy is Script, Test {
122121
withdrawalDelayBlocks = m1StrategyManager(address(strategyManager)).withdrawalDelayBlocks();
123122
delegationManagerDomainSeparator = IDelegationManagerV0(address(delegation)).DOMAIN_SEPARATOR();
124123
numPods = eigenPodManager.numPods();
125-
maxPods = eigenPodManager.maxPods();
126124
delayedWithdrawalRouter = EigenPod(payable(eigenPodBeacon.implementation())).delayedWithdrawalRouter();
127125

128126
// Set chain-specific values
@@ -277,7 +275,7 @@ contract M2Deploy is Script, Test {
277275
// Call contracts to ensure that all simple view functions return the same values (e.g. the return value of `StrategyManager.delegation()` hasn’t changed)
278276
// StrategyManager: delegation, eigenPodManager, slasher, strategyWhitelister, withdrawalDelayBlocks all unchanged
279277
// DelegationManager: DOMAIN_SEPARATOR, strategyManager, slasher, eigenPodManager all unchanged
280-
// EigenPodManager: ethPOS, eigenPodBeacon, strategyManager, slasher, beaconChainOracle, numPods, maxPods all unchanged
278+
// EigenPodManager: ethPOS, eigenPodBeacon, strategyManager, slasher, beaconChainOracle, numPods all unchanged
281279
// delegationManager is now correct (added immutable)
282280
// Call contracts to make sure they are still “initialized” (ensure that trying to call initializer reverts)
283281
function _verifyStorageSlots() internal view {
@@ -311,7 +309,6 @@ contract M2Deploy is Script, Test {
311309
"eigenPodManager.beaconChainOracle incorrect"
312310
);
313311
require(eigenPodManager.numPods() == numPods, "eigenPodManager.numPods incorrect");
314-
require(eigenPodManager.maxPods() == maxPods, "eigenPodManager.maxPods incorrect");
315312
require(EigenPodManagerStorage(address(eigenPodManager)).delegationManager() == delegation, "eigenPodManager.delegationManager incorrect");
316313
}
317314

@@ -339,7 +336,6 @@ contract M2Deploy is Script, Test {
339336

340337
cheats.expectRevert(bytes("Initializable: contract is already initialized"));
341338
EigenPodManager(address(eigenPodManager)).initialize(
342-
0,
343339
IBeaconChainOracle(address(this)),
344340
address(this),
345341
PauserRegistry(address(this)),

script/utils/validateStorage/validateUpgrade.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ echo "Comparing storage layouts..."
6969
# Add -k operator if present
7070
if [ ! -k "$1" ]; then
7171
echo "Keeping old storage layout files"
72-
eval "npx ts-node script/upgrade/validateStorage.ts --old onChainLayout.csv --new localLayout.csv --keep"
72+
eval "npx ts-node script/utils/validateStorage/validateStorage.ts --old onChainLayout.csv --new localLayout.csv --keep"
7373
else
74-
eval "npx ts-node script/upgrade/validateStorage.ts --old onChainLayout.csv --new localLayout.csv"
74+
eval "npx ts-node script/utils/validateStorage/validateStorage.ts --old onChainLayout.csv --new localLayout.csv"
7575
fi

src/contracts/interfaces/IEigenPodManager.sol

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ interface IEigenPodManager is IPausable {
2626
/// @notice Emitted to notify a deposit of beacon chain ETH recorded in the strategy manager
2727
event BeaconChainETHDeposited(address indexed podOwner, uint256 amount);
2828

29-
/// @notice Emitted when `maxPods` value is updated from `previousValue` to `newValue`
30-
event MaxPodsUpdated(uint256 previousValue, uint256 newValue);
31-
3229
/// @notice Emitted when the balance of an EigenPod is updated
3330
event PodSharesUpdated(address indexed podOwner, int256 sharesDelta);
3431

@@ -107,9 +104,6 @@ interface IEigenPodManager is IPausable {
107104
/// @notice Returns the number of EigenPods that have been created
108105
function numPods() external view returns (uint256);
109106

110-
/// @notice Returns the maximum number of EigenPods that can be created
111-
function maxPods() external view returns (uint256);
112-
113107
/**
114108
* @notice Mapping from Pod owner owner to the number of shares they have in the virtual beacon chain ETH strategy.
115109
* @dev The share amount can become negative. This is necessary to accommodate the fact that a pod owner's virtual beacon chain ETH shares can

src/contracts/pods/EigenPodManager.sol

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,11 @@ contract EigenPodManager is
5555
}
5656

5757
function initialize(
58-
uint256 _maxPods,
5958
IBeaconChainOracle _beaconChainOracle,
6059
address initialOwner,
6160
IPauserRegistry _pauserRegistry,
6261
uint256 _initPausedStatus
6362
) external initializer {
64-
_setMaxPods(_maxPods);
6563
_updateBeaconChainOracle(_beaconChainOracle);
6664
_transferOwnership(initialOwner);
6765
_initializePauser(_pauserRegistry, _initPausedStatus);
@@ -223,15 +221,6 @@ contract EigenPodManager is
223221
ownerToPod[podOwner].withdrawRestakedBeaconChainETH(destination, shares);
224222
}
225223

226-
/**
227-
* Sets the maximum number of pods that can be deployed
228-
* @param newMaxPods The new maximum number of pods that can be deployed
229-
* @dev Callable by the unpauser of this contract
230-
*/
231-
function setMaxPods(uint256 newMaxPods) external onlyUnpauser {
232-
_setMaxPods(newMaxPods);
233-
}
234-
235224
/**
236225
* @notice Updates the oracle contract that provides the beacon chain state root
237226
* @param newBeaconChainOracle is the new oracle contract being pointed to
@@ -256,8 +245,6 @@ contract EigenPodManager is
256245
// INTERNAL FUNCTIONS
257246

258247
function _deployPod() internal returns (IEigenPod) {
259-
// check that the limit of EigenPods has not been hit, and increment the EigenPod count
260-
require(numPods + 1 <= maxPods, "EigenPodManager._deployPod: pod limit reached");
261248
++numPods;
262249
// create the pod
263250
IEigenPod pod = IEigenPod(
@@ -281,12 +268,6 @@ contract EigenPodManager is
281268
emit BeaconOracleUpdated(address(newBeaconChainOracle));
282269
}
283270

284-
/// @notice Internal setter for `maxPods` that also emits an event
285-
function _setMaxPods(uint256 _maxPods) internal {
286-
emit MaxPodsUpdated(maxPods, _maxPods);
287-
maxPods = _maxPods;
288-
}
289-
290271
/**
291272
* @notice Calculates the change in a pod owner's delegateable shares as a result of their beacon chain ETH shares changing
292273
* from `sharesBefore` to `sharesAfter`. The key concept here is that negative/"deficit" shares are not delegateable.

src/contracts/pods/EigenPodManagerStorage.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ abstract contract EigenPodManagerStorage is IEigenPodManager {
5050
/// @notice The number of EigenPods that have been deployed
5151
uint256 public numPods;
5252

53-
/// @notice The maximum number of EigenPods that can be deployed
54-
uint256 public maxPods;
53+
/// @notice Deprecated from old mainnet release. Was initially used to limit growth early on but there is no longer
54+
/// a maximum number of EigenPods that can be deployed.
55+
uint256 private __deprecated_maxPods;
5556

5657
// BEGIN STORAGE VARIABLES ADDED AFTER MAINNET DEPLOYMENT -- DO NOT SUGGEST REORDERING TO CONVENTIONAL ORDER
5758
/**

src/test/DepositWithdraw.t.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,6 @@ contract DepositWithdrawTests is EigenLayerTestHelper {
416416
address(eigenPodManagerImplementation),
417417
abi.encodeWithSelector(
418418
EigenPodManager.initialize.selector,
419-
type(uint256).max,
420419
beaconChainOracleAddress,
421420
eigenLayerReputedMultisig,
422421
eigenLayerPauserReg,

src/test/EigenLayerDeployer.t.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ contract EigenLayerDeployer is Operators {
303303
address(eigenPodManagerImplementation),
304304
abi.encodeWithSelector(
305305
EigenPodManager.initialize.selector,
306-
type(uint256).max, // maxPods
307306
beaconChainOracleAddress,
308307
eigenLayerReputedMultisig,
309308
eigenLayerPauserReg,

src/test/EigenPod.t.sol

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ contract EigenPodTests is ProofParsing, EigenPodPausingConstants {
7676
/// @notice Emitted to notify a deposit of beacon chain ETH recorded in the strategy manager
7777
event BeaconChainETHDeposited(address indexed podOwner, uint256 amount);
7878

79-
/// @notice Emitted when `maxPods` value is updated from `previousValue` to `newValue`
80-
event MaxPodsUpdated(uint256 previousValue, uint256 newValue);
81-
8279
// EIGENPOD EVENTS
8380
/// @notice Emitted when an ETH validator stakes via this eigenPod
8481
event EigenPodStaked(bytes pubkey);
@@ -238,7 +235,6 @@ contract EigenPodTests is ProofParsing, EigenPodPausingConstants {
238235
address(eigenPodManagerImplementation),
239236
abi.encodeWithSelector(
240237
EigenPodManager.initialize.selector,
241-
type(uint256).max, // maxPods
242238
beaconChainOracle,
243239
initialOwner,
244240
pauserReg,
@@ -1334,37 +1330,6 @@ contract EigenPodTests is ProofParsing, EigenPodPausingConstants {
13341330
require(numPodsAfter == numPodsBefore + 1, "numPods did not increment correctly");
13351331
}
13361332

1337-
// verifies that the `maxPods` variable is enforced on the `EigenPod.stake` function
1338-
function test_maxPodsEnforcementOnStake(
1339-
bytes calldata _pubkey,
1340-
bytes calldata _signature,
1341-
bytes32 _depositDataRoot
1342-
) public {
1343-
// set pod limit to current number of pods
1344-
cheats.startPrank(unpauser);
1345-
EigenPodManager(address(eigenPodManager)).setMaxPods(EigenPodManager(address(eigenPodManager)).numPods());
1346-
cheats.stopPrank();
1347-
1348-
cheats.startPrank(podOwner);
1349-
cheats.expectRevert("EigenPodManager._deployPod: pod limit reached");
1350-
eigenPodManager.stake{value: 32 ether}(_pubkey, _signature, _depositDataRoot);
1351-
cheats.stopPrank();
1352-
1353-
// set pod limit to *one more than* current number of pods
1354-
cheats.startPrank(unpauser);
1355-
EigenPodManager(address(eigenPodManager)).setMaxPods(EigenPodManager(address(eigenPodManager)).numPods() + 1);
1356-
cheats.stopPrank();
1357-
1358-
IEigenPod newPod = eigenPodManager.getPod(podOwner);
1359-
1360-
cheats.startPrank(podOwner);
1361-
// successful call
1362-
cheats.expectEmit(true, true, true, true, address(newPod));
1363-
emit EigenPodStaked(_pubkey);
1364-
eigenPodManager.stake{value: 32 ether}(_pubkey, _signature, _depositDataRoot);
1365-
cheats.stopPrank();
1366-
}
1367-
13681333
// verifies that the `numPod` variable increments correctly on a succesful call to the `EigenPod.createPod` function
13691334
function test_incrementNumPodsOnCreatePod() public {
13701335
uint256 numPodsBefore = EigenPodManager(address(eigenPodManager)).numPods();
@@ -1379,53 +1344,6 @@ contract EigenPodTests is ProofParsing, EigenPodPausingConstants {
13791344
eigenPodManager.createPod();
13801345
}
13811346

1382-
// verifies that the `maxPods` variable is enforced on the `EigenPod.createPod` function
1383-
function test_maxPodsEnforcementOnCreatePod() public {
1384-
// set pod limit to current number of pods
1385-
cheats.startPrank(unpauser);
1386-
uint256 previousValue = EigenPodManager(address(eigenPodManager)).maxPods();
1387-
uint256 newValue = EigenPodManager(address(eigenPodManager)).numPods();
1388-
cheats.expectEmit(true, true, true, true, address(eigenPodManager));
1389-
emit MaxPodsUpdated(previousValue, newValue);
1390-
EigenPodManager(address(eigenPodManager)).setMaxPods(newValue);
1391-
cheats.stopPrank();
1392-
1393-
cheats.expectRevert("EigenPodManager._deployPod: pod limit reached");
1394-
eigenPodManager.createPod();
1395-
1396-
// set pod limit to *one more than* current number of pods
1397-
cheats.startPrank(unpauser);
1398-
previousValue = EigenPodManager(address(eigenPodManager)).maxPods();
1399-
newValue = EigenPodManager(address(eigenPodManager)).numPods() + 1;
1400-
cheats.expectEmit(true, true, true, true, address(eigenPodManager));
1401-
emit MaxPodsUpdated(previousValue, newValue);
1402-
EigenPodManager(address(eigenPodManager)).setMaxPods(newValue);
1403-
cheats.stopPrank();
1404-
1405-
// successful call
1406-
eigenPodManager.createPod();
1407-
}
1408-
1409-
function test_setMaxPods(uint256 newValue) public {
1410-
cheats.startPrank(unpauser);
1411-
uint256 previousValue = EigenPodManager(address(eigenPodManager)).maxPods();
1412-
cheats.expectEmit(true, true, true, true, address(eigenPodManager));
1413-
emit MaxPodsUpdated(previousValue, newValue);
1414-
EigenPodManager(address(eigenPodManager)).setMaxPods(newValue);
1415-
cheats.stopPrank();
1416-
1417-
require(EigenPodManager(address(eigenPodManager)).maxPods() == newValue, "maxPods value not set correctly");
1418-
}
1419-
1420-
function test_setMaxPods_RevertsWhenNotCalledByUnpauser(address notUnpauser) public fuzzedAddress(notUnpauser) {
1421-
cheats.assume(notUnpauser != unpauser);
1422-
uint256 newValue = 0;
1423-
cheats.startPrank(notUnpauser);
1424-
cheats.expectRevert("msg.sender is not permissioned as unpauser");
1425-
EigenPodManager(address(eigenPodManager)).setMaxPods(newValue);
1426-
cheats.stopPrank();
1427-
}
1428-
14291347
function test_validatorPubkeyToInfo() external {
14301348
bytes memory _pubkey = hex"93a0dd04ccddf3f1b419fdebf99481a2182c17d67cf14d32d6e50fc4bf8effc8db4a04b7c2f3a5975c1b9b74e2841888";
14311349

0 commit comments

Comments
 (0)