Skip to content

Commit a1df1a6

Browse files
fix: Multichain (Pt 2) fixes (#1549)
**Motivation:** Results of internal review of the contracts primarily involved with offchain/onchain interaction **Modifications:** * Add reentrancy guard to `OperatorTableUpdater` * Add miscellaneous documentation surrounding design decisions * Misc fixes **Result:** Cleaner and safer code --------- Co-authored-by: Yash Patil <[email protected]>
1 parent 1c1fb9d commit a1df1a6

File tree

14 files changed

+105
-85
lines changed

14 files changed

+105
-85
lines changed

docs/multichain/destination/CertificateVerifier.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,14 @@ Verifies an ECDSA certificate by checking individual signatures from operators.
145145

146146
*Requirements*:
147147
* The certificate MUST NOT be stale (based on `maxStalenessPeriod`)
148-
* The root at `referenceTimestamp` MUST be valid (not disabled)
149-
* The operator table MUST exist for the `referenceTimestamp`
148+
* The root at `referenceTimestamp` MUST exist
149+
* The root at `referenceTimestamp` MUST be valid
150150
* Signatures MUST be proper length
151+
* Each signature MUST be valid
151152
* Signatures MUST be ordered by signer address (ascending)
153+
* The operatorSet MUST be updated for the `referenceTimestamp`
154+
* There must be a nonzero number of operators for the `referenceTimestamp`
152155
* All signers MUST be registered operators
153-
* Each signature MUST be valid
154156

155157
#### `verifyCertificateProportion`
156158

@@ -401,9 +403,11 @@ Verifies a BN254 certificate by checking the aggregated signature against the op
401403

402404
*Requirements*:
403405
* The certificate MUST NOT be stale (based on `maxStalenessPeriod`)
404-
* The root at `referenceTimestamp` MUST be valid (not disabled)
406+
* The root at the `referenceTimestamp` MUST exist
407+
* The root at the `referenceTimestamp` MUST not be disabled
405408
* The operator set info MUST exist for the `referenceTimestamp`
406-
* All merkle proofs MUST be valid
409+
* The `operatorIndex` must be valid for the non signer
410+
* All merkle proofs for nonsigners MUST be valid
407411
* The BLS signature MUST verify correctly
408412

409413
#### `verifyCertificateProportion`
@@ -528,6 +532,6 @@ The operator table is updated every 10 days. The staleness period is 5 days. The
528532
1. Day 1: Table updated
529533
2. Day 2: Certificate passes
530534
3. Day 6: Certificate verification *fails*
531-
4. Day 7: A certificate is re-generated. However, this will stale fail as the `referenceTimestamp` would still be day 1 given that was the latest table update
535+
4. Day 7: A new certificate is generated. However, this will fail as the `referenceTimestamp` would still be Day 1 given that was the latest table update
532536

533537
Note that we cannot re-generate a certificate on Day 7. This is why we prevent the `stalenessPeriod` from being less than 10 days in the `CrossChainRegistry`.

docs/multichain/destination/OperatorTableUpdater.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Upon initialization, the `generator` is updated. The `generator` is represented
2323

2424
The following values are set upon initialization:
2525

26-
* `generator` is an EigenLabs-run entity that signs off on `globalTableRoots`. The operatorSet is of size 1.
26+
* `generator` is an EigenLabs-run entity that signs off on `globalTableRoots`. The operatorSet is of size 1. The `generator` is always expected to use BN254 signing keys, hence the use of the BN254OperatorSetInfo when setting the generator.
2727
* `globalRootConfirmationThreshold`: 10000. The threshold in basis points required for global root confirmation. Since the operatorSet is of size 1 a single signature is needed.
2828
* `generatorInfo`: The key material needed to verify certificates of the `generator`
2929
* `operatorSetConfig`: A configuration for the `generator`

docs/multichain/source/CrossChainRegistry.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ function createGenerationReservation(
6868

6969
Creates a generation reservation for a given `operatorSet`, which enables the operatorSet to be included in the `GlobalTableRoot` generation and transported to all destination chains. This function sets up the complete configuration for cross-chain operations in a single transaction.
7070

71+
Note that the `operatorTableCalculator` must be deployed by the AVS onto the source chain prior to calling this function.
72+
7173
*Effects*:
7274
* Adds the `operatorSet` to `_activeGenerationReservations`
7375
* Sets the `operatorTableCalculator` for the `operatorSet`
@@ -81,8 +83,6 @@ Creates a generation reservation for a given `operatorSet`, which enables the op
8183
* Caller MUST be UAM permissioned for `operatorSet.avs`
8284
* The `operatorSet` MUST exist in the `AllocationManager`
8385
* A generation reservation MUST NOT already exist for the `operatorSet`
84-
* At least one `chainID` MUST be provided
85-
* All provided `chainIDs` MUST be whitelisted
8686

8787
### `removeGenerationReservation`
8888

@@ -134,7 +134,11 @@ function setOperatorTableCalculator(
134134
) external;
135135
```
136136

137-
Updates the `operatorTableCalculator` contract for a given `operatorSet`. The `operatorTableCalculator` is deployed by the AVS and is responsible for computing the operator table bytes that will be included in cross-chain transports. For more information on the `operatorTableCalculator`, please see full documentation in the [middleware repository](https://github.com/Layr-Labs/eigenlayer-middleware/tree/dev/docs).
137+
Updates the `operatorTableCalculator` contract for a given `operatorSet`. The `operatorTableCalculator` is deployed by the AVS and is responsible for computing the operator table bytes that will be included in cross-chain transports.
138+
139+
Note that, if the `operatorTableCalculator` fails to comply with the expected interface, the offchain transport system will simply ignore the active generation reservation for this operator set.
140+
141+
For more information on the `operatorTableCalculator`, please see full documentation in the [middleware repository](https://github.com/Layr-Labs/eigenlayer-middleware/tree/dev/docs).
138142

139143
*Effects*:
140144
* Updates the `_operatorTableCalculators` mapping for the `operatorSet`

pkg/bindings/BN254CertificateVerifier/binding.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/CrossChainRegistry/binding.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/ECDSACertificateVerifier/binding.go

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/ECDSACertificateVerifierStorage/binding.go

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/IECDSACertificateVerifier/binding.go

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/KeyRegistrar/binding.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)