Skip to content

Commit

Permalink
Remove outdated TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
cygnusv committed Aug 23, 2023
1 parent 2124aea commit a2ad467
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions contracts/contracts/coordination/Coordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}

Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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++;

Expand Down Expand Up @@ -373,7 +371,6 @@ contract Coordinator is AccessControlDefaultAdminRules, FlatRateFeeModel {
ritualId: ritualId,
successful: true
});
// TODO: Consider including public key in event
}
}

Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a2ad467

Please sign in to comment.