Browse Source

all: name reactors when they are initialized (#4608)

Previously, many reactors were initialized with the name "Reactor," which made it difficult to log which reactor was doing what. This changes those reactors' names to something more descriptive.
pull/4612/head
Tess Rinearson 5 years ago
committed by GitHub
parent
commit
ccf53a2276
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 5 deletions
  1. +1
    -0
      CHANGELOG_PENDING.md
  2. +1
    -1
      consensus/reactor.go
  3. +1
    -1
      evidence/reactor.go
  4. +1
    -1
      mempool/reactor.go
  5. +1
    -1
      p2p/mock/reactor.go
  6. +1
    -1
      p2p/pex/pex_reactor.go

+ 1
- 0
CHANGELOG_PENDING.md View File

@ -22,6 +22,7 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi
- [privval] \#4534 Add `error` as a return value on`GetPubKey()`
- [Docker] \#4569 Default configuration added to docker image (you can still mount your own config the same way) (@greg-szabo)
- [lite2] [\#4562](https://github.com/tendermint/tendermint/pull/4562) Cache headers when using bisection (@cmwaters)
- [all] [\4608](https://github.com/tendermint/tendermint/pull/4608) Give reactors descriptive names when they're initialized
### BUG FIXES:


+ 1
- 1
consensus/reactor.go View File

@ -58,7 +58,7 @@ func NewReactor(consensusState *State, fastSync bool, options ...ReactorOption)
metrics: NopMetrics(),
}
conR.updateFastSyncingMetric()
conR.BaseReactor = *p2p.NewBaseReactor("Reactor", conR)
conR.BaseReactor = *p2p.NewBaseReactor("Consensus", conR)
for _, option := range options {
option(conR)


+ 1
- 1
evidence/reactor.go View File

@ -34,7 +34,7 @@ func NewReactor(evpool *Pool) *Reactor {
evR := &Reactor{
evpool: evpool,
}
evR.BaseReactor = *p2p.NewBaseReactor("Reactor", evR)
evR.BaseReactor = *p2p.NewBaseReactor("Evidence", evR)
return evR
}


+ 1
- 1
mempool/reactor.go View File

@ -110,7 +110,7 @@ func NewReactor(config *cfg.MempoolConfig, mempool *CListMempool) *Reactor {
mempool: mempool,
ids: newMempoolIDs(),
}
memR.BaseReactor = *p2p.NewBaseReactor("Reactor", memR)
memR.BaseReactor = *p2p.NewBaseReactor("Mempool", memR)
return memR
}


+ 1
- 1
p2p/mock/reactor.go View File

@ -12,7 +12,7 @@ type Reactor struct {
func NewReactor() *Reactor {
r := &Reactor{}
r.BaseReactor = *p2p.NewBaseReactor("Reactor", r)
r.BaseReactor = *p2p.NewBaseReactor("Mock-PEX", r)
r.SetLogger(log.TestingLogger())
return r
}


+ 1
- 1
p2p/pex/pex_reactor.go View File

@ -141,7 +141,7 @@ func NewReactor(b AddrBook, config *ReactorConfig) *Reactor {
lastReceivedRequests: cmap.NewCMap(),
crawlPeerInfos: make(map[p2p.ID]crawlPeerInfo),
}
r.BaseReactor = *p2p.NewBaseReactor("Reactor", r)
r.BaseReactor = *p2p.NewBaseReactor("PEX", r)
return r
}


Loading…
Cancel
Save