Skip to content

Commit 74438b7

Browse files
authored
build: update core submodule to new release (#298)
* build: update core submodule to new release * fix: flakey tests from pepe upgrade
1 parent a9c1aa7 commit 74438b7

File tree

7 files changed

+26
-71
lines changed

7 files changed

+26
-71
lines changed

lib/eigenlayer-contracts

test/integration/IntegrationDeployer.t.sol

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@ import "eigenlayer-contracts/src/contracts/core/RewardsCoordinator.sol";
2020
import "eigenlayer-contracts/src/contracts/strategies/StrategyBase.sol";
2121
import "eigenlayer-contracts/src/contracts/pods/EigenPodManager.sol";
2222
import "eigenlayer-contracts/src/contracts/pods/EigenPod.sol";
23-
import "eigenlayer-contracts/src/contracts/pods/DelayedWithdrawalRouter.sol";
2423
import "eigenlayer-contracts/src/contracts/permissions/PauserRegistry.sol";
2524
import "eigenlayer-contracts/src/test/mocks/ETHDepositMock.sol";
26-
// import "eigenlayer-contracts/src/test/integration/mocks/BeaconChainOracleMock.t.sol";
27-
import "test/integration/mocks/BeaconChainOracleMock.t.sol";
2825

2926
// Middleware contracts
3027
import "src/RegistryCoordinator.sol";
@@ -57,9 +54,7 @@ abstract contract IntegrationDeployer is Test, IUserDeployer {
5754
Slasher slasher;
5855
IBeacon eigenPodBeacon;
5956
EigenPod pod;
60-
DelayedWithdrawalRouter delayedWithdrawalRouter;
6157
ETHPOSDepositMock ethPOSDeposit;
62-
BeaconChainOracleMock beaconChainOracle;
6358

6459
// Base strategy implementation in case we want to create more strategies later
6560
StrategyBase baseStrategyImplementation;
@@ -92,7 +87,7 @@ abstract contract IntegrationDeployer is Test, IUserDeployer {
9287
address rewardsUpdater = address(uint160(uint256(keccak256("rewardsUpdater"))));
9388

9489
// Constants/Defaults
95-
uint64 constant MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR = 32e9;
90+
uint64 constant GENESIS_TIME_LOCAL = 1 hours * 12;
9691
uint256 constant MIN_BALANCE = 1e6;
9792
uint256 constant MAX_BALANCE = 5e6;
9893
uint256 constant MAX_STRATEGY_COUNT = 32; // From StakeRegistry.MAX_WEIGHING_FUNCTION_LENGTH
@@ -121,7 +116,6 @@ abstract contract IntegrationDeployer is Test, IUserDeployer {
121116
// Deploy mocks
122117
EmptyContract emptyContract = new EmptyContract();
123118
ethPOSDeposit = new ETHPOSDepositMock();
124-
beaconChainOracle = new BeaconChainOracleMock();
125119

126120
/**
127121
* First, deploy upgradeable proxy contracts that **will point** to the implementations. Since the implementation contracts are
@@ -147,11 +141,6 @@ abstract contract IntegrationDeployer is Test, IUserDeployer {
147141
new TransparentUpgradeableProxy(address(emptyContract), address(proxyAdmin), "")
148142
)
149143
);
150-
delayedWithdrawalRouter = DelayedWithdrawalRouter(
151-
address(
152-
new TransparentUpgradeableProxy(address(emptyContract), address(proxyAdmin), "")
153-
)
154-
);
155144
avsDirectory = AVSDirectory(
156145
address(
157146
new TransparentUpgradeableProxy(address(emptyContract), address(proxyAdmin), "")
@@ -164,10 +153,8 @@ abstract contract IntegrationDeployer is Test, IUserDeployer {
164153
// Deploy EigenPod Contracts
165154
pod = new EigenPod(
166155
ethPOSDeposit,
167-
delayedWithdrawalRouter,
168156
eigenPodManager,
169-
MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR,
170-
0
157+
GENESIS_TIME_LOCAL
171158
);
172159

173160
eigenPodBeacon = new UpgradeableBeacon(address(pod));
@@ -181,8 +168,6 @@ abstract contract IntegrationDeployer is Test, IUserDeployer {
181168
EigenPodManager eigenPodManagerImplementation = new EigenPodManager(
182169
ethPOSDeposit, eigenPodBeacon, strategyManager, slasher, delegationManager
183170
);
184-
DelayedWithdrawalRouter delayedWithdrawalRouterImplementation =
185-
new DelayedWithdrawalRouter(eigenPodManager);
186171
AVSDirectory avsDirectoryImplemntation = new AVSDirectory(delegationManager);
187172
// RewardsCoordinator rewardsCoordinatorImplementation = new RewardsCoordinator(
188173
// delegationManager,
@@ -240,24 +225,11 @@ abstract contract IntegrationDeployer is Test, IUserDeployer {
240225
address(eigenPodManagerImplementation),
241226
abi.encodeWithSelector(
242227
EigenPodManager.initialize.selector,
243-
address(beaconChainOracle),
244228
eigenLayerReputedMultisig, // initialOwner
245229
pauserRegistry,
246230
0 // initialPausedStatus
247231
)
248232
);
249-
// Delayed Withdrawal Router
250-
proxyAdmin.upgradeAndCall(
251-
TransparentUpgradeableProxy(payable(address(delayedWithdrawalRouter))),
252-
address(delayedWithdrawalRouterImplementation),
253-
abi.encodeWithSelector(
254-
DelayedWithdrawalRouter.initialize.selector,
255-
eigenLayerReputedMultisig, // initialOwner
256-
pauserRegistry,
257-
0, // initialPausedStatus
258-
minWithdrawalDelayBlocks
259-
)
260-
);
261233
// AVSDirectory
262234
proxyAdmin.upgradeAndCall(
263235
TransparentUpgradeableProxy(payable(address(avsDirectory))),

test/integration/User.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ contract User_AltMethods is User {
399399
operatorsPerQuorum[i][j] = blsApkRegistry.getOperatorFromPubkeyHash(operatorIds[j]);
400400
}
401401

402-
Sort.sort(operatorsPerQuorum[i]);
402+
operatorsPerQuorum[i] = Sort.sortAddresses(operatorsPerQuorum[i]);
403403
}
404404

405405
registryCoordinator.updateOperatorsForQuorum(operatorsPerQuorum, allQuorums);

test/integration/mocks/BeaconChainOracleMock.t.sol

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

test/integration/utils/Sort.t.sol

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,24 @@
22
pragma solidity ^0.8.12;
33

44
library Sort {
5-
6-
/// @dev In-place insertion sort of addrs, h/t ChatGPT
7-
function sort(address[] memory addrs) internal pure {
8-
for (uint i = 1; i < addrs.length; i++) {
9-
address key = addrs[i];
10-
uint j = i - 1;
11-
12-
// Move elements of addrs[0..i-1], that are greater than key,
13-
// to one position ahead of their current position
14-
while (j >= 0 && addrs[j] > key) {
15-
addrs[j + 1] = addrs[j];
16-
if(j == 0) {
17-
break;
5+
/**
6+
* @notice Sorts an array of addresses in ascending order. h/t ChatGPT take 2
7+
* @dev This function uses the Bubble Sort algorithm, which is simple but has O(n^2) complexity.
8+
* @param addresses The array of addresses to be sorted.
9+
* @return sortedAddresses The array of addresses sorted in ascending order.
10+
*/
11+
function sortAddresses(address[] memory addresses) internal pure returns (address[] memory) {
12+
uint256 n = addresses.length;
13+
for (uint256 i = 0; i < n; i++) {
14+
for (uint256 j = 0; j < n - 1; j++) {
15+
// Compare and swap if the current address is greater than the next one
16+
if (addresses[j] > addresses[j + 1]) {
17+
address temp = addresses[j];
18+
addresses[j] = addresses[j + 1];
19+
addresses[j + 1] = temp;
1820
}
19-
j--;
2021
}
21-
addrs[j + 1] = key;
2222
}
23+
return addresses;
2324
}
2425
}

test/mocks/RewardsCoordinatorMock.sol

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,16 @@ contract RewardsCoordinatorMock is IRewardsCoordinator {
4141

4242
function getDistributionRootsLength() external view returns (uint256) {}
4343

44-
/// EXTERNAL FUNCTIONS ///
45-
46-
function disableRoot(uint32 rootIndex) external {}
44+
function getCurrentClaimableDistributionRoot() external view returns (DistributionRoot memory) {}
4745

4846
function getDistributionRootAtIndex(uint256 index) external view returns (DistributionRoot memory) {}
4947

5048
function getCurrentDistributionRoot() external view returns (DistributionRoot memory) {}
5149

50+
/// EXTERNAL FUNCTIONS ///
51+
52+
function disableRoot(uint32 rootIndex) external {}
53+
5254
function createAVSRewardsSubmission(RewardsSubmission[] calldata rewardsSubmissions) external {}
5355

5456
function createRewardsForAllSubmission(RewardsSubmission[] calldata rewardsSubmission) external {}

test/utils/MockAVSDeployer.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ contract MockAVSDeployer is Test {
147147

148148
delegationMock = new DelegationMock();
149149
avsDirectoryMock = new AVSDirectoryMock();
150-
eigenPodManagerMock = new EigenPodManagerMock();
150+
eigenPodManagerMock = new EigenPodManagerMock(pauserRegistry);
151151
strategyManagerMock = new StrategyManagerMock();
152152
slasherImplementation = new Slasher(strategyManagerMock, delegationMock);
153153
slasher = Slasher(

0 commit comments

Comments
 (0)