From a2ad4676080724adf443aee02643785a4458ab52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=BA=C3=B1ez?= Date: Wed, 23 Aug 2023 11:22:51 +0200 Subject: [PATCH] Remove outdated TODOs --- contracts/contracts/coordination/Coordinator.sol | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/contracts/contracts/coordination/Coordinator.sol b/contracts/contracts/coordination/Coordinator.sol index fe05a435..07456b01 100644 --- a/contracts/contracts/coordination/Coordinator.sol +++ b/contracts/contracts/coordination/Coordinator.sol @@ -20,7 +20,6 @@ contract Coordinator is AccessControlDefaultAdminRules, FlatRateFeeModel { // Ritual event StartRitual(uint32 indexed ritualId, address indexed authority, address[] participants); event StartAggregationRound(uint32 indexed ritualId); - // TODO: Do we want the public key here? If so, we want 2 events or do we reuse this event? event EndRitual(uint32 indexed ritualId, bool successful); // Node @@ -45,7 +44,7 @@ contract Coordinator is AccessControlDefaultAdminRules, FlatRateFeeModel { struct Participant { address provider; bool aggregated; - bytes transcript; // TODO: Consider event processing complexity vs storage cost + bytes transcript; bytes decryptionRequestStaticKey; } @@ -129,11 +128,11 @@ contract Coordinator is AccessControlDefaultAdminRules, FlatRateFeeModel { } else if (ritual.totalAggregations < ritual.dkgSize) { return RitualState.AWAITING_AGGREGATIONS; } else { - // TODO: Is it possible to reach this state? + // It shouldn't be possible to reach this state: // - No public key // - All transcripts and all aggregations // - Still within the deadline - revert("Invalid ritual state"); + assert(false); } } @@ -253,7 +252,6 @@ contract Coordinator is AccessControlDefaultAdminRules, FlatRateFeeModel { processRitualPayment(id, providers, duration); - // TODO: Include cohort fingerprint in StartRitual event? emit StartRitual(id, ritual.authority, providers); return id; } @@ -287,7 +285,7 @@ contract Coordinator is AccessControlDefaultAdminRules, FlatRateFeeModel { // Nodes commit to their transcript bytes32 transcriptDigest = keccak256(transcript); - participant.transcript = transcript; // TODO: ??? + participant.transcript = transcript; emit TranscriptPosted(ritualId, provider, transcriptDigest); ritual.totalTranscripts++; @@ -373,7 +371,6 @@ contract Coordinator is AccessControlDefaultAdminRules, FlatRateFeeModel { ritualId: ritualId, successful: true }); - // TODO: Consider including public key in event } } @@ -426,8 +423,7 @@ contract Coordinator is AccessControlDefaultAdminRules, FlatRateFeeModel { uint256 ritualCost = getRitualInitiationCost(providers, duration); if (ritualCost > 0) { totalPendingFees += ritualCost; - assert(pendingFees[ritualId] == 0); // TODO: This is an invariant, not sure if actually needed - pendingFees[ritualId] += ritualCost; + pendingFees[ritualId] = ritualCost; currency.safeTransferFrom(msg.sender, address(this), ritualCost); } } @@ -458,7 +454,7 @@ contract Coordinator is AccessControlDefaultAdminRules, FlatRateFeeModel { } function processReimbursement(uint256 initialGasLeft) internal { - if (address(reimbursementPool) != address(0)) { // TODO: Consider defining a method + if (address(reimbursementPool) != address(0)) { uint256 gasUsed = initialGasLeft - gasleft(); try reimbursementPool.refund(gasUsed, msg.sender) { return;