aboutsummaryrefslogtreecommitdiffstats
path: root/core/syncer
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-12-26 15:23:54 +0800
committerGitHub <noreply@github.com>2018-12-26 15:23:54 +0800
commit39c02fe0f7c81491ea897fafcf32595d280bbdbe (patch)
tree1ac3d002de42bb7471624656713e331db55aaea2 /core/syncer
parent00416c9df2fec5398389863fb6f885a1fe11a6cc (diff)
downloaddexon-consensus-39c02fe0f7c81491ea897fafcf32595d280bbdbe.tar
dexon-consensus-39c02fe0f7c81491ea897fafcf32595d280bbdbe.tar.gz
dexon-consensus-39c02fe0f7c81491ea897fafcf32595d280bbdbe.tar.bz2
dexon-consensus-39c02fe0f7c81491ea897fafcf32595d280bbdbe.tar.lz
dexon-consensus-39c02fe0f7c81491ea897fafcf32595d280bbdbe.tar.xz
dexon-consensus-39c02fe0f7c81491ea897fafcf32595d280bbdbe.tar.zst
dexon-consensus-39c02fe0f7c81491ea897fafcf32595d280bbdbe.zip
core: fix stuffs (#383)
* Merge core.Consensus constructors * Downgrade severity of logs * Refine logic to add blocks from pool to lattice * Add test.LaunchDummyReceiver
Diffstat (limited to 'core/syncer')
-rw-r--r--core/syncer/agreement.go4
-rw-r--r--core/syncer/consensus.go12
2 files changed, 8 insertions, 8 deletions
diff --git a/core/syncer/agreement.go b/core/syncer/agreement.go
index fee4624..32ea654 100644
--- a/core/syncer/agreement.go
+++ b/core/syncer/agreement.go
@@ -106,7 +106,7 @@ func (a *agreement) processBlock(b *types.Block) {
func (a *agreement) processAgreementResult(r *types.AgreementResult) {
// Cache those results that CRS is not ready yet.
if _, exists := a.confirmedBlocks[r.BlockHash]; exists {
- a.logger.Info("agreement result already confirmed", "result", r)
+ a.logger.Debug("agreement result already confirmed", "result", r)
return
}
if r.Position.Round > a.latestCRSRound {
@@ -116,7 +116,7 @@ func (a *agreement) processAgreementResult(r *types.AgreementResult) {
a.pendings[r.Position.Round] = pendingsForRound
}
pendingsForRound[r.BlockHash] = r
- a.logger.Info("agreement result cached", "result", r)
+ a.logger.Debug("agreement result cached", "result", r)
return
}
if err := core.VerifyAgreementResult(r, a.cache); err != nil {
diff --git a/core/syncer/consensus.go b/core/syncer/consensus.go
index 32bbab3..c767a6d 100644
--- a/core/syncer/consensus.go
+++ b/core/syncer/consensus.go
@@ -153,7 +153,7 @@ func (con *Consensus) checkIfValidated() bool {
if validatedChainCount == numChains {
return true
}
- con.logger.Info("not validated yet", "validated-chain", validatedChainCount)
+ con.logger.Debug("not validated yet", "validated-chain", validatedChainCount)
return false
}
@@ -197,7 +197,7 @@ func (con *Consensus) checkIfSynced(blocks []*types.Block) bool {
if overlapCount == numChains {
return true
}
- con.logger.Info("not synced yet",
+ con.logger.Debug("not synced yet",
"overlap-count", overlapCount,
"num-chain", numChains,
"last-block", blocks[len(blocks)-1])
@@ -262,7 +262,7 @@ func (con *Consensus) ensureAgreementOverlapRound() bool {
}
if tipRoundMap[r] == con.configs[r].NumChains {
con.agreementRoundCut = r
- con.logger.Info("agreement round cut found, round", r)
+ con.logger.Debug("agreement round cut found, round", r)
return true
}
}
@@ -411,7 +411,7 @@ func (con *Consensus) SyncBlocks(
"expected", tipHeight+1)
return false, ErrInvalidSyncingFinalizationHeight
}
- con.logger.Info("syncBlocks",
+ con.logger.Debug("syncBlocks",
"position", &blocks[0].Position,
"final height", blocks[0].Finalization.Height,
"len", len(blocks),
@@ -446,7 +446,7 @@ func (con *Consensus) SyncBlocks(
return false, err
}
if syncBlock != nil {
- con.logger.Info("deliver set found", "block", syncBlock)
+ con.logger.Debug("deliver set found", "block", syncBlock)
// New lattice with the round of syncBlock.
con.initConsensusObj(syncBlock)
con.setupConfigs(blocks)
@@ -700,7 +700,7 @@ func (con *Consensus) startCRSMonitor() {
if round == lastNotifiedRound {
return
}
- con.logger.Info("CRS is ready", "round", round)
+ con.logger.Debug("CRS is ready", "round", round)
con.lock.RLock()
defer con.lock.RUnlock()
lastNotifiedRound = round