mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 06:31:57 +00:00
info->notice, debug->info
This commit is contained in:
+4
-4
@@ -71,14 +71,14 @@ func NewBlockPool(start int, requestsCh chan<- BlockRequest, timeoutsCh chan<- s
|
||||
|
||||
func (pool *BlockPool) Start() {
|
||||
if atomic.CompareAndSwapInt32(&pool.running, 0, 1) {
|
||||
log.Info("Starting BlockPool")
|
||||
log.Notice("Starting BlockPool")
|
||||
go pool.run()
|
||||
}
|
||||
}
|
||||
|
||||
func (pool *BlockPool) Stop() {
|
||||
if atomic.CompareAndSwapInt32(&pool.running, 1, 0) {
|
||||
log.Info("Stopping BlockPool")
|
||||
log.Notice("Stopping BlockPool")
|
||||
pool.repeater.Stop()
|
||||
}
|
||||
}
|
||||
@@ -354,12 +354,12 @@ func requestRoutine(pool *BlockPool, height int) {
|
||||
PICK_LOOP:
|
||||
for {
|
||||
if !pool.IsRunning() {
|
||||
log.Debug("BlockPool not running. Stopping requestRoutine", "height", height)
|
||||
log.Info("BlockPool not running. Stopping requestRoutine", "height", height)
|
||||
return
|
||||
}
|
||||
peer = pool.pickIncrAvailablePeer(height)
|
||||
if peer == nil {
|
||||
//log.Debug("No peers available", "height", height)
|
||||
//log.Info("No peers available", "height", height)
|
||||
time.Sleep(requestIntervalMS * time.Millisecond)
|
||||
continue PICK_LOOP
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ func TestBasic(t *testing.T) {
|
||||
case peerId := <-timeoutsCh:
|
||||
t.Errorf("timeout: %v", peerId)
|
||||
case request := <-requestsCh:
|
||||
log.Debug("TEST: Pulled new BlockRequest", "request", request)
|
||||
log.Info("TEST: Pulled new BlockRequest", "request", request)
|
||||
if request.Height == 300 {
|
||||
return // Done!
|
||||
}
|
||||
@@ -68,7 +68,7 @@ func TestBasic(t *testing.T) {
|
||||
go func() {
|
||||
block := &types.Block{Header: &types.Header{Height: request.Height}}
|
||||
pool.AddBlock(block, request.PeerId)
|
||||
log.Debug("TEST: Added block", "block", request.Height, "peer", request.PeerId)
|
||||
log.Info("TEST: Added block", "block", request.Height, "peer", request.PeerId)
|
||||
}()
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,7 @@ func TestTimeout(t *testing.T) {
|
||||
for {
|
||||
select {
|
||||
case peerId := <-timeoutsCh:
|
||||
log.Debug("Timeout", "peerId", peerId)
|
||||
log.Info("Timeout", "peerId", peerId)
|
||||
if _, ok := timedOut[peerId]; !ok {
|
||||
counter++
|
||||
if counter == len(peers) {
|
||||
@@ -120,7 +120,7 @@ func TestTimeout(t *testing.T) {
|
||||
}
|
||||
}
|
||||
case request := <-requestsCh:
|
||||
log.Debug("TEST: Pulled new BlockRequest", "request", request)
|
||||
log.Info("TEST: Pulled new BlockRequest", "request", request)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ func NewBlockchainReactor(state *sm.State, store *BlockStore, sync bool) *Blockc
|
||||
// Implements Reactor
|
||||
func (bcR *BlockchainReactor) Start(sw *p2p.Switch) {
|
||||
if atomic.CompareAndSwapUint32(&bcR.running, 0, 1) {
|
||||
log.Info("Starting BlockchainReactor")
|
||||
log.Notice("Starting BlockchainReactor")
|
||||
bcR.sw = sw
|
||||
if bcR.sync {
|
||||
bcR.pool.Start()
|
||||
@@ -95,7 +95,7 @@ func (bcR *BlockchainReactor) Start(sw *p2p.Switch) {
|
||||
// Implements Reactor
|
||||
func (bcR *BlockchainReactor) Stop() {
|
||||
if atomic.CompareAndSwapUint32(&bcR.running, 1, 0) {
|
||||
log.Info("Stopping BlockchainReactor")
|
||||
log.Notice("Stopping BlockchainReactor")
|
||||
close(bcR.quit)
|
||||
bcR.pool.Stop()
|
||||
}
|
||||
@@ -132,7 +132,7 @@ func (bcR *BlockchainReactor) Receive(chId byte, src *p2p.Peer, msgBytes []byte)
|
||||
return
|
||||
}
|
||||
|
||||
log.Info("Received message", "msg", msg)
|
||||
log.Notice("Received message", "msg", msg)
|
||||
|
||||
switch msg := msg.(type) {
|
||||
case *bcBlockRequestMessage:
|
||||
@@ -201,7 +201,7 @@ FOR_LOOP:
|
||||
case _ = <-switchToConsensusTicker.C:
|
||||
height, numPending, numUnassigned := bcR.pool.GetStatus()
|
||||
outbound, inbound, _ := bcR.sw.NumPeers()
|
||||
log.Debug("Consensus ticker", "numUnassigned", numUnassigned, "numPending", numPending,
|
||||
log.Info("Consensus ticker", "numUnassigned", numUnassigned, "numPending", numPending,
|
||||
"total", len(bcR.pool.requests), "outbound", outbound, "inbound", inbound)
|
||||
// NOTE: this condition is very strict right now. may need to weaken
|
||||
// If all `maxPendingRequests` requests are unassigned
|
||||
@@ -210,7 +210,7 @@ FOR_LOOP:
|
||||
allUnassigned := numPending == numUnassigned
|
||||
enoughPeers := outbound+inbound >= 3
|
||||
if maxPending && allUnassigned && enoughPeers {
|
||||
log.Info("Time to switch to consensus reactor!", "height", height)
|
||||
log.Notice("Time to switch to consensus reactor!", "height", height)
|
||||
bcR.pool.Stop()
|
||||
|
||||
conR := bcR.sw.Reactor("CONSENSUS").(consensusReactor)
|
||||
@@ -224,7 +224,7 @@ FOR_LOOP:
|
||||
for i := 0; i < 10; i++ {
|
||||
// See if there are any blocks to sync.
|
||||
first, second := bcR.pool.PeekTwoBlocks()
|
||||
//log.Debug("TrySync peeked", "first", first, "second", second)
|
||||
//log.Info("TrySync peeked", "first", first, "second", second)
|
||||
if first == nil || second == nil {
|
||||
// We need both to sync the first block.
|
||||
break SYNC_LOOP
|
||||
@@ -235,7 +235,7 @@ FOR_LOOP:
|
||||
err := bcR.state.BondedValidators.VerifyValidation(
|
||||
bcR.state.ChainID, first.Hash(), firstPartsHeader, first.Height, second.LastValidation)
|
||||
if err != nil {
|
||||
log.Debug("error in validation", "error", err)
|
||||
log.Info("error in validation", "error", err)
|
||||
bcR.pool.RedoRequest(first.Height)
|
||||
break SYNC_LOOP
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user