Skip to content
Merged
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
4 changes: 2 additions & 2 deletions src/BLSApkRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down Expand Up @@ -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 {
Expand Down
12 changes: 4 additions & 8 deletions src/RegistryCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/StakeRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 3 additions & 1 deletion src/interfaces/IBLSApkRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions test/unit/BLSApkRegistryUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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);
}

Expand Down Expand Up @@ -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));
}

Expand Down Expand Up @@ -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));
}

Expand Down