diff --git a/CHANGELOG/CHANGELOG-2.0.0.md b/CHANGELOG/CHANGELOG-2.0.0.md index e02270437..f0afc1f09 100644 --- a/CHANGELOG/CHANGELOG-2.0.0.md +++ b/CHANGELOG/CHANGELOG-2.0.0.md @@ -8,6 +8,7 @@ This release brings 2 UX improvements to the middleware repo. We increment the m ⛔ Breaking Changes - Update `createSlashableStakeQuorum` to take in a slasher address +- The `QuorumCreated` event now emits the `slasher` address of the quorum. 🔧 Improvements - Update `foundry.toml` solc to 0.8.29 diff --git a/src/SlashingRegistryCoordinator.sol b/src/SlashingRegistryCoordinator.sol index 01c334abb..caad35491 100644 --- a/src/SlashingRegistryCoordinator.sol +++ b/src/SlashingRegistryCoordinator.sol @@ -849,7 +849,8 @@ contract SlashingRegistryCoordinator is minimumStake: minimumStake, strategyParams: strategyParams, stakeType: stakeType, - lookAheadPeriod: lookAheadPeriod + lookAheadPeriod: lookAheadPeriod, + slasher: slasher }); // Hook to allow for any post-create quorum logic diff --git a/src/interfaces/IBN254TableCalculator.sol b/src/interfaces/IBN254TableCalculator.sol index 52a7fcdf7..f3715e108 100644 --- a/src/interfaces/IBN254TableCalculator.sol +++ b/src/interfaces/IBN254TableCalculator.sol @@ -27,6 +27,7 @@ interface IBN254TableCalculator is IOperatorTableCalculator, IOperatorTableCalcu * @param operatorSet The operatorSet to get the operatorInfos for * @return operatorInfos The array of BN254OperatorInfo structs containing pubkeys and weights for registered operators * @dev Only returns operators that have registered their BN254 keys with the KeyRegistrar + * @dev Note: This function is not intended to derive the index of an operator. Use `getOperatorIndex` instead. */ function getOperatorInfos( OperatorSet calldata operatorSet @@ -54,6 +55,10 @@ interface IBN254TableCalculator is IOperatorTableCalculator, IOperatorTableCalcu * @return nonSignerWitnesses The witnesses for operators that did not sign * @return nonSignerApk The aggregate BN254 G1 public key of the non-signers * @dev Reconstructs the operator info merkle tree deterministically to produce proofs and indices. + * @dev The output of this function is only valid when the operator table has been freshly updated and the current operator set state exactly matches the state at + * a given `referenceTimestamp`. It is recommended to call this function at blockchain state that matches the `referenceTimestamp` of the certificate being verified. + * In all other cases, the generated `nonSignerWitnesses` will be inconsistent with verification logic. + * @dev This function is intended to be called offchain due to large gas costs. */ function getNonSignerWitnessesAndApk( OperatorSet calldata operatorSet, diff --git a/src/interfaces/ISlashingRegistryCoordinator.sol b/src/interfaces/ISlashingRegistryCoordinator.sol index 2c450ca8e..bfb788406 100644 --- a/src/interfaces/ISlashingRegistryCoordinator.sol +++ b/src/interfaces/ISlashingRegistryCoordinator.sol @@ -166,6 +166,7 @@ interface ISlashingRegistryCoordinatorEvents is ISlashingRegistryCoordinatorType * @param strategyParams The strategy parameters for stake calculation. * @param stakeType The type of stake being tracked (TOTAL_DELEGATED or TOTAL_SLASHABLE). * @param lookAheadPeriod The number of blocks to look ahead when calculating slashable stake (only used for TOTAL_SLASHABLE). + * @param slasher The address of the slasher to use for the operatorSet (quorum) in EigenLayer core. The slasher is set to DELEGATED_STAKE_SLASHER for total delegated stake quorums. */ event QuorumCreated( uint8 indexed quorumNumber, @@ -173,7 +174,8 @@ interface ISlashingRegistryCoordinatorEvents is ISlashingRegistryCoordinatorType uint96 minimumStake, IStakeRegistryTypes.StrategyParams[] strategyParams, IStakeRegistryTypes.StakeType stakeType, - uint32 lookAheadPeriod + uint32 lookAheadPeriod, + address slasher ); /** diff --git a/test/unit/SlashingRegistryCoordinatorUnit.t.sol b/test/unit/SlashingRegistryCoordinatorUnit.t.sol index 2ef94c835..6e726ecd1 100644 --- a/test/unit/SlashingRegistryCoordinatorUnit.t.sol +++ b/test/unit/SlashingRegistryCoordinatorUnit.t.sol @@ -687,7 +687,8 @@ contract SlashingRegistryCoordinator_CreateSlashableStakeQuorum is minimumStake: minimumStake, strategyParams: strategyParams, stakeType: IStakeRegistryTypes.StakeType.TOTAL_SLASHABLE, - lookAheadPeriod: lookAheadPeriod + lookAheadPeriod: lookAheadPeriod, + slasher: proxyAdminOwner }); vm.prank(proxyAdminOwner); @@ -786,7 +787,8 @@ contract SlashingRegistryCoordinator_CreateTotalDelegatedStakeQuorum is minimumStake: minimumStake, strategyParams: strategyParams, stakeType: IStakeRegistryTypes.StakeType.TOTAL_DELEGATED, - lookAheadPeriod: 0 + lookAheadPeriod: 0, + slasher: slashingRegistryCoordinator.DELEGATED_STAKE_SLASHER() }); vm.prank(proxyAdminOwner);