You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Motivation:**
Registry contracts are out of date
**Modifications:**
Updated the existing registry docs and added `SocketRegistry.md`
**Result:**
---------
Co-authored-by: steven <[email protected]>
Copy file name to clipboardExpand all lines: docs/registries/BLSApkRegistry.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,7 @@ This method validates a BLS signature over the `pubkeyRegistrationMessageHash`,
54
54
* Registers the Operator's BLS pubkey for the first time, updating the following mappings:
55
55
*`operatorToPubkey[operator]`
56
56
*`operatorToPubkeyHash[operator]`
57
+
*`operatorToPubKeyG2[operator]`
57
58
*`pubkeyHashToOperator[pubkeyHash]`
58
59
59
60
*Requirements*:
@@ -129,6 +130,27 @@ This method is ONLY callable by the `RegistryCoordinator`, and is called when an
129
130
*`operator` MUST already have a registered BLS pubkey (see `registerBLSPublicKey` above)
130
131
* Each quorum in `quorumNumbers` MUST be initialized (see `initializeQuorum` below)
131
132
133
+
#### `verifyAndRegisterG2PubkeyForOperator`
134
+
135
+
```solidity
136
+
function verifyAndRegisterG2PubkeyForOperator(
137
+
address operator,
138
+
BN254.G2Point calldata pubkeyG2
139
+
)
140
+
external
141
+
onlyRegistryCoordinatorOwner
142
+
```
143
+
`verifyAndRegisterG2PubkeyForOperator` verifies and registers a G2 public key for an operator that already has a G1 key. This method is used to retrieve all information for the `checkSignatures` entry point from a view function, avoiding the need to index this information offchain. The method ensures that the BLS key pair is derived from the same secret key and stores the G2 key for the operator.
144
+
145
+
This method is only callable by the `RegistryCoordinatorOwner`, which is the account that has the `owner` role inside the `RegistryCoordinator`.
146
+
147
+
*Effects*
148
+
* Stores the corresponding G2 public key of an operator's BLS keypair, based on their G1 public key, updating `operatorToPubkeyG2[operator]`.
149
+
150
+
*Requirements*
151
+
* Caller MUST be the `RegistryCoordinatorOwner`
152
+
* Operator must not have a G2 public key set
153
+
* The G2 pubic key must form a valid BN254 pairing with the stored G1 key, in effect verifying that the keypair is derived from the same secret key
The `SocketRegistry` is a simple registry contract that keeps track of operator sockets (arbitrary strings). This socket could represent network connection information such as IP addresses, ports, or other connectivity details.
8
+
9
+
#### High-level Concepts
10
+
11
+
This registry maintains a mapping between operator IDs (represented as bytes32 values) and their corresponding socket information. The contract is designed to work in conjunction with the `SlashingRegistryCoordinator`, which is the only contract authorized to update socket information for operators.
12
+
13
+
This document organizes methods according to the following themes:
14
+
*[Socket Management](#socket-management)
15
+
16
+
---
17
+
18
+
### Socket Management
19
+
20
+
These methods allow for managing operator socket information:
21
+
*[`setOperatorSocket`](#setoperatorsocket)
22
+
23
+
#### `setOperatorSocket`
24
+
25
+
```solidity
26
+
function setOperatorSocket(
27
+
bytes32 _operatorId,
28
+
string memory _socket
29
+
)
30
+
external
31
+
onlySlashingRegistryCoordinator
32
+
```
33
+
34
+
Sets a socket string with an operator ID (hash of the G1 BLS public key) in the registry. This function is called by the `SlashingRegistryCoordinator`.
35
+
36
+
*Entry Points:*
37
+
Called by the `SlashingRegistryCoordinator` when an operator is registered or needs to update their socket information
38
+
39
+
*Effects:*
40
+
* Sets operatorIdToSocket[_operatorId] to the provided `_socket` string
41
+
42
+
*Requirements:*
43
+
* Caller MUST be the `SlashingRegistryCoordinator`
These methods are used by the `RegistryCoordinator's` Owner to configure initialized quorums in the `StakeRegistry`. They are not expected to be called very often, and will require updating Operator stakes via `RegistryCoordinator.updateOperatorsForQuorum` to maintain up-to-date views on Operator stake weights. Methods follow:
This method is ONLY callable by the `RegistryCoordinator`, and is called when the `RegistryCoordinator` Owner creates a new quorum.
205
+
This method is ONLY callable by the `RegistryCoordinator`, and is called when the `RegistryCoordinator` Owner creates a new delegated stake quorum.
203
206
204
-
`initializeQuorum` initializes a new quorum by pushing an initial `StakeUpdate` to `_totalStakeHistory[quorumNumber]`, with an initial stake of 0. Other methods can validate that a quorum exists by checking whether `_totalStakeHistory[quorumNumber]` has a nonzero length.
207
+
`initializeDelegatedStakeQuorum` initializes a new delegated stake quorum by pushing an initial `StakeUpdate` to `_totalStakeHistory[quorumNumber]`, with an initial stake of 0. Other methods can validate that a quorum exists by checking whether `_totalStakeHistory[quorumNumber]` has a nonzero length.
205
208
206
209
Additionally, this method configures a `minimumStake` for the quorum, as well as the `StrategyParams` it considers when calculating stake weight.
207
210
208
211
*Entry Points*:
209
-
*`RegistryCoordinator.createQuorum`
212
+
*`RegistryCoordinator.createDelegatedStakeQuorum`
213
+
214
+
*Effects*:
215
+
* See `addStrategies` below
216
+
* See `setMinimumStakeForQuorum` below
217
+
* Pushes a `StakeUpdate` to `_totalStakeHistory[quorumNumber]`. The update's `updateBlockNumber` is set to the current block, and `stake` is set to 0.
218
+
219
+
*Requirements*:
220
+
* Caller MUST be the `RegistryCoordinator`
221
+
*`quorumNumber` MUST NOT belong to an existing, initialized quorum
222
+
* See `addStrategies` below
223
+
* See `setMinimumStakeForQuorum` below
224
+
225
+
#### `initializeSlashableStakeQuorum`
226
+
227
+
```solidity
228
+
function initializeSlashableStakeQuorum(
229
+
uint8 quorumNumber,
230
+
uint96 minimumStake,
231
+
uint32 lookAheadPeriod,
232
+
StrategyParams[] memory _strategyParams
233
+
)
234
+
public
235
+
virtual
236
+
onlyRegistryCoordinator
237
+
238
+
struct StrategyParams {
239
+
IStrategy strategy;
240
+
uint96 multiplier;
241
+
}
242
+
```
243
+
244
+
This method is ONLY callable by the `RegistryCoordinator`, and is called when the `RegistryCoordinator` Owner creates a new slashable stake quorum.
245
+
246
+
`initializeSlashableStakeQuorum` initializes a new quorum by pushing an initial `StakeUpdate` to `_totalStakeHistory[quorumNumber]`, with an initial stake of 0. Other methods can validate that a quorum exists by checking whether `_totalStakeHistory[quorumNumber]` has a nonzero length.
247
+
248
+
This method configures a `minimumStake` for the quorum, defines the `StrategyParams` used when calculating stake weight and sets the `lookAheadPeriod` which defines how many blocks ahead to when considering the minimum amount of slahable stake. Note that `lookAheadPeriod` should be less than the `DEALLOCATION_DELAY` (14 days within the `AllocationManager`) blocks in the future, to avoid calculating stake values that may not reflect the operators true allocated stake.
249
+
250
+
*Entry Points*:
251
+
*`RegistryCoordinator.createSlashableStakeQuorum`
210
252
211
253
*Effects*:
212
254
* See `addStrategies` below
213
255
* See `setMinimumStakeForQuorum` below
256
+
* See `setSlashableLookAhead` below
214
257
* Pushes a `StakeUpdate` to `_totalStakeHistory[quorumNumber]`. The update's `updateBlockNumber` is set to the current block, and `stake` is set to 0.
215
258
259
+
216
260
*Requirements*:
217
261
* Caller MUST be the `RegistryCoordinator`
218
262
*`quorumNumber` MUST NOT belong to an existing, initialized quorum
@@ -336,4 +380,27 @@ Allows the `RegistryCoordinator` Owner to modify the multipliers specified in a
336
380
*`strategyIndices` MUST NOT be empty
337
381
*`strategyIndices` and `newMultipliers` MUST have equal lengths
338
382
383
+
384
+
#### `setSlashableLookAhead`
385
+
386
+
```solidity
387
+
function setSlashableStakeLookahead(
388
+
uint8 quorumNumber,
389
+
uint32 _lookAheadBlocks
390
+
)
391
+
external
392
+
onlyCoordinatorOwner
393
+
quorumExists(quorumNumber)
394
+
```
395
+
396
+
Allows the `RegistryCoordinator` Owner to modify the slashable lookahead for a slashable stake quorum.
397
+
398
+
*Effects*
399
+
* The quorum's `SlashablableStakeLookAhead` is updated to `_lookAheadBlocks`
400
+
401
+
*Requirements*
402
+
* Caller MUST be `RegistryCoordinator.owner()`
403
+
*`quorumNumber` MUST belong to an existing initialized quorum
404
+
*`quorumNumber` MUST map to a slashable stake quorum
0 commit comments