diff --git a/src/agents/coordinator.ts b/src/agents/coordinator.ts index c0b1a9d19..03c49b9e9 100644 --- a/src/agents/coordinator.ts +++ b/src/agents/coordinator.ts @@ -24,7 +24,6 @@ export interface CoordinatorRitual { export type DkgParticipant = { provider: string; aggregated: boolean; - // TODO: How do I get the transcript from the Coordinator? transcript: Transcript; decryptionRequestStaticKey: SessionStaticKey; }; diff --git a/src/characters/cbd-recipient.ts b/src/characters/cbd-recipient.ts index 6e69253d3..8280eb0c8 100644 --- a/src/characters/cbd-recipient.ts +++ b/src/characters/cbd-recipient.ts @@ -57,13 +57,15 @@ export class CbdTDecDecrypter { provider: ethers.providers.Web3Provider, conditionExpr: ConditionExpression, variant: FerveoVariant, - ciphertext: Ciphertext + ciphertext: Ciphertext, + verifyRitual = true ): Promise { const decryptionShares = await this.retrieve( provider, conditionExpr, variant, - ciphertext + ciphertext, + verifyRitual ); const combineDecryptionSharesFn = @@ -81,7 +83,8 @@ export class CbdTDecDecrypter { web3Provider: ethers.providers.Web3Provider, conditionExpr: ConditionExpression, variant: number, - ciphertext: Ciphertext + ciphertext: Ciphertext, + verifyRitual = true ): Promise { const ritualState = await DkgCoordinatorAgent.getRitualState( web3Provider, @@ -93,14 +96,16 @@ export class CbdTDecDecrypter { ); } - const isLocallyVerified = await DkgClient.verifyRitual( - web3Provider, - this.ritualId - ); - if (!isLocallyVerified) { - throw new Error( - `Ritual with id ${this.ritualId} has failed local verification.` + if (verifyRitual) { + const isLocallyVerified = await DkgClient.verifyRitual( + web3Provider, + this.ritualId ); + if (!isLocallyVerified) { + throw new Error( + `Ritual with id ${this.ritualId} has failed local verification.` + ); + } } const dkgParticipants = await DkgCoordinatorAgent.getParticipants( diff --git a/src/dkg.ts b/src/dkg.ts index 8d10d97ef..9108d105b 100644 --- a/src/dkg.ts +++ b/src/dkg.ts @@ -122,14 +122,6 @@ export class DkgClient { ritualId ); - // TODO: Does this check make sense here? Or do we delegate it to the Coordinator contract? - // for (const p of participants) { - // // Not every participant has submitted a transcript - // if (!p.aggregated) { - // return false; - // } - // } - const validatorMessages = participants.map((p) => { const validatorAddress = EthereumAddress.fromString(p.provider); // TODO: Replace with real keys