@@ -143,6 +143,52 @@ Executor operator sets define which operators are eligible to execute tasks and
143
143
* [ ` registerExecutorOperatorSet ` ] ( #registerexecutoroperatorset )
144
144
* [ ` getExecutorOperatorSetTaskConfig ` ] ( #getexecutoroperatorsettaskconfig )
145
145
146
+ ### ExecutorOperatorSetTaskConfig Structure
147
+
148
+ The task configuration for an executor operator set contains the following fields:
149
+
150
+ ``` solidity
151
+ struct ExecutorOperatorSetTaskConfig {
152
+ IAVSTaskHook taskHook; // AVS-specific contract for custom validation
153
+ uint96 taskSLA; // Time limit in seconds for task completion
154
+ IERC20 feeToken; // Token used for task fees (zero address = no fees)
155
+ address feeCollector; // Address to receive AVS portion of fees
156
+ CurveType curveType; // Cryptographic curve (BN254 or ECDSA)
157
+ Consensus consensus; // Consensus type and parameters
158
+ bytes taskMetadata; // AVS-specific metadata
159
+ }
160
+ ```
161
+
162
+ ### Consensus Configuration
163
+
164
+ The consensus configuration determines how operator signatures are validated:
165
+
166
+ ``` solidity
167
+ struct Consensus {
168
+ ConsensusType consensusType; // Type of consensus validation
169
+ bytes value; // Type-specific parameters
170
+ }
171
+
172
+ enum ConsensusType {
173
+ NONE, // AVS handles consensus validation
174
+ STAKE_PROPORTION_THRESHOLD // Require minimum stake percentage
175
+ }
176
+ ```
177
+
178
+ ** Consensus Types:**
179
+
180
+ 1 . ** NONE** :
181
+ - The TaskMailbox only verifies certificate validity (signature, timestamp, message hash)
182
+ - AVS is responsible for implementing custom consensus logic in task hooks
183
+ - ` value ` must be empty bytes
184
+ - Useful for AVSs with custom consensus mechanisms or off-chain validation
185
+
186
+ 2 . ** STAKE_PROPORTION_THRESHOLD** :
187
+ - Requires a minimum percentage of total stake to sign the result
188
+ - ` value ` contains ` abi.encode(uint16) ` representing threshold in basis points (0-10000)
189
+ - Example: 6667 = 66.67% stake required
190
+ - Certificate verification will fail if threshold is not met
191
+
146
192
#### ` setExecutorOperatorSetTaskConfig `
147
193
148
194
``` solidity
@@ -178,6 +224,38 @@ Configures how tasks should be executed by a specific operator set. The configur
178
224
* Consensus type and curve type must be valid
179
225
* Consensus value must be properly formatted
180
226
227
+ ** Example Configuration:**
228
+
229
+ ``` solidity
230
+ // Example 1: Configure with 66.67% stake threshold
231
+ ExecutorOperatorSetTaskConfig memory config = ExecutorOperatorSetTaskConfig({
232
+ taskHook: IAVSTaskHook(0x...),
233
+ taskSLA: 3600, // 1 hour
234
+ feeToken: IERC20(0x...),
235
+ feeCollector: 0x...,
236
+ curveType: CurveType.BN254,
237
+ consensus: Consensus({
238
+ consensusType: ConsensusType.STAKE_PROPORTION_THRESHOLD,
239
+ value: abi.encode(uint16(6667)) // 66.67%
240
+ }),
241
+ taskMetadata: bytes("")
242
+ });
243
+
244
+ // Example 2: Configure with NONE consensus (AVS handles validation)
245
+ ExecutorOperatorSetTaskConfig memory config = ExecutorOperatorSetTaskConfig({
246
+ taskHook: IAVSTaskHook(0x...),
247
+ taskSLA: 3600,
248
+ feeToken: IERC20(address(0)), // No fees
249
+ feeCollector: address(0),
250
+ curveType: CurveType.ECDSA,
251
+ consensus: Consensus({
252
+ consensusType: ConsensusType.NONE,
253
+ value: bytes("") // Must be empty
254
+ }),
255
+ taskMetadata: bytes("")
256
+ });
257
+ ```
258
+
181
259
#### ` registerExecutorOperatorSet `
182
260
183
261
``` solidity
@@ -232,9 +310,16 @@ Submits the result of task execution along with proof of consensus. The method:
232
310
233
311
1 . Validates the task exists and hasn't expired or been verified
234
312
2 . Calls AVS hook for pre-submission validation
235
- 3 . Verifies the certificate based on the configured curve type:
236
- - ** BN254** : Verifies aggregated BLS signature
237
- - ** ECDSA** : Verifies individual ECDSA signatures meet threshold
313
+ 3 . Verifies the certificate based on both curve type and consensus type:
314
+ - ** ConsensusType.NONE** :
315
+ - Validates certificate fields (reference timestamp, message hash, non-empty signature)
316
+ - Calls certificate verifier to validate signature authenticity
317
+ - Does NOT enforce any stake threshold requirements
318
+ - AVS can implement custom consensus logic in ` handlePostTaskResultSubmission `
319
+ - ** ConsensusType.STAKE_PROPORTION_THRESHOLD** :
320
+ - Performs all validations from NONE
321
+ - Additionally verifies that signers meet the configured stake threshold
322
+ - Uses ` verifyCertificateProportion ` to ensure minimum stake percentage signed
238
323
4 . Distributes fees according to fee split configuration
239
324
5 . Stores the result and marks task as verified
240
325
6 . Calls AVS hook for post-submission handling
@@ -250,7 +335,7 @@ Submits the result of task execution along with proof of consensus. The method:
250
335
* Task must exist and be in CREATED status
251
336
* Current timestamp must be after task creation time
252
337
* Certificate must have valid signature(s)
253
- * Certificate verification must pass consensus threshold
338
+ * Certificate verification must pass consensus threshold (reverts with ` ThresholdNotMet ` if not)
254
339
* AVS validation must pass
255
340
256
341
#### ` getTaskResult `
@@ -379,7 +464,10 @@ interface IAVSTaskHook {
379
464
) external view;
380
465
381
466
// Called after successful result submission for any side effects
382
- function handlePostTaskResultSubmission(bytes32 taskHash) external;
467
+ function handlePostTaskResultSubmission(
468
+ address caller,
469
+ bytes32 taskHash
470
+ ) external;
383
471
384
472
// Calculates the fee for a task based on its parameters
385
473
function calculateTaskFee(
0 commit comments