Skip to content

Commit

Permalink
add morelogs
Browse files Browse the repository at this point in the history
  • Loading branch information
acud committed Oct 9, 2024
1 parent f9e2bb0 commit 9fb7760
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hare4/hare.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,13 @@ func (h *Hare) Handler(ctx context.Context, peer p2p.Peer, buf []byte) error {
if msg.IterRound.Round == preround {
// this will mutate the message to conform to the (hopefully)
// original sent message for signature validation to occur
h.log.Info("got preround message with compacts", zap.Int("nr compacts", len(compacts)), zap.Inline(msg))
compacts = msg.Value.CompactProposals
messageCompactsCounter.Add(float64(len(compacts)))
err := h.reconstructProposals(ctx, peer, msgId, msg)
switch {
case errors.Is(err, errCannotMatchProposals):
h.log.Info("preround message but couldn't reconstruct", zap.Int("nr compacts", len(compacts)), zap.Inline(msg))
msg.Value.Proposals, err = h.fetchFull(ctx, peer, msgId)
if err != nil {
return fmt.Errorf("fetch full: %w", err)
Expand All @@ -487,6 +489,7 @@ func (h *Hare) Handler(ctx context.Context, peer p2p.Peer, buf []byte) error {
msg.Value.CompactProposals = []types.CompactProposalID{}
fetched = true
case err != nil:
h.log.Info("preround message reconstruct failed", zap.Error(err))
return fmt.Errorf("reconstruct proposals: %w", err)
}
}
Expand Down

0 comments on commit 9fb7760

Please sign in to comment.