Skip to content

Commit

Permalink
removed unnecessary logs and added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tbssajal committed Aug 4, 2022
1 parent 5bd58bd commit 53085f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Lachain.Consensus/HoneyBadger/HoneyBadger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ private void CheckResult()
new ProtocolResult<HoneyBadgerId, ISet<IRawShare>>(_honeyBadgerId, _result));
}

// TODO: (investigate) the share is comming from ReliableBroadcast and the shareId of the share should match the senderId
// of that ReliableBroadcast, otherwise we might replace one share with another in _receivedShares array
private void HandleCommonSubset(ProtocolResult<CommonSubsetId, ISet<EncryptedShare>> result)
{
Logger.LogTrace($"Common subset finished {result.From}");
Expand Down Expand Up @@ -160,6 +162,8 @@ private ConsensusMessage CreateDecryptedMessage(PartiallyDecryptedShare share)
return message;
}

// DecryptorId of the message should match the senderId, otherwise the message should be discarded
// because HoneyBadger does not accept two messages for same DecryptorId and shareId
// We need to handle this message carefully like how about decoding a random message with random length
// and the value of 'share.ShareId' needs to be checked. If it is out of range, it can throw exception
private void HandleDecryptedMessage(TPKEPartiallyDecryptedShareMessage msg, int senderId)
Expand Down
1 change: 0 additions & 1 deletion src/Lachain.Core/Consensus/EraBroadcaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ public void InternalRequest<TId, TInputType>(ProtocolRequest<TId, TInputType> re
}
}
}
else Logger.LogWarning($"protocol {request.To} not created? something went wrong");
}

public void InternalResponse<TId, TResultType>(ProtocolResult<TId, TResultType> result)
Expand Down

0 comments on commit 53085f2

Please sign in to comment.