Skip to content

Commit d17a568

Browse files
committed
squash
squash feat: split alm wip wip wip wip wip wip wip unit tests passing remove extsload wip tests passing chore: git mv storage to folder wip ci docs todo cleanup ci ci rename `secondHalf` rm extsload move storage add protocol registry to zeus squash feat: split alm wip wip wip wip wip wip wip unit tests passing remove extsload wip tests passing chore: git mv storage to folder wip ci wip wip wip wip wip remove extsload wip tests passing wip passing perf: wrap modifier logic to save codesize chore: forge fmt refactor: remove semver (#1641) **Motivation:** We want to consolidate semver logic into a single purpose built contract. **Modifications:** - Removed `SemVerMixin` import from all contracts. **Result:** More codesize savings. make fmt refactor: expand `ProtocolRegistry` to list all contracts + pause rm gas snapshots rm extsload rebase
1 parent 82a9ddd commit d17a568

File tree

59 files changed

+176
-316
lines changed

Some content is hidden

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

59 files changed

+176
-316
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: 14 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,12 @@ 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+
allocationManagerViewImplementation =
272+
new AllocationManagerView(delegation, eigenStrategy, DEALLOCATION_DELAY, ALLOCATION_CONFIGURATION_DELAY);
273+
permissionControllerImplementation = new PermissionController();
274+
strategyFactoryImplementation = new StrategyFactory(strategyManager, eigenLayerPauserReg);
275275

276276
// Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them.
277277
{
@@ -326,14 +326,19 @@ contract DeployFromScratch is Script, Test {
326326
)
327327
);
328328

329+
eigenLayerProxyAdmin.upgrade(
330+
ITransparentUpgradeableProxy(payable(address(allocationManagerView))),
331+
address(allocationManagerViewImplementation)
332+
);
333+
329334
eigenLayerProxyAdmin.upgrade(
330335
ITransparentUpgradeableProxy(payable(address(permissionController))),
331336
address(permissionControllerImplementation)
332337
);
333338

334339
// Deploy strategyFactory & base
335340
// Create base strategy implementation
336-
baseStrategyImplementation = new StrategyBase(strategyManager, eigenLayerPauserReg, SEMVER);
341+
baseStrategyImplementation = new StrategyBase(strategyManager, eigenLayerPauserReg);
337342

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

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

Lines changed: 14 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,11 @@ 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+
allocationManagerViewImplementation =
281+
new AllocationManagerView(delegation, eigenStrategy, DEALLOCATION_DELAY, ALLOCATION_CONFIGURATION_DELAY);
282+
permissionControllerImplementation = new PermissionController();
283283

284284
// Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them.
285285
{
@@ -341,13 +341,18 @@ contract DeployFromScratch is Script, Test {
341341
)
342342
);
343343

344+
eigenLayerProxyAdmin.upgrade(
345+
ITransparentUpgradeableProxy(payable(address(allocationManagerView))),
346+
address(allocationManagerViewImplementation)
347+
);
348+
344349
eigenLayerProxyAdmin.upgrade(
345350
ITransparentUpgradeableProxy(payable(address(permissionController))),
346351
address(permissionControllerImplementation)
347352
);
348353

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

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ contract DeploySourceChain is EOADeployer {
5151
_allocationManager: IAllocationManager(address(Env.proxy.allocationManager())),
5252
_keyRegistrar: Env.proxy.keyRegistrar(),
5353
_permissionController: Env.proxy.permissionController(),
54-
_pauserRegistry: Env.impl.pauserRegistry(),
55-
_version: Env.deployVersion()
54+
_pauserRegistry: Env.impl.pauserRegistry()
5655
})
5756
)
5857
});
@@ -80,7 +79,7 @@ contract DeploySourceChain is EOADeployer {
8079
deployImpl({
8180
name: type(ReleaseManager).name,
8281
deployedTo: address(
83-
new ReleaseManager({_permissionController: Env.proxy.permissionController(), _version: Env.deployVersion()})
82+
new ReleaseManager({_permissionController: Env.proxy.permissionController()})
8483
)
8584
});
8685

@@ -180,7 +179,6 @@ contract DeploySourceChain is EOADeployer {
180179
address(crossChainRegistry.pauserRegistry()) == address(Env.impl.pauserRegistry()),
181180
"ccr.pauserRegistry invalid"
182181
);
183-
assertEq(crossChainRegistry.version(), Env.deployVersion(), "ccr.version failed");
184182
}
185183

186184
{
@@ -190,7 +188,6 @@ contract DeploySourceChain is EOADeployer {
190188
releaseManager.permissionController() == Env.proxy.permissionController(),
191189
"rm.permissionController invalid"
192190
);
193-
assertEq(releaseManager.version(), Env.deployVersion(), "rm.version failed");
194191
}
195192
}
196193

@@ -216,7 +213,6 @@ contract DeploySourceChain is EOADeployer {
216213
);
217214

218215
CrossChainRegistry crossChainRegistry = Env.proxy.crossChainRegistry();
219-
assertEq(crossChainRegistry.version(), Env.deployVersion(), "crossChainRegistry version mismatch");
220216
assertTrue(
221217
crossChainRegistry.allocationManager() == Env.proxy.allocationManager(),
222218
"crossChainRegistry allocationManager mismatch"
@@ -234,7 +230,6 @@ contract DeploySourceChain is EOADeployer {
234230
);
235231

236232
ReleaseManager releaseManager = Env.proxy.releaseManager();
237-
assertEq(releaseManager.version(), Env.deployVersion(), "releaseManager version mismatch");
238233
assertTrue(
239234
releaseManager.permissionController() == Env.proxy.permissionController(),
240235
"releaseManager permissionController mismatch"

script/releases/v1.7.0-v1.8.0-multichain-hourglass-combined/3-deployDestinationChainImpls.s.sol

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ contract DeployDestinationChainImpls is EOADeployer, DeployDestinationChainProxi
3636
new OperatorTableUpdater({
3737
_bn254CertificateVerifier: Env.proxy.bn254CertificateVerifier(),
3838
_ecdsaCertificateVerifier: Env.proxy.ecdsaCertificateVerifier(),
39-
_pauserRegistry: Env.impl.pauserRegistry(),
40-
_version: Env.deployVersion()
39+
_pauserRegistry: Env.impl.pauserRegistry()
4140
})
4241
)
4342
});
@@ -56,12 +55,7 @@ contract DeployDestinationChainImpls is EOADeployer, DeployDestinationChainProxi
5655
// BN254CertificateVerifier
5756
deployImpl({
5857
name: type(BN254CertificateVerifier).name,
59-
deployedTo: address(
60-
new BN254CertificateVerifier({
61-
_operatorTableUpdater: Env.proxy.operatorTableUpdater(),
62-
_version: Env.deployVersion()
63-
})
64-
)
58+
deployedTo: address(new BN254CertificateVerifier({_operatorTableUpdater: Env.proxy.operatorTableUpdater()}))
6559
});
6660

6761
// TaskMailbox
@@ -72,8 +66,7 @@ contract DeployDestinationChainImpls is EOADeployer, DeployDestinationChainProxi
7266
new TaskMailbox({
7367
_bn254CertificateVerifier: address(Env.proxy.bn254CertificateVerifier()),
7468
_ecdsaCertificateVerifier: address(Env.proxy.ecdsaCertificateVerifier()),
75-
_maxTaskSLA: Env.MAX_TASK_SLA(),
76-
_version: Env.deployVersion()
69+
_maxTaskSLA: Env.MAX_TASK_SLA()
7770
})
7871
)
7972
});
@@ -121,7 +114,6 @@ contract DeployDestinationChainImpls is EOADeployer, DeployDestinationChainProxi
121114
== address(Env.proxy.ecdsaCertificateVerifier()),
122115
"out.ecdsaCertificateVerifier invalid"
123116
);
124-
assertEq(operatorTableUpdater.version(), Env.deployVersion(), "out.version failed");
125117
}
126118

127119
{
@@ -141,7 +133,6 @@ contract DeployDestinationChainImpls is EOADeployer, DeployDestinationChainProxi
141133
address(bn254CertificateVerifier.operatorTableUpdater()) == address(Env.proxy.operatorTableUpdater()),
142134
"b254cv.operatorTableUpdater invalid"
143135
);
144-
assertEq(bn254CertificateVerifier.version(), Env.deployVersion(), "b254cv.version failed");
145136
}
146137

147138
{
@@ -156,7 +147,6 @@ contract DeployDestinationChainImpls is EOADeployer, DeployDestinationChainProxi
156147
"tm.ecdsaCertificateVerifier invalid"
157148
);
158149
assertEq(taskMailbox.MAX_TASK_SLA(), Env.MAX_TASK_SLA(), "tm.maxTaskSLA failed");
159-
assertEq(taskMailbox.version(), Env.deployVersion(), "tm.version failed");
160150
}
161151
}
162152

@@ -191,12 +181,5 @@ contract DeployDestinationChainImpls is EOADeployer, DeployDestinationChainProxi
191181
// ECDSACertificateVerifier and BN254CertificateVerifier don't have initialize functions
192182
}
193183

194-
function _validateVersion() internal view {
195-
string memory expected = Env.deployVersion();
196-
197-
assertEq(Env.impl.operatorTableUpdater().version(), expected, "operatorTableUpdater version mismatch");
198-
assertEq(Env.impl.ecdsaCertificateVerifier().version(), expected, "ecdsaCertificateVerifier version mismatch");
199-
assertEq(Env.impl.bn254CertificateVerifier().version(), expected, "bn254CertificateVerifier version mismatch");
200-
assertEq(Env.impl.taskMailbox().version(), expected, "taskMailbox version mismatch");
201-
}
184+
function _validateVersion() internal view {}
202185
}

script/releases/v1.7.0-v1.8.0-multichain-hourglass-combined/4-instantiateDestinationChainProxies.s.sol

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ contract InstantiateDestinationChainProxies is DeployDestinationChainImpls {
283283
/// OperatorTableUpdater
284284
{
285285
OperatorTableUpdater operatorTableUpdater = Env.proxy.operatorTableUpdater();
286-
assertEq(operatorTableUpdater.version(), Env.deployVersion(), "operatorTableUpdater version mismatch");
287286
assertTrue(
288287
operatorTableUpdater.bn254CertificateVerifier() == Env.proxy.bn254CertificateVerifier(),
289288
"out.bn254CertificateVerifier mismatch"
@@ -309,9 +308,6 @@ contract InstantiateDestinationChainProxies is DeployDestinationChainImpls {
309308
/// BN254CertificateVerifier
310309
{
311310
BN254CertificateVerifier bn254CertificateVerifier = Env.proxy.bn254CertificateVerifier();
312-
assertEq(
313-
bn254CertificateVerifier.version(), Env.deployVersion(), "bn254CertificateVerifier version mismatch"
314-
);
315311
assertTrue(
316312
bn254CertificateVerifier.operatorTableUpdater() == Env.proxy.operatorTableUpdater(),
317313
"bn254CertificateVerifier operatorTableUpdater mismatch"
@@ -321,7 +317,6 @@ contract InstantiateDestinationChainProxies is DeployDestinationChainImpls {
321317
/// TaskMailbox
322318
{
323319
TaskMailbox taskMailbox = Env.proxy.taskMailbox();
324-
assertEq(taskMailbox.version(), Env.deployVersion(), "taskMailbox version mismatch");
325320
assertTrue(
326321
taskMailbox.BN254_CERTIFICATE_VERIFIER() == address(Env.proxy.bn254CertificateVerifier()),
327322
"taskMailbox.BN254_CERTIFICATE_VERIFIER mismatch"

script/releases/v1.8.1-hourglass-testnet-replay-fix/1-deployTaskMailboxImpl.s.sol

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ contract DeployTaskMailboxImpl is EOADeployer {
2929
new TaskMailbox({
3030
_bn254CertificateVerifier: address(Env.proxy.bn254CertificateVerifier()),
3131
_ecdsaCertificateVerifier: address(Env.proxy.ecdsaCertificateVerifier()),
32-
_maxTaskSLA: Env.MAX_TASK_SLA(),
33-
_version: Env.deployVersion()
32+
_maxTaskSLA: Env.MAX_TASK_SLA()
3433
})
3534
)
3635
});
@@ -72,13 +71,6 @@ contract DeployTaskMailboxImpl is EOADeployer {
7271
function _validateImplConstructor() internal view {
7372
TaskMailbox taskMailboxImpl = Env.impl.taskMailbox();
7473

75-
// Validate version
76-
assertEq(
77-
keccak256(bytes(taskMailboxImpl.version())),
78-
keccak256(bytes(Env.deployVersion())),
79-
"TaskMailbox impl version mismatch"
80-
);
81-
8274
// Validate certificate verifiers
8375
assertTrue(
8476
taskMailboxImpl.BN254_CERTIFICATE_VERIFIER() == address(Env.proxy.bn254CertificateVerifier()),
@@ -108,11 +100,5 @@ contract DeployTaskMailboxImpl is EOADeployer {
108100
}
109101

110102
/// @dev Validate the version is correctly set
111-
function _validateVersion() internal view {
112-
assertEq(
113-
keccak256(bytes(Env.impl.taskMailbox().version())),
114-
keccak256(bytes(Env.deployVersion())),
115-
"TaskMailbox version should match deploy version"
116-
);
117-
}
103+
function _validateVersion() internal view {}
118104
}

script/releases/v1.8.1-hourglass-testnet-replay-fix/3-executeTaskMailboxUpgrade.s.sol

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,6 @@ contract ExecuteTaskMailboxUpgrade is QueueTaskMailboxUpgrade {
8686
function _validateProxyConstructor() internal view {
8787
TaskMailbox taskMailbox = Env.proxy.taskMailbox();
8888

89-
// Validate version
90-
assertEq(
91-
keccak256(bytes(taskMailbox.version())),
92-
keccak256(bytes(Env.deployVersion())),
93-
"TaskMailbox version mismatch"
94-
);
95-
9689
// Validate certificate verifiers
9790
assertTrue(
9891
taskMailbox.BN254_CERTIFICATE_VERIFIER() == address(Env.proxy.bn254CertificateVerifier()),

script/utils/ExistingDeploymentParser.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ contract ExistingDeploymentParser is Script, Logger {
222222
eigenLayerPauserReg = PauserRegistry(json.readAddress(".addresses.eigenLayerPauserReg"));
223223

224224
// FIXME: hotfix - remove later...
225-
permissionControllerImplementation = new PermissionController(SEMVER);
225+
permissionControllerImplementation = new PermissionController();
226226
permissionController = PermissionController(
227227
address(
228228
new TransparentUpgradeableProxy(

src/contracts/avs/task/TaskMailbox.sol

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,14 @@ import {IBaseCertificateVerifier} from "../../interfaces/IBaseCertificateVerifie
1919
import {IKeyRegistrarTypes} from "../../interfaces/IKeyRegistrar.sol";
2020
import {ITaskMailbox} from "../../interfaces/ITaskMailbox.sol";
2121
import {OperatorSet} from "../../libraries/OperatorSetLib.sol";
22-
import {SemVerMixin} from "../../mixins/SemVerMixin.sol";
2322
import {TaskMailboxStorage} from "./TaskMailboxStorage.sol";
2423

2524
/**
2625
* @title TaskMailbox
2726
* @author Layr Labs, Inc.
2827
* @notice Contract for managing the lifecycle of tasks that are executed by operator sets of task-based AVSs.
2928
*/
30-
contract TaskMailbox is
31-
Initializable,
32-
OwnableUpgradeable,
33-
ReentrancyGuardUpgradeable,
34-
TaskMailboxStorage,
35-
SemVerMixin
36-
{
29+
contract TaskMailbox is Initializable, OwnableUpgradeable, ReentrancyGuardUpgradeable, TaskMailboxStorage {
3730
using SafeERC20 for IERC20;
3831
using SafeCast for *;
3932

@@ -42,14 +35,12 @@ contract TaskMailbox is
4235
* @param _bn254CertificateVerifier Address of the BN254 certificate verifier
4336
* @param _ecdsaCertificateVerifier Address of the ECDSA certificate verifier
4437
* @param _maxTaskSLA Maximum task SLA in seconds
45-
* @param _version The semantic version of the contract
4638
*/
4739
constructor(
4840
address _bn254CertificateVerifier,
4941
address _ecdsaCertificateVerifier,
50-
uint96 _maxTaskSLA,
51-
string memory _version
52-
) TaskMailboxStorage(_bn254CertificateVerifier, _ecdsaCertificateVerifier, _maxTaskSLA) SemVerMixin(_version) {
42+
uint96 _maxTaskSLA
43+
) TaskMailboxStorage(_bn254CertificateVerifier, _ecdsaCertificateVerifier, _maxTaskSLA) {
5344
_disableInitializers();
5445
}
5546

0 commit comments

Comments
 (0)