@@ -40,6 +40,8 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
4040 bool isUpgraded;
4141 uint mainnetForkBlock = 21_616_692 ; // Post Protocol Council upgrade
4242
43+ string version = "v9.9.9 " ;
44+
4345 // Beacon chain genesis time when running locally
4446 // Multiple of 12 for sanity's sake
4547 uint64 constant GENESIS_TIME_LOCAL = 1 hours * 12 ;
@@ -160,10 +162,8 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
160162 }
161163
162164 /// Deploy EigenLayer locally
163- function _setUpLocal () public virtual {
165+ function _setUpLocal () public noTracing virtual {
164166 console.log ("Setting up `%s` integration tests: " , "LOCAL " .yellow ().bold ());
165- // Bypass upgrade tests when running locally
166- isUpgraded = true ;
167167
168168 // Deploy ProxyAdmin
169169 eigenLayerProxyAdmin = new ProxyAdmin ();
@@ -204,6 +204,7 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
204204 ethStrats.push (BEACONCHAIN_ETH_STRAT);
205205 allStrats.push (BEACONCHAIN_ETH_STRAT);
206206 allTokens.push (NATIVE_ETH);
207+ maxUniqueAssetsHeld = allStrats.length ;
207208
208209 // Create time machine and beacon chain. Set block time to beacon chain genesis time
209210 BEACON_GENESIS_TIME = GENESIS_TIME_LOCAL;
@@ -213,7 +214,7 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
213214 }
214215
215216 /// Parse existing contracts from mainnet
216- function _setUpMainnet () public virtual {
217+ function _setUpMainnet () public noTracing virtual {
217218 console.log ("Setting up `%s` integration tests: " , "MAINNET_FORK " .green ().bold ());
218219 console.log ("RPC: " , cheats.rpcUrl ("mainnet " ));
219220 console.log ("Block: " , mainnetForkBlock);
@@ -239,13 +240,20 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
239240 allTokens.push (strategy.underlyingToken ());
240241 }
241242
243+ maxUniqueAssetsHeld = allStrats.length ;
244+
242245 // Create time machine and mock beacon chain
243246 BEACON_GENESIS_TIME = GENESIS_TIME_MAINNET;
244247 timeMachine = new TimeMachine ();
245248 beaconChain = new BeaconChainMock (eigenPodManager, BEACON_GENESIS_TIME);
249+
250+ // Since we haven't done the slashing upgrade on mainnet yet, upgrade mainnet contracts
251+ // prior to test. `isUpgraded` is true by default, but is set to false in `UpgradeTest.t.sol`
252+ if (isUpgraded) {
253+ _upgradeMainnetContracts ();
254+ }
246255 }
247256
248- /// Deploy current implementation contracts and upgrade existing proxies
249257 function _upgradeMainnetContracts () public virtual {
250258 cheats.startPrank (address (executorMultisig));
251259
@@ -277,6 +285,7 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
277285 ethStrats.push (BEACONCHAIN_ETH_STRAT);
278286 allStrats.push (BEACONCHAIN_ETH_STRAT);
279287 allTokens.push (NATIVE_ETH);
288+ maxUniqueAssetsHeld = allStrats.length ;
280289 }
281290
282291 function _deployProxies () public {
@@ -310,10 +319,25 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
310319
311320 /// Deploy an implementation contract for each contract in the system
312321 function _deployImplementations () public {
313- allocationManagerImplementation = new AllocationManager (delegationManager, eigenLayerPauserReg, permissionController, DEALLOCATION_DELAY, ALLOCATION_CONFIGURATION_DELAY);
314- permissionControllerImplementation = new PermissionController ();
315- delegationManagerImplementation = new DelegationManager (strategyManager, eigenPodManager, allocationManager, eigenLayerPauserReg, permissionController, DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS);
316- strategyManagerImplementation = new StrategyManager (delegationManager, eigenLayerPauserReg);
322+ allocationManagerImplementation = new AllocationManager (
323+ delegationManager,
324+ eigenLayerPauserReg,
325+ permissionController,
326+ DEALLOCATION_DELAY,
327+ ALLOCATION_CONFIGURATION_DELAY,
328+ version
329+ );
330+ permissionControllerImplementation = new PermissionController (version);
331+ delegationManagerImplementation = new DelegationManager (
332+ strategyManager,
333+ eigenPodManager,
334+ allocationManager,
335+ eigenLayerPauserReg,
336+ permissionController,
337+ DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS,
338+ version
339+ );
340+ strategyManagerImplementation = new StrategyManager (delegationManager, eigenLayerPauserReg, version);
317341 rewardsCoordinatorImplementation = new RewardsCoordinator (
318342 IRewardsCoordinatorTypes.RewardsCoordinatorConstructorParams ({
319343 delegationManager: delegationManager,
@@ -337,17 +361,17 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
337361 eigenLayerPauserReg,
338362 "v9.9.9 "
339363 );
340- strategyFactoryImplementation = new StrategyFactory (strategyManager, eigenLayerPauserReg);
364+ strategyFactoryImplementation = new StrategyFactory (strategyManager, eigenLayerPauserReg, " v9.9.9 " );
341365
342366 // Beacon implementations
343- eigenPodImplementation = new EigenPod (DEPOSIT_CONTRACT, eigenPodManager, BEACON_GENESIS_TIME);
344- baseStrategyImplementation = new StrategyBase (strategyManager, eigenLayerPauserReg);
367+ eigenPodImplementation = new EigenPod (DEPOSIT_CONTRACT, eigenPodManager, BEACON_GENESIS_TIME, " v9.9.9 " );
368+ baseStrategyImplementation = new StrategyBase (strategyManager, eigenLayerPauserReg, " v9.9.9 " );
345369
346370 // Pre-longtail StrategyBaseTVLLimits implementation
347371 // TODO - need to update ExistingDeploymentParser
348372 }
349373
350- function _upgradeProxies () public {
374+ function _upgradeProxies () public noTracing {
351375 // DelegationManager
352376 eigenLayerProxyAdmin.upgrade (
353377 ITransparentUpgradeableProxy (payable (address (delegationManager))),
@@ -412,7 +436,7 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
412436 }
413437 }
414438
415- function _initializeProxies () public {
439+ function _initializeProxies () public noTracing {
416440 delegationManager.initialize ({
417441 initialOwner: executorMultisig,
418442 initialPausedStatus: 0
@@ -486,7 +510,7 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
486510 allTokens.push (underlyingToken);
487511 }
488512
489- function _configRand (uint24 _randomSeed , uint _assetTypes , uint _userTypes ) private {
513+ function _configRand (uint24 _randomSeed , uint _assetTypes , uint _userTypes ) private noTracing {
490514 // Using uint24 for the seed type so that if a test fails, it's easier
491515 // to manually use the seed to replay the same test.
492516 random = _hash (_randomSeed);
@@ -496,6 +520,25 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
496520 _configUserTypes (_userTypes);
497521 }
498522
523+ function _configAssetTypes (uint _assetTypes ) internal {
524+ assetTypes = _bitmapToBytes (_assetTypes);
525+ assertTrue (assetTypes.length != 0 , "_configRand: no asset types selected " );
526+ }
527+
528+ function _configAssetAmounts (uint _maxUniqueAssetsHeld ) internal {
529+ if (_maxUniqueAssetsHeld > allStrats.length ) {
530+ _maxUniqueAssetsHeld = allStrats.length ;
531+ }
532+
533+ maxUniqueAssetsHeld = _maxUniqueAssetsHeld;
534+ require (maxUniqueAssetsHeld != 0 , "_configAssetAmounts: invalid 0 " );
535+ }
536+
537+ function _configUserTypes (uint _userTypes ) internal {
538+ userTypes = _bitmapToBytes (_userTypes);
539+ assertTrue (userTypes.length != 0 , "_configRand: no user types selected " );
540+ }
541+
499542 /**
500543 * @dev Create a new User with a random config using the range defined in `_configRand`
501544 *
@@ -795,4 +838,4 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
795838 ) internal pure returns (bytes32 ) {
796839 return keccak256 (abi.encodePacked (x));
797840 }
798- }
841+ }
0 commit comments