diff --git a/src/BLSApkRegistry.sol b/src/BLSApkRegistry.sol index 94ca7aea..0bdb80ad 100644 --- a/src/BLSApkRegistry.sol +++ b/src/BLSApkRegistry.sol @@ -104,7 +104,7 @@ contract BLSApkRegistry is BLSApkRegistryStorage { ) ) % BN254.FR_MODULUS; - // e(sigma + P * gamma, [-1]_2) = e(H(m) + [1]_1 * gamma, P') + // e(sigma + P * gamma, [1]_2) = e(H(m) + [1]_1 * gamma, P') require( BN254.pairing( params.pubkeyRegistrationSignature.plus(params.pubkeyG1.scalar_mul(gamma)), @@ -314,7 +314,7 @@ contract BLSApkRegistry is BLSApkRegistryStorage { } function _checkRegistryCoordinator() internal view { - require(msg.sender == address(registryCoordinator), OnlyRegistryCoordinatorOwner()); + require(msg.sender == address(registryCoordinator), OnlyRegistryCoordinator()); } function _checkRegistryCoordinatorOwner() internal view { diff --git a/src/RegistryCoordinator.sol b/src/RegistryCoordinator.sol index de00b48c..eca146d9 100644 --- a/src/RegistryCoordinator.sol +++ b/src/RegistryCoordinator.sol @@ -187,10 +187,9 @@ contract RegistryCoordinator is SlashingRegistryCoordinator, RegistryCoordinator // filter out M2 quorums from the quorum numbers uint256 operatorSetBitmap = quorumNumbers.orderedBytesArrayToBitmap().minus(m2QuorumBitmap()); - if (!operatorSetBitmap.isEmpty()) { - // call the parent _forceDeregisterOperator function for operator sets quorums - super._forceDeregisterOperator(operator, operatorSetBitmap.bitmapToBytesArray()); - } + + // call the parent _forceDeregisterOperator function for operator sets quorums + super._forceDeregisterOperator(operator, operatorSetBitmap.bitmapToBytesArray()); } /// @dev Hook to prevent any new quorums from being created if operator sets are not enabled @@ -235,10 +234,7 @@ contract RegistryCoordinator is SlashingRegistryCoordinator, RegistryCoordinator /** * @dev Helper function to update operator stakes and deregister operators with insufficient stake - * This function handles two cases: - * 1. Operators who no longer meet the minimum stake requirement for a quorum - * 2. Operators who have been force-deregistered from the AllocationManager but not from this contract - * (e.g. due to out of gas errors in the deregistration callback) + * This function handles Operators who no longer meet the minimum stake requirement for a quorum * @param operators The list of operators to check and update * @param operatorIds The corresponding operator IDs * @param quorumNumber The quorum number to check stakes for diff --git a/src/StakeRegistry.sol b/src/StakeRegistry.sol index ca064a56..9de2b9f7 100644 --- a/src/StakeRegistry.sol +++ b/src/StakeRegistry.sol @@ -137,8 +137,7 @@ contract StakeRegistry is StakeRegistryStorage { * in the quorum's total stake. * * If the operator no longer has the minimum stake required to be registered - * in the quorum, the quorum number is added to `quorumsToRemove`, which - * is returned to the registry coordinator. + * in the quorum, the operator is marked for removal. */ _checkQuorumExists(quorumNumber); diff --git a/src/interfaces/IBLSApkRegistry.sol b/src/interfaces/IBLSApkRegistry.sol index 25d7d57c..2fd3b68e 100644 --- a/src/interfaces/IBLSApkRegistry.sol +++ b/src/interfaces/IBLSApkRegistry.sol @@ -4,8 +4,10 @@ pragma solidity ^0.8.27; import {BN254} from "../libraries/BN254.sol"; interface IBLSApkRegistryErrors { - /// @notice Thrown when a non-RegistryCoordinator address calls a restricted function. + /// @notice Thrown when a non-RegistryCoordinator owner address calls a restricted function. error OnlyRegistryCoordinatorOwner(); + /// @notice Thrown when a non-RegistryCoordinator address calls a restricted function. + error OnlyRegistryCoordinator(); /// @notice Thrown when attempting to initialize a quorum that already exists. error QuorumAlreadyExists(); /// @notice Thrown when a quorum does not exist. diff --git a/test/unit/BLSApkRegistryUnit.t.sol b/test/unit/BLSApkRegistryUnit.t.sol index f38c89d0..8ba06d90 100644 --- a/test/unit/BLSApkRegistryUnit.t.sol +++ b/test/unit/BLSApkRegistryUnit.t.sol @@ -287,7 +287,7 @@ contract BLSApkRegistryUnitTests_configAndGetters is BLSApkRegistryUnitTests { cheats.assume(nonCoordinatorAddress != address(registryCoordinator)); cheats.prank(address(nonCoordinatorAddress)); - cheats.expectRevert(IBLSApkRegistryErrors.OnlyRegistryCoordinatorOwner.selector); + cheats.expectRevert(IBLSApkRegistryErrors.OnlyRegistryCoordinator.selector); blsApkRegistry.initializeQuorum(defaultQuorumNumber); } } @@ -306,7 +306,7 @@ contract BLSApkRegistryUnitTests_registerBLSPublicKey is BLSApkRegistryUnitTests registryCoordinator.pubkeyRegistrationMessageHash(defaultOperator); cheats.prank(address(nonCoordinatorAddress)); - cheats.expectRevert(IBLSApkRegistryErrors.OnlyRegistryCoordinatorOwner.selector); + cheats.expectRevert(IBLSApkRegistryErrors.OnlyRegistryCoordinator.selector); blsApkRegistry.registerBLSPublicKey(defaultOperator, pubkeyRegistrationParams, messageHash); } @@ -434,7 +434,7 @@ contract BLSApkRegistryUnitTests_registerOperator is BLSApkRegistryUnitTests { cheats.assume(nonCoordinatorAddress != address(registryCoordinator)); cheats.prank(nonCoordinatorAddress); - cheats.expectRevert(IBLSApkRegistryErrors.OnlyRegistryCoordinatorOwner.selector); + cheats.expectRevert(IBLSApkRegistryErrors.OnlyRegistryCoordinator.selector); blsApkRegistry.registerOperator(nonCoordinatorAddress, new bytes(0)); } @@ -537,7 +537,7 @@ contract BLSApkRegistryUnitTests_deregisterOperator is BLSApkRegistryUnitTests { cheats.assume(nonCoordinatorAddress != address(registryCoordinator)); cheats.prank(nonCoordinatorAddress); - cheats.expectRevert(IBLSApkRegistryErrors.OnlyRegistryCoordinatorOwner.selector); + cheats.expectRevert(IBLSApkRegistryErrors.OnlyRegistryCoordinator.selector); blsApkRegistry.deregisterOperator(nonCoordinatorAddress, new bytes(0)); }