Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 37 additions & 19 deletions src/test/integration/IntegrationDeployer.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -281,32 +281,50 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
// First, deploy the new contracts as empty contracts
emptyContract = new EmptyContract();
// Deploy new implementation contracts and upgrade all proxies to point to them
_deployProxies(); // deploy proxies (if undeployed)
_deployImplementations();
_upgradeProxies();
cheats.stopPrank();
}

function _deployProxies() public {
delegationManager =
DelegationManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
strategyManager =
StrategyManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
eigenPodManager =
EigenPodManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
rewardsCoordinator =
RewardsCoordinator(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
avsDirectory = AVSDirectory(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
strategyFactory =
StrategyFactory(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
allocationManager =
AllocationManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
permissionController =
PermissionController(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
eigenPodBeacon = new UpgradeableBeacon(address(emptyContract));
strategyBeacon = new UpgradeableBeacon(address(emptyContract));

if (address(delegationManager) == address(0)) {
delegationManager =
DelegationManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
}
if (address(strategyManager) == address(0)) {
strategyManager =
StrategyManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
}
if (address(eigenPodManager) == address(0)) {
eigenPodManager =
EigenPodManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
}
if (address(rewardsCoordinator) == address(0)) {
rewardsCoordinator =
RewardsCoordinator(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
}
if (address(avsDirectory) == address(0)) {
avsDirectory = AVSDirectory(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
}
if (address(strategyFactory) == address(0)) {
strategyFactory =
StrategyFactory(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
}
if (address(allocationManager) == address(0)) {
allocationManager =
AllocationManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
}
if (address(permissionController) == address(0)) {
permissionController =
PermissionController(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
}
if (address(eigenPodBeacon) == address(0)) eigenPodBeacon = new UpgradeableBeacon(address(emptyContract));
if (address(strategyBeacon) == address(0)) strategyBeacon = new UpgradeableBeacon(address(emptyContract));
// multichain
keyRegistrar = KeyRegistrar(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
if (address(keyRegistrar) == address(0)) {
keyRegistrar = KeyRegistrar(address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")));
}
}

/// Deploy an implementation contract for each contract in the system
Expand Down
4 changes: 3 additions & 1 deletion src/test/unit/BN254CertificateVerifierUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ contract BN254CertificateVerifierUnitTests is
_createOperatorsWithSplitKeys(123, numOperators, 0);
BN254OperatorSetInfo memory operatorSetInfo = _createOperatorSetInfo(operatorInfos);
vm.prank(address(operatorTableUpdaterMock));
verifier.updateOperatorTable(defaultOperatorSet, uint32(block.timestamp), operatorSetInfo, defaultOperatorSetConfig);
referenceTimestamp = uint32(block.timestamp);
verifier.updateOperatorTable(defaultOperatorSet, referenceTimestamp, operatorSetInfo, defaultOperatorSetConfig);
return referenceTimestamp;
}
}

Expand Down
10 changes: 6 additions & 4 deletions src/test/unit/OperatorTableUpdaterUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ contract OperatorTableUpdaterUnitTests is
"1.0.0"
);

_setLatestReferenceTimestampBN254(generator, uint32(block.timestamp - 1));

eigenLayerProxyAdmin.upgradeAndCall(
ITransparentUpgradeableProxy(payable(address(operatorTableUpdater))),
address(operatorTableUpdaterImplementation),
Expand All @@ -66,6 +68,10 @@ contract OperatorTableUpdaterUnitTests is
);
}

function _setLatestReferenceTimestampBN254(OperatorSet memory operatorSet, uint32 referenceTimestamp) internal {
bn254CertificateVerifierMock.setLatestReferenceTimestamp(operatorSet, referenceTimestamp);
}

/// @dev Sets a valid certificate for the BN254 certificate verifier
function _setIsValidCertificate(BN254Certificate memory certificate, bool isValid) internal {
bn254CertificateVerifierMock.setIsValidCertificate(certificate, isValid);
Expand Down Expand Up @@ -289,10 +295,6 @@ contract OperatorTableUpdaterUnitTests_confirmGlobalTableRoot is OperatorTableUp
}

contract OperatorTableUpdaterUnitTests_updateOperatorTable_BN254 is OperatorTableUpdaterUnitTests {
function _setLatestReferenceTimestampBN254(OperatorSet memory operatorSet, uint32 referenceTimestamp) internal {
bn254CertificateVerifierMock.setLatestReferenceTimestamp(operatorSet, referenceTimestamp);
}

function testFuzz_BN254_revert_paused(Randomness r) public rand(r) {
// Pause the updateOperatorTable functionality (bit index 1)
uint pausedStatus = 1 << 1; // Set bit 1 to pause PAUSED_OPERATOR_TABLE_UPDATE
Expand Down