From 56d4bc2b1bb897fdc97fc5adee4caf11c6e968f3 Mon Sep 17 00:00:00 2001 From: Rongjian Lan Date: Thu, 5 Nov 2020 14:40:23 -0800 Subject: [PATCH] fix comment --- api/service/syncing/syncing.go | 3 --- consensus/consensus_v2.go | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/service/syncing/syncing.go b/api/service/syncing/syncing.go index 187501d5c..167226f92 100644 --- a/api/service/syncing/syncing.go +++ b/api/service/syncing/syncing.go @@ -29,14 +29,11 @@ import ( // Constants for syncing. const ( downloadBlocksRetryLimit = 5 // downloadBlocks service retry limit - TimesToFail = 5 // downloadBlocks service retry limit RegistrationNumber = 3 SyncingPortDifference = 3000 inSyncThreshold = 0 // when peerBlockHeight - myBlockHeight <= inSyncThreshold, it's ready to join consensus - syncStatusCheckCount = 3 // check this many times before confirming it's out of sync SyncLoopBatchSize uint32 = 1000 // maximum size for one query of block hashes verifyHeaderBatchSize uint64 = 100 // block chain header verification batch size - SyncLoopFrequency = 1 // unit in second LastMileBlocksSize = 50 // after cutting off a number of connected peers, the result number of peers diff --git a/consensus/consensus_v2.go b/consensus/consensus_v2.go index 29e7f4433..067f980c2 100644 --- a/consensus/consensus_v2.go +++ b/consensus/consensus_v2.go @@ -158,6 +158,9 @@ func (consensus *Consensus) finalCommit() { } // if leader successfully finalizes the block, send committed message to validators + // Note: leader already sent 67% commit in preCommit. The 100% commit won't be sent immediately + // to save network traffic. It will only be sent in retry if consensus doesn't move forward. + // Or if the leader is changed for next block, the 100% committed sig will be sent to the next leader immediately. sendImmediately := false if !consensus.IsLeader() || block.IsLastBlockInEpoch() { sendImmediately = true