diff --git a/contracts/lib/eigenlayer-contracts b/contracts/lib/eigenlayer-contracts index a888a1cd1..426f461c5 160000 --- a/contracts/lib/eigenlayer-contracts +++ b/contracts/lib/eigenlayer-contracts @@ -1 +1 @@ -Subproject commit a888a1cd1479438dda4b138245a69177b125a973 +Subproject commit 426f461c59b4f0e16f8becdffd747075edcaded8 diff --git a/contracts/test/validator-registry/avs/AVSDirectoryMock.sol b/contracts/test/validator-registry/avs/AVSDirectoryMock.sol index 9d5274e87..d4e7d42f0 100644 --- a/contracts/test/validator-registry/avs/AVSDirectoryMock.sol +++ b/contracts/test/validator-registry/avs/AVSDirectoryMock.sol @@ -9,7 +9,6 @@ import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; // Eigenlayer core does not define their own mock for AVSDirectory.sol, hence we define our own. contract AVSDirectoryMock is IAVSDirectory, Test { mapping(address => bool) public isOperatorRegistered; - address public avs_; bytes32 public constant OPERATOR_AVS_REGISTRATION_TYPEHASH = keccak256("OperatorAVSRegistration(address operator,address avs,bytes32 salt,uint256 expiry)"); @@ -85,7 +84,9 @@ contract AVSDirectoryMock is IAVSDirectory, Test { return digestHash; } - function domainSeparator() public view returns (bytes32) { + function cancelSalt(bytes32 salt) external override { } + + function domainSeparator() public view override returns (bytes32) { return keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes("EigenLayer")), block.chainid, address(this))); } } diff --git a/contracts/test/validator-registry/avs/EigenPodManagerMock.sol b/contracts/test/validator-registry/avs/EigenPodManagerMock.sol index 85a2b5085..c23d70eca 100644 --- a/contracts/test/validator-registry/avs/EigenPodManagerMock.sol +++ b/contracts/test/validator-registry/avs/EigenPodManagerMock.sol @@ -7,7 +7,6 @@ import {IEigenPodManager} from "eigenlayer-contracts/src/contracts/interfaces/IE import {IEigenPod} from "eigenlayer-contracts/src/contracts/interfaces/IEigenPod.sol"; import {IStrategy} from "eigenlayer-contracts/src/contracts/interfaces/IStrategy.sol"; import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol"; -import {IBeaconChainOracle} from "eigenlayer-contracts/src/contracts/interfaces/IBeaconChainOracle.sol"; import {IETHPOSDeposit} from "eigenlayer-contracts/src/contracts/interfaces/IETHPOSDeposit.sol"; import {ISlasher} from "eigenlayer-contracts/src/contracts/interfaces/ISlasher.sol"; import {IStrategyManager} from "eigenlayer-contracts/src/contracts/interfaces/IStrategyManager.sol"; @@ -42,16 +41,10 @@ contract EigenPodManagerMock is IEigenPodManager, Test { function recordBeaconChainETHBalanceUpdate(address /*podOwner*/, int256 /*sharesDelta*/) external pure {} - function updateBeaconChainOracle(IBeaconChainOracle /*newBeaconChainOracle*/) external pure {} - function ownerToPod(address /*podOwner*/) external pure returns(IEigenPod) { return IEigenPod(address(0)); } - function beaconChainOracle() external pure returns(IBeaconChainOracle) { - return IBeaconChainOracle(address(0)); - } - function getBlockRootAtTimestamp(uint64 /*timestamp*/) external pure returns(bytes32) { return bytes32(0); } diff --git a/contracts/test/validator-registry/avs/EigenPodMock.sol b/contracts/test/validator-registry/avs/EigenPodMock.sol index 00ec1ac87..bb6a96d46 100644 --- a/contracts/test/validator-registry/avs/EigenPodMock.sol +++ b/contracts/test/validator-registry/avs/EigenPodMock.sol @@ -2,8 +2,10 @@ pragma solidity 0.8.26; import "forge-std/Test.sol"; +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "eigenlayer-contracts/src/contracts/interfaces/IEigenPod.sol"; -import {IEigenPodManager} from "eigenlayer-contracts/src/contracts/interfaces/IEigenPodManager.sol"; +import "eigenlayer-contracts/src/contracts/interfaces/IEigenPodManager.sol"; +import "eigenlayer-contracts/src/contracts/libraries/BeaconChainProofs.sol"; // Similar to eigenlayer core's EigenPodMock but their mocks don't use virtual functions. contract EigenPodMock is IEigenPod, Test { @@ -13,69 +15,65 @@ contract EigenPodMock is IEigenPod, Test { validatorInfo[validatorPubkey] = info; } - function validatorPubkeyToInfo(bytes memory validatorPubkey) - external view virtual override returns(ValidatorInfo memory) { + function validatorPubkeyToInfo(bytes calldata validatorPubkey) + external view override returns(ValidatorInfo memory) { return validatorInfo[validatorPubkey]; } - function MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR() external view returns(uint64) {} + function validatorPubkeyHashToInfo(bytes32 validatorPubkeyHash) external view override returns (ValidatorInfo memory) {} - function nonBeaconChainETHBalanceWei() external view returns(uint256) {} + function initialize(address owner) external override {} - function withdrawableRestakedExecutionLayerGwei() external view returns(uint64) {} + function stake(bytes calldata pubkey, bytes calldata signature, bytes32 depositDataRoot) external payable override {} - function initialize(address owner) external {} + function withdrawRestakedBeaconChainETH(address recipient, uint256 amount) external override {} - function stake(bytes calldata pubkey, bytes calldata signature, bytes32 depositDataRoot) external payable {} + function startCheckpoint(bool revertIfNoBalance) external override {} - function withdrawRestakedBeaconChainETH(address recipient, uint256 amount) external {} + function verifyCheckpointProofs( + BeaconChainProofs.BalanceContainerProof calldata balanceContainerProof, + BeaconChainProofs.BalanceProof[] calldata proofs + ) external override {} - function eigenPodManager() external view returns (IEigenPodManager) {} + function verifyWithdrawalCredentials( + uint64 beaconTimestamp, + BeaconChainProofs.StateRootProof calldata stateRootProof, + uint40[] calldata validatorIndices, + bytes[] calldata validatorFieldsProofs, + bytes32[][] calldata validatorFields + ) external override {} - function podOwner() external view returns (address) {} + function verifyStaleBalance( + uint64 beaconTimestamp, + BeaconChainProofs.StateRootProof calldata stateRootProof, + BeaconChainProofs.ValidatorProof calldata proof + ) external override {} - function hasRestaked() external view returns (bool) {} + function recoverTokens(IERC20[] memory tokenList, uint256[] memory amountsToWithdraw, address recipient) external override {} - function mostRecentWithdrawalTimestamp() external view returns (uint64) {} + function setProofSubmitter(address newProofSubmitter) external override {} - function validatorPubkeyHashToInfo(bytes32 validatorPubkeyHash) external view returns (ValidatorInfo memory) {} + function proofSubmitter() external view override returns (address) {} - function provenWithdrawal(bytes32 validatorPubkeyHash, uint64 slot) external view returns (bool) {} + function withdrawableRestakedExecutionLayerGwei() external view override returns (uint64) {} - function validatorStatus(bytes32 pubkeyHash) external view returns(VALIDATOR_STATUS) {} + function eigenPodManager() external view override returns (IEigenPodManager) {} - function verifyWithdrawalCredentials( - uint64 oracleTimestamp, - BeaconChainProofs.StateRootProof calldata stateRootProof, - uint40[] calldata validatorIndices, - bytes[] calldata withdrawalCredentialProofs, - bytes32[][] calldata validatorFields - ) external {} - - function verifyBalanceUpdates( - uint64 oracleTimestamp, - uint40[] calldata validatorIndices, - BeaconChainProofs.StateRootProof calldata stateRootProof, - bytes[] calldata validatorFieldsProofs, - bytes32[][] calldata validatorFields - ) external {} + function podOwner() external view override returns (address) {} - function verifyAndProcessWithdrawals( - uint64 oracleTimestamp, - BeaconChainProofs.StateRootProof calldata stateRootProof, - BeaconChainProofs.WithdrawalProof[] calldata withdrawalProofs, - bytes[] calldata validatorFieldsProofs, - bytes32[][] calldata validatorFields, - bytes32[][] calldata withdrawalFields - ) external {} + function validatorStatus(bytes32 pubkeyHash) external view override returns(VALIDATOR_STATUS) {} + + function validatorStatus(bytes calldata validatorPubkey) external view override returns (VALIDATOR_STATUS){} + + function activeValidatorCount() external view override returns (uint256) {} - function activateRestaking() external {} + function lastCheckpointTimestamp() external view override returns (uint64) {} - function withdrawBeforeRestaking() external {} + function currentCheckpointTimestamp() external view override returns (uint64) {} - function withdrawNonBeaconChainETHBalanceWei(address recipient, uint256 amountToWithdraw) external {} + function currentCheckpoint() external view override returns (Checkpoint memory) {} - function recoverTokens(IERC20[] memory tokenList, uint256[] memory amountsToWithdraw, address recipient) external {} + function checkpointBalanceExitedGwei(uint64) external view override returns (uint64) {} - function validatorStatus(bytes calldata pubkey) external view returns (VALIDATOR_STATUS){} + function getParentBlockRoot(uint64 timestamp) external view override returns (bytes32) {} } diff --git a/contracts/test/validator-registry/avs/MevCommitAVSTest.sol b/contracts/test/validator-registry/avs/MevCommitAVSTest.sol index 549eadd52..05c1dcf51 100644 --- a/contracts/test/validator-registry/avs/MevCommitAVSTest.sol +++ b/contracts/test/validator-registry/avs/MevCommitAVSTest.sol @@ -282,7 +282,7 @@ contract MevCommitAVSTest is Test { mockPod.setMockValidatorInfo(valPubkeys[0], IEigenPod.ValidatorInfo({ validatorIndex: 1, restakedBalanceGwei: 1, - mostRecentBalanceUpdateTimestamp: 1, + lastCheckpointedAt: 1, status: IEigenPod.VALIDATOR_STATUS.INACTIVE })); eigenPodManagerMock.setMockPod(podOwner, mockPod); @@ -294,14 +294,14 @@ contract MevCommitAVSTest is Test { mockPod.setMockValidatorInfo(valPubkeys[0], IEigenPod.ValidatorInfo({ validatorIndex: 1, restakedBalanceGwei: 1, - mostRecentBalanceUpdateTimestamp: 1, + lastCheckpointedAt: 1, status: IEigenPod.VALIDATOR_STATUS.ACTIVE })); mockPod.setMockValidatorInfo(valPubkeys[1], IEigenPod.ValidatorInfo({ validatorIndex: 2, restakedBalanceGwei: 1, - mostRecentBalanceUpdateTimestamp: 1, + lastCheckpointedAt: 1, status: IEigenPod.VALIDATOR_STATUS.ACTIVE }));