Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/forge-test-intense.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
version: v1.3.5

# Build the project and display contract sizes.
- name: Forge Build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
version: v1.3.5

# Run Forge's formatting checker to ensure consistent code style.
- name: Forge Fmt
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
version: v1.3.5

# Install LCOV for coverage report generation.
- name: Install LCOV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/storage-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
version: v1.3.5

- name: "Generate and prepare the storage reports for current branch"
run: |
Expand Down
2 changes: 1 addition & 1 deletion foundry.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lib/eigenlayer-contracts": {
"rev": "31aade2fc3bf6e2c0160cc2e7c7be1a6017296e5"
"rev": "b9c1a6118534d19dafec502849e557ea68dff494"
},
"lib/forge-std": {
"rev": "77041d2ce690e692d6e03cc812b57d1ddaa4d505"
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

]
# Specifies the exact version of Solidity to use, overriding auto-detection.
solc_version = '0.8.27'
solc_version = '0.8.29'
# If enabled, treats Solidity compiler warnings as errors, preventing artifact generation if warnings are present.
deny_warnings = false
# If set to true, changes compilation pipeline to go through the new IR optimizer.
Expand Down
2 changes: 1 addition & 1 deletion lib/eigenlayer-contracts
8 changes: 1 addition & 7 deletions src/RegistryCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,7 @@ contract RegistryCoordinator is SlashingRegistryCoordinator, RegistryCoordinator
* @notice Returns the version of the contract
* @return The version string
*/
function version()
public
view
virtual
override(ISemVerMixin, SemVerMixin)
returns (string memory)
{
function version() public view virtual override(SemVerMixin) returns (string memory) {
return "v0.0.1";
}
}
22 changes: 14 additions & 8 deletions src/SlashingRegistryCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ contract SlashingRegistryCoordinator is
minimumStake,
strategyParams,
IStakeRegistryTypes.StakeType.TOTAL_DELEGATED,
0
0,
DELEGATED_STAKE_SLASHER
);
}

Expand All @@ -134,14 +135,16 @@ contract SlashingRegistryCoordinator is
OperatorSetParam memory operatorSetParams,
uint96 minimumStake,
IStakeRegistryTypes.StrategyParams[] memory strategyParams,
uint32 lookAheadPeriod
uint32 lookAheadPeriod,
address slasher
) external virtual onlyOwner {
_createQuorum(
operatorSetParams,
minimumStake,
strategyParams,
IStakeRegistryTypes.StakeType.TOTAL_SLASHABLE,
lookAheadPeriod
lookAheadPeriod,
slasher
);
}

Expand Down Expand Up @@ -780,13 +783,15 @@ contract SlashingRegistryCoordinator is
* registered
* @param strategyParams a list of strategies and multipliers used by the StakeRegistry to
* calculate an operator's stake weight for the quorum
* @param slasher the address of the slasher to use for the quorum (operatorSet)
*/
function _createQuorum(
OperatorSetParam memory operatorSetParams,
uint96 minimumStake,
IStakeRegistryTypes.StrategyParams[] memory strategyParams,
IStakeRegistryTypes.StakeType stakeType,
uint32 lookAheadPeriod
uint32 lookAheadPeriod,
address slasher
) internal {
// The previous quorum count is the new quorum's number,
// this is because quorum numbers begin from index 0.
Expand All @@ -803,8 +808,8 @@ contract SlashingRegistryCoordinator is
_setOperatorSetParams(quorumNumber, operatorSetParams);

// Create array of CreateSetParams for the new quorum
IAllocationManagerTypes.CreateSetParams[] memory createSetParams =
new IAllocationManagerTypes.CreateSetParams[](1);
IAllocationManagerTypes.CreateSetParamsV2[] memory createSetParams =
new IAllocationManagerTypes.CreateSetParamsV2[](1);

// Extract strategies from strategyParams
IStrategy[] memory strategies = new IStrategy[](strategyParams.length);
Expand All @@ -813,9 +818,10 @@ contract SlashingRegistryCoordinator is
}

// Initialize CreateSetParams with quorumNumber as operatorSetId
createSetParams[0] = IAllocationManagerTypes.CreateSetParams({
createSetParams[0] = IAllocationManagerTypes.CreateSetParamsV2({
operatorSetId: quorumNumber,
strategies: strategies
strategies: strategies,
slasher: slasher
});
allocationManager.createOperatorSets({avs: avs, params: createSetParams});

Expand Down
4 changes: 4 additions & 0 deletions src/SlashingRegistryCoordinatorStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ abstract contract SlashingRegistryCoordinatorStorage is ISlashingRegistryCoordin
/// @notice the Index Registry contract that will keep track of operators' indexes
IIndexRegistry public immutable indexRegistry;

/// @notice For delegated stake quorums, the address that is set to slash
/// @dev This address is set to the burn address as 0 addresses are not valid slasher addresses
address public constant DELEGATED_STAKE_SLASHER = 0x00000000000000000000000000000000000E16E4;

/// EigenLayer contracts
/// @notice the AllocationManager that tracks OperatorSets and Slashing in EigenLayer
IAllocationManager public immutable allocationManager;
Expand Down
5 changes: 4 additions & 1 deletion src/interfaces/ISlashingRegistryCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,16 @@ interface ISlashingRegistryCoordinator is
* @param strategyParams A list of strategies and multipliers used by the StakeRegistry to calculate
* an operator's stake weight for the quorum.
* @param lookAheadPeriod The number of blocks to look ahead when calculating slashable stake.
* @param slasher The address of the slasher to use for the operatorSet (quorum) in EigenLayer core
* @dev Can only be called when operator sets are enabled.
* @dev The lookahead period is set to 0 and slasher is set to DELEGATED_STAKE_SLASHER for total delegated stake quorums
*/
function createSlashableStakeQuorum(
OperatorSetParam memory operatorSetParams,
uint96 minimumStake,
IStakeRegistryTypes.StrategyParams[] memory strategyParams,
uint32 lookAheadPeriod
uint32 lookAheadPeriod,
address slasher
) external;

/**
Expand Down
12 changes: 6 additions & 6 deletions test/fork/EigenDA.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import {IIndexRegistry} from "../../src/interfaces/IIndexRegistry.sol";
import {ISlashingRegistryCoordinator} from "../../src/interfaces/ISlashingRegistryCoordinator.sol";
import {ISocketRegistry} from "../../src/interfaces/ISocketRegistry.sol";
import {IPauserRegistry} from "eigenlayer-contracts/src/contracts/interfaces/IPauserRegistry.sol";
import {IAllocationManager} from
"eigenlayer-contracts/src/contracts/interfaces/IAllocationManager.sol";
import {IDelegationManager} from
"eigenlayer-contracts/src/contracts/interfaces/IDelegationManager.sol";
import {IAVSDirectory} from "eigenlayer-contracts/src/contracts/interfaces/IAVSDirectory.sol";
Expand All @@ -35,6 +33,7 @@ import {
OperatorSet,
IAllocationManagerTypes
} from "eigenlayer-contracts/src/contracts/interfaces/IAllocationManager.sol";
import {AllocationManager} from "eigenlayer-contracts/src/contracts/core/AllocationManager.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {
ISignatureUtilsMixin,
Expand Down Expand Up @@ -220,6 +219,7 @@ contract EigenDATest is Test {
IStrategyManager public strategyManager;

function setUp() public virtual {
vm.skip(true); // TODO: change fork to using Hoodi once DA migrates
// Setup the Holesky fork and load EigenDA deployment data
eigenDAData = _setupEigenDAFork("test/utils");

Expand Down Expand Up @@ -687,7 +687,7 @@ contract EigenDATest is Test {

vm.startPrank(serviceManagerOwner);
registryCoordinator.createSlashableStakeQuorum(
operatorSetParam, minimumStake, strategyParams, lookAheadPeriod
operatorSetParam, minimumStake, strategyParams, lookAheadPeriod, serviceManagerOwner
);
vm.stopPrank();
}
Expand Down Expand Up @@ -787,16 +787,16 @@ contract EigenDATest is Test {
serviceManager.setAppointee(
address(registryCoordinator),
allocationManagerAddr,
IAllocationManager.createOperatorSets.selector
bytes4(keccak256("createOperatorSets(address,(uint32,address[],address)[])"))
);
serviceManager.setAppointee(
serviceManagerOwner,
allocationManagerAddr,
IAllocationManager.updateAVSMetadataURI.selector
AllocationManager.updateAVSMetadataURI.selector
);

serviceManager.setAppointee(
serviceManagerOwner, allocationManagerAddr, IAllocationManager.setAVSRegistrar.selector
serviceManagerOwner, allocationManagerAddr, AllocationManager.setAVSRegistrar.selector
);

console.log("Appointees set for required permissions");
Expand Down
5 changes: 3 additions & 2 deletions test/fork/End2End.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ contract End2EndForkTest is Test {
}

function testEndToEndSetup_M2Migration() public {
vm.skip(true); // TODO: change fork to using Hoodi once DA migrates
(
OperatorLib.Operator[] memory operators,
DeploymentData memory coreDeployment,
Expand Down Expand Up @@ -204,7 +205,7 @@ contract End2EndForkTest is Test {
address(middlewareDeployment.serviceManager),
address(middlewareDeployment.registryCoordinator),
coreDeployment.allocationManager,
AllocationManager.createOperatorSets.selector
bytes4(keccak256("createOperatorSets(address,(uint32,address[],address)[])"))
);
vm.stopPrank();
}
Expand Down Expand Up @@ -365,7 +366,7 @@ contract End2EndForkTest is Test {
});

RegistryCoordinator(middlewareDeployment.registryCoordinator).createSlashableStakeQuorum(
operatorSetParams, 100, strategyParams, 10
operatorSetParams, 100, strategyParams, 10, address(middlewareDeployment.serviceManager)
);
vm.stopPrank();

Expand Down
6 changes: 4 additions & 2 deletions test/integration/IntegrationConfig.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ contract IntegrationConfig is IntegrationDeployer, G2Operations, Constants {
operatorSetParams: operatorSet,
minimumStake: minimumStake,
strategyParams: strategyParams,
lookAheadPeriod: 0
lookAheadPeriod: 0,
slasher: registryCoordinatorOwner
});
} else if (quorumType == BOTH) {
// randomly choose one of the two
Expand All @@ -222,7 +223,8 @@ contract IntegrationConfig is IntegrationDeployer, G2Operations, Constants {
operatorSetParams: operatorSet,
minimumStake: minimumStake,
strategyParams: strategyParams,
lookAheadPeriod: 0
lookAheadPeriod: 0,
slasher: registryCoordinatorOwner
});
}
}
Expand Down
Loading
Loading