mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-30 19:51:58 +00:00
Log which commits are being sent for catchup
This commit is contained in:
@@ -396,26 +396,30 @@ OUTER_LOOP:
|
||||
// which contains commit signatures for prs.Height.
|
||||
header, validation := conR.conS.LoadHeaderValidation(prs.Height + 1)
|
||||
size := uint(len(validation.Commits))
|
||||
log.Debug("Loaded HeaderValidation for catchup", "height", prs.Height+1, "header", header, "validation", validation, "size", size)
|
||||
|
||||
// Initialize Commits if needed
|
||||
ps.EnsureVoteBitArrays(prs.Height, size)
|
||||
|
||||
index, ok := validation.BitArray().Sub(prs.Commits).PickRandom()
|
||||
if ok {
|
||||
rsig := validation.Commits[index]
|
||||
commit := validation.Commits[index]
|
||||
log.Debug("Picked commit to send", "index", index, "commit", commit)
|
||||
// Reconstruct vote.
|
||||
vote := &Vote{
|
||||
Height: prs.Height,
|
||||
Round: rsig.Round,
|
||||
Round: commit.Round,
|
||||
Type: VoteTypeCommit,
|
||||
BlockHash: header.LastBlockHash,
|
||||
BlockParts: header.LastBlockParts,
|
||||
Signature: rsig.Signature,
|
||||
Signature: commit.Signature,
|
||||
}
|
||||
msg := &VoteMessage{index, vote}
|
||||
peer.Send(VoteCh, msg)
|
||||
ps.SetHasVote(vote, index)
|
||||
continue OUTER_LOOP
|
||||
} else {
|
||||
log.Debug("No commits to send", "ours", validation.BitArray(), "theirs", prs.Commits)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -362,16 +362,17 @@ FOR_LOOP:
|
||||
c.recvMonitor.Limit(maxMsgPacketSize, atomic.LoadInt64(&c.recvRate), true)
|
||||
|
||||
// Peek into bufReader for debugging
|
||||
log.Debug("Peek connection buffer", "bytes", log15.Lazy{func() []byte {
|
||||
numBytes := c.bufReader.Buffered()
|
||||
bytes, err := c.bufReader.Peek(MinInt(numBytes, 100))
|
||||
if err == nil {
|
||||
return bytes
|
||||
} else {
|
||||
log.Warn("Error peeking connection buffer", "error", err)
|
||||
return nil
|
||||
}
|
||||
}})
|
||||
if numBytes := c.bufReader.Buffered(); numBytes > 0 {
|
||||
log.Debug("Peek connection buffer", "bytes", log15.Lazy{func() []byte {
|
||||
bytes, err := c.bufReader.Peek(MinInt(numBytes, 100))
|
||||
if err == nil {
|
||||
return bytes
|
||||
} else {
|
||||
log.Warn("Error peeking connection buffer", "error", err)
|
||||
return nil
|
||||
}
|
||||
}})
|
||||
}
|
||||
|
||||
// Read packet type
|
||||
var n int64
|
||||
|
Reference in New Issue
Block a user