Skip to content

Commit 090df60

Browse files
feat: remove semver + minor optimizations (#1654)
**Motivation:** We want to reduce codesize throughout our core contracts. **Modifications:** - Removed `SemVerMixin` from every contract that doesn't inherit `SignatureUtilsMixin`. - Added non-revert `checkCanCall` function `PermissionController` for space savings **Result:** ~300 bytes of codesize saved per contract. --------- Co-authored-by: Yash Patil <[email protected]>
1 parent 82a9ddd commit 090df60

File tree

67 files changed

+167
-1994
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+167
-1994
lines changed

foundry.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
]
5656
# An array of file paths from which warnings should be ignored during compilation.
5757
ignored_warnings_from = [
58-
"src/test"
58+
"src/test",
59+
"src/contracts/core/AllocationManager.sol" # TODO: Remove
5960
]
6061

6162
# Test Configuration

script/deploy/devnet/deploy_from_scratch.s.sol

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ contract DeployFromScratch is Script, Test {
224224
if (chainId == 1) ethPOSDeposit = IETHPOSDeposit(0x00000000219ab540356cBB839Cbe05303d7705Fa);
225225
// if not on mainnet, deploy a mock
226226
else ethPOSDeposit = IETHPOSDeposit(stdJson.readAddress(config_data, ".ethPOSDepositAddress"));
227-
eigenPodImplementation = new EigenPod(ethPOSDeposit, eigenPodManager, SEMVER);
227+
eigenPodImplementation = new EigenPod(ethPOSDeposit, eigenPodManager);
228228

229229
eigenPodBeacon = new UpgradeableBeacon(address(eigenPodImplementation));
230230

@@ -244,7 +244,7 @@ contract DeployFromScratch is Script, Test {
244244
new StrategyManager(IAllocationManager(address(allocationManager)), delegation, eigenLayerPauserReg, SEMVER);
245245
avsDirectoryImplementation = new AVSDirectory(delegation, eigenLayerPauserReg, SEMVER);
246246
eigenPodManagerImplementation =
247-
new EigenPodManager(ethPOSDeposit, eigenPodBeacon, delegation, eigenLayerPauserReg, SEMVER);
247+
new EigenPodManager(ethPOSDeposit, eigenPodBeacon, delegation, eigenLayerPauserReg);
248248
rewardsCoordinatorImplementation = new RewardsCoordinator(
249249
IRewardsCoordinatorTypes.RewardsCoordinatorConstructorParams(
250250
delegation,
@@ -256,8 +256,7 @@ contract DeployFromScratch is Script, Test {
256256
REWARDS_COORDINATOR_MAX_REWARDS_DURATION,
257257
REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH,
258258
REWARDS_COORDINATOR_MAX_FUTURE_LENGTH,
259-
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP,
260-
SEMVER
259+
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP
261260
)
262261
);
263262
allocationManagerImplementation = new AllocationManager(
@@ -267,11 +266,11 @@ contract DeployFromScratch is Script, Test {
267266
eigenLayerPauserReg,
268267
permissionController,
269268
DEALLOCATION_DELAY,
270-
ALLOCATION_CONFIGURATION_DELAY,
271-
SEMVER
269+
ALLOCATION_CONFIGURATION_DELAY
272270
);
273-
permissionControllerImplementation = new PermissionController(SEMVER);
274-
strategyFactoryImplementation = new StrategyFactory(strategyManager, eigenLayerPauserReg, SEMVER);
271+
272+
permissionControllerImplementation = new PermissionController();
273+
strategyFactoryImplementation = new StrategyFactory(strategyManager, eigenLayerPauserReg);
275274

276275
// Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them.
277276
{
@@ -333,7 +332,7 @@ contract DeployFromScratch is Script, Test {
333332

334333
// Deploy strategyFactory & base
335334
// Create base strategy implementation
336-
baseStrategyImplementation = new StrategyBase(strategyManager, eigenLayerPauserReg, SEMVER);
335+
baseStrategyImplementation = new StrategyBase(strategyManager, eigenLayerPauserReg);
337336

338337
// Create a proxy beacon for base strategy implementation
339338
strategyBeacon = new UpgradeableBeacon(address(baseStrategyImplementation));

script/deploy/local/deploy_from_scratch.slashing.s.sol

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ contract DeployFromScratch is Script, Test {
228228
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
229229
);
230230

231-
eigenStrategy = IStrategy(new EigenStrategy(strategyManager, eigenLayerPauserReg, SEMVER));
231+
eigenStrategy = IStrategy(new EigenStrategy(strategyManager, eigenLayerPauserReg));
232232

233233
// if on mainnet, use the ETH2 deposit contract address
234234
if (chainId == 1) ethPOSDeposit = IETHPOSDeposit(0x00000000219ab540356cBB839Cbe05303d7705Fa);
235235
// if not on mainnet, deploy a mock
236236
else ethPOSDeposit = IETHPOSDeposit(stdJson.readAddress(config_data, ".ethPOSDepositAddress"));
237-
eigenPodImplementation = new EigenPod(ethPOSDeposit, eigenPodManager, SEMVER);
237+
eigenPodImplementation = new EigenPod(ethPOSDeposit, eigenPodManager);
238238

239239
eigenPodBeacon = new UpgradeableBeacon(address(eigenPodImplementation));
240240

@@ -253,7 +253,7 @@ contract DeployFromScratch is Script, Test {
253253
new StrategyManager(IAllocationManager(address(allocationManager)), delegation, eigenLayerPauserReg, SEMVER);
254254
avsDirectoryImplementation = new AVSDirectory(delegation, eigenLayerPauserReg, SEMVER);
255255
eigenPodManagerImplementation =
256-
new EigenPodManager(ethPOSDeposit, eigenPodBeacon, delegation, eigenLayerPauserReg, SEMVER);
256+
new EigenPodManager(ethPOSDeposit, eigenPodBeacon, delegation, eigenLayerPauserReg);
257257
rewardsCoordinatorImplementation = new RewardsCoordinator(
258258
IRewardsCoordinatorTypes.RewardsCoordinatorConstructorParams(
259259
delegation,
@@ -265,8 +265,7 @@ contract DeployFromScratch is Script, Test {
265265
REWARDS_COORDINATOR_MAX_REWARDS_DURATION,
266266
REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH,
267267
REWARDS_COORDINATOR_MAX_FUTURE_LENGTH,
268-
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP,
269-
SEMVER
268+
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP
270269
)
271270
);
272271
allocationManagerImplementation = new AllocationManager(
@@ -276,10 +275,10 @@ contract DeployFromScratch is Script, Test {
276275
eigenLayerPauserReg,
277276
permissionController,
278277
DEALLOCATION_DELAY,
279-
ALLOCATION_CONFIGURATION_DELAY,
280-
SEMVER
278+
ALLOCATION_CONFIGURATION_DELAY
281279
);
282-
permissionControllerImplementation = new PermissionController(SEMVER);
280+
281+
permissionControllerImplementation = new PermissionController();
283282

284283
// Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them.
285284
{
@@ -347,7 +346,7 @@ contract DeployFromScratch is Script, Test {
347346
);
348347

349348
// deploy StrategyBaseTVLLimits contract implementation
350-
baseStrategyImplementation = new StrategyBaseTVLLimits(strategyManager, eigenLayerPauserReg, SEMVER);
349+
baseStrategyImplementation = new StrategyBaseTVLLimits(strategyManager, eigenLayerPauserReg);
351350
// create upgradeable proxies that each point to the implementation and initialize them
352351
for (uint256 i = 0; i < strategyConfigs.length; ++i) {
353352
if (strategyConfigs[i].tokenAddress == address(0)) {

script/releases/v1.7.0-v1.8.0-multichain-hourglass-combined/1-deploySourceChain.s.sol

Lines changed: 0 additions & 270 deletions
This file was deleted.

0 commit comments

Comments
 (0)