diff options
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/syncer/consensus.go')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/syncer/consensus.go | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/syncer/consensus.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/syncer/consensus.go index d334bbd88..92f8fd8d0 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/syncer/consensus.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/syncer/consensus.go @@ -262,12 +262,12 @@ func (con *Consensus) ensureAgreementOverlapRound() bool { for r = range tipRoundMap { break } - con.logger.Info("check agreement round cut", + con.logger.Debug("check agreement round cut", "tip-round", r, "configs", len(con.configs)) if tipRoundMap[r] == con.configs[r].NumChains { con.agreementRoundCut = r - con.logger.Debug("agreement round cut found, round", r) + con.logger.Info("agreement round cut found, round", r) return true } } @@ -416,7 +416,7 @@ func (con *Consensus) SyncBlocks( "expected", tipHeight+1) return false, ErrInvalidSyncingFinalizationHeight } - con.logger.Debug("syncBlocks", + con.logger.Trace("syncBlocks", "position", &blocks[0].Position, "final height", blocks[0].Finalization.Height, "len", len(blocks), @@ -601,7 +601,7 @@ func (con *Consensus) setupConfigs(blocks []*types.Block) { maxRound = b.Position.Round } } - con.logger.Info("syncer setupConfigs", + con.logger.Debug("syncer setupConfigs", "max", maxRound, "lattice", con.latticeLastRound) // Get configs from governance. @@ -623,10 +623,13 @@ func (con *Consensus) resizeByNumChains(numChains uint32) { // Resize the pool of blocks. con.blocks = append(con.blocks, types.ByPosition{}) // Resize agreement modules. - a := newAgreement(con.receiveChan, con.pullChan, con.nodeSetCache, - &con.agreementWaitGroup, con.logger) + a := newAgreement(con.receiveChan, con.pullChan, con.nodeSetCache, con.logger) con.agreements = append(con.agreements, a) - go a.run() + con.agreementWaitGroup.Add(1) + go func() { + defer con.agreementWaitGroup.Done() + a.run() + }() } } } @@ -734,7 +737,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) lastNotifiedRound = round for _, a := range con.agreements { a.inputChan <- round |