Skip to content

Commit 762d418

Browse files
committed
docs: natspec BLSApkRegistry
1 parent a968971 commit 762d418

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

src/BLSApkRegistryStorage.sol

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,30 @@ import {Initializable} from "@openzeppelin-upgrades/contracts/proxy/utils/Initia
99
import {BN254} from "./libraries/BN254.sol";
1010

1111
abstract contract BLSApkRegistryStorage is Initializable, IBLSApkRegistry {
12-
/// @notice the hash of the zero pubkey aka BN254.G1Point(0,0)
12+
/// @dev Returns the hash of the zero pubkey aka BN254.G1Point(0,0)
1313
bytes32 internal constant ZERO_PK_HASH =
1414
hex"ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5";
1515

16-
/// @notice the registry coordinator contract
16+
/// @inheritdoc IBLSApkRegistry
1717
address public immutable registryCoordinator;
1818

19-
// storage for individual pubkeys
20-
/// @notice maps operator address to pubkey hash
19+
/// INDIVIDUAL PUBLIC KEY STORAGE
20+
21+
/// @inheritdoc IBLSApkRegistry
2122
mapping(address operator => bytes32 operatorId) public operatorToPubkeyHash;
22-
/// @notice maps pubkey hash to operator address
23+
24+
/// @inheritdoc IBLSApkRegistry
2325
mapping(bytes32 pubkeyHash => address operator) public pubkeyHashToOperator;
24-
/// @notice maps operator address to pubkeyG1
26+
27+
/// @inheritdoc IBLSApkRegistry
2528
mapping(address operator => BN254.G1Point pubkeyG1) public operatorToPubkey;
2629

27-
// storage for aggregate pubkeys (APKs)
28-
/// @notice maps quorumNumber => historical aggregate pubkey updates
30+
/// AGGREGATE PUBLIC KEY STORAGE
31+
32+
/// @inheritdoc IBLSApkRegistry
2933
mapping(uint8 => IBLSApkRegistryTypes.ApkUpdate[]) public apkHistory;
30-
/// @notice maps quorumNumber => current aggregate pubkey of quorum
34+
35+
/// @inheritdoc IBLSApkRegistry
3136
mapping(uint8 => BN254.G1Point) public currentApk;
3237

3338
constructor(
@@ -38,6 +43,5 @@ abstract contract BLSApkRegistryStorage is Initializable, IBLSApkRegistry {
3843
_disableInitializers();
3944
}
4045

41-
// storage gap for upgradeability
4246
uint256[45] private __GAP;
4347
}

src/interfaces/IBLSApkRegistry.sol

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ interface IBLSApkRegistry is IRegistry, IBLSApkRegistryErrors, IBLSApkRegistryEv
8181
/// @dev This value is immutable and set during contract construction.
8282
function registryCoordinator() external view returns (address);
8383

84+
/// @notice Maps `operator` to their BLS public key hash (`operatorId`).
85+
/// @param operator The address of the operator.
86+
/// @return operatorId The hash of the operator's BLS public key.
87+
function operatorToPubkeyHash(address operator) external view returns (bytes32 operatorId);
88+
89+
/// @notice Maps `pubkeyHash` to their corresponding `operator` address.
90+
/// @param pubkeyHash The hash of a BLS public key.
91+
/// @return operator The address of the operator who registered this public key.
92+
function pubkeyHashToOperator(bytes32 pubkeyHash) external view returns (address operator);
93+
8494
/// @notice Maps `operator` to their BLS public key in G1.
8595
/// @dev Returns a non-encoded BN254.G1Point.
8696
/// @param operator The address of the operator.

0 commit comments

Comments
 (0)