From e36477f4f89999b957f39c5a7901e220479c5b2d 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 | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/contracts/contracts/coordination/Coordinator.sol b/contracts/contracts/coordination/Coordinator.sol index 5beb08cc..8cb09626 100644 --- a/contracts/contracts/coordination/Coordinator.sol +++ b/contracts/contracts/coordination/Coordinator.sol @@ -19,7 +19,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 @@ -52,7 +51,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; } @@ -138,11 +137,11 @@ contract Coordinator is AccessControlDefaultAdminRules, FlatRateFeeModel { return RitualState.AWAITING_AGGREGATIONS; // solhint-disable-next-line no-empty-blocks } 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); } } @@ -260,7 +259,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; } @@ -288,7 +286,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++; @@ -362,7 +360,6 @@ contract Coordinator is AccessControlDefaultAdminRules, FlatRateFeeModel { )); ritualPublicKeyRegistry[registryKey] = ritualId + 1; emit EndRitual({ritualId: ritualId, successful: true}); - // TODO: Consider including public key in event } } @@ -419,8 +416,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); } } @@ -452,7 +448,6 @@ contract Coordinator is AccessControlDefaultAdminRules, FlatRateFeeModel { function processReimbursement(uint256 initialGasLeft) internal { if (address(reimbursementPool) != address(0)) { - // TODO: Consider defining a method uint256 gasUsed = initialGasLeft - gasleft(); try reimbursementPool.refund(gasUsed, msg.sender) { return;