You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

393 lines
11 KiB

cleanup: Reduce and normalize import path aliasing. (#6975) The code in the Tendermint repository makes heavy use of import aliasing. This is made necessary by our extensive reuse of common base package names, and by repetition of similar names across different subdirectories. Unfortunately we have not been very consistent about which packages we alias in various circumstances, and the aliases we use vary. In the spirit of the advice in the style guide and https://github.com/golang/go/wiki/CodeReviewComments#imports, his change makes an effort to clean up and normalize import aliasing. This change makes no API or behavioral changes. It is a pure cleanup intended o help make the code more readable to developers (including myself) trying to understand what is being imported where. Only unexported names have been modified, and the changes were generated and applied mechanically with gofmt -r and comby, respecting the lexical and syntactic rules of Go. Even so, I did not fix every inconsistency. Where the changes would be too disruptive, I left it alone. The principles I followed in this cleanup are: - Remove aliases that restate the package name. - Remove aliases where the base package name is unambiguous. - Move overly-terse abbreviations from the import to the usage site. - Fix lexical issues (remove underscores, remove capitalization). - Fix import groupings to more closely match the style guide. - Group blank (side-effecting) imports and ensure they are commented. - Add aliases to multiple imports with the same base package name.
3 years ago
cleanup: Reduce and normalize import path aliasing. (#6975) The code in the Tendermint repository makes heavy use of import aliasing. This is made necessary by our extensive reuse of common base package names, and by repetition of similar names across different subdirectories. Unfortunately we have not been very consistent about which packages we alias in various circumstances, and the aliases we use vary. In the spirit of the advice in the style guide and https://github.com/golang/go/wiki/CodeReviewComments#imports, his change makes an effort to clean up and normalize import aliasing. This change makes no API or behavioral changes. It is a pure cleanup intended o help make the code more readable to developers (including myself) trying to understand what is being imported where. Only unexported names have been modified, and the changes were generated and applied mechanically with gofmt -r and comby, respecting the lexical and syntactic rules of Go. Even so, I did not fix every inconsistency. Where the changes would be too disruptive, I left it alone. The principles I followed in this cleanup are: - Remove aliases that restate the package name. - Remove aliases where the base package name is unambiguous. - Move overly-terse abbreviations from the import to the usage site. - Fix lexical issues (remove underscores, remove capitalization). - Fix import groupings to more closely match the style guide. - Group blank (side-effecting) imports and ensure they are commented. - Add aliases to multiple imports with the same base package name.
3 years ago
blockchain: Reorg reactor (#3561) * go routines in blockchain reactor * Added reference to the go routine diagram * Initial commit * cleanup * Undo testing_logger change, committed by mistake * Fix the test loggers * pulled some fsm code into pool.go * added pool tests * changes to the design added block requests under peer moved the request trigger in the reactor poolRoutine, triggered now by a ticker in general moved everything required for making block requests smarter in the poolRoutine added a simple map of heights to keep track of what will need to be requested next added a few more tests * send errors to FSM in a different channel than blocks send errors (RemovePeer) from switch on a different channel than the one receiving blocks renamed channels added more pool tests * more pool tests * lint errors * more tests * more tests * switch fast sync to new implementation * fixed data race in tests * cleanup * finished fsm tests * address golangci comments :) * address golangci comments :) * Added timeout on next block needed to advance * updating docs and cleanup * fix issue in test from previous cleanup * cleanup * Added termination scenarios, tests and more cleanup * small fixes to adr, comments and cleanup * Fix bug in sendRequest() If we tried to send a request to a peer not present in the switch, a missing continue statement caused the request to be blackholed in a peer that was removed and never retried. While this bug was manifesting, the reactor kept asking for other blocks that would be stored and never consumed. Added the number of unconsumed blocks in the math for requesting blocks ahead of current processing height so eventually there will be no more blocks requested until the already received ones are consumed. * remove bpPeer's didTimeout field * Use distinct err codes for peer timeout and FSM timeouts * Don't allow peers to update with lower height * review comments from Ethan and Zarko * some cleanup, renaming, comments * Move block execution in separate goroutine * Remove pool's numPending * review comments * fix lint, remove old blockchain reactor and duplicates in fsm tests * small reorg around peer after review comments * add the reactor spec * verify block only once * review comments * change to int for max number of pending requests * cleanup and godoc * Add configuration flag fast sync version * golangci fixes * fix config template * move both reactor versions under blockchain * cleanup, golint, renaming stuff * updated documentation, fixed more golint warnings * integrate with behavior package * sync with master * gofmt * add changelog_pending entry * move to improvments * suggestion to changelog entry
6 years ago
cleanup: Reduce and normalize import path aliasing. (#6975) The code in the Tendermint repository makes heavy use of import aliasing. This is made necessary by our extensive reuse of common base package names, and by repetition of similar names across different subdirectories. Unfortunately we have not been very consistent about which packages we alias in various circumstances, and the aliases we use vary. In the spirit of the advice in the style guide and https://github.com/golang/go/wiki/CodeReviewComments#imports, his change makes an effort to clean up and normalize import aliasing. This change makes no API or behavioral changes. It is a pure cleanup intended o help make the code more readable to developers (including myself) trying to understand what is being imported where. Only unexported names have been modified, and the changes were generated and applied mechanically with gofmt -r and comby, respecting the lexical and syntactic rules of Go. Even so, I did not fix every inconsistency. Where the changes would be too disruptive, I left it alone. The principles I followed in this cleanup are: - Remove aliases that restate the package name. - Remove aliases where the base package name is unambiguous. - Move overly-terse abbreviations from the import to the usage site. - Fix lexical issues (remove underscores, remove capitalization). - Fix import groupings to more closely match the style guide. - Group blank (side-effecting) imports and ensure they are commented. - Add aliases to multiple imports with the same base package name.
3 years ago
cleanup: Reduce and normalize import path aliasing. (#6975) The code in the Tendermint repository makes heavy use of import aliasing. This is made necessary by our extensive reuse of common base package names, and by repetition of similar names across different subdirectories. Unfortunately we have not been very consistent about which packages we alias in various circumstances, and the aliases we use vary. In the spirit of the advice in the style guide and https://github.com/golang/go/wiki/CodeReviewComments#imports, his change makes an effort to clean up and normalize import aliasing. This change makes no API or behavioral changes. It is a pure cleanup intended o help make the code more readable to developers (including myself) trying to understand what is being imported where. Only unexported names have been modified, and the changes were generated and applied mechanically with gofmt -r and comby, respecting the lexical and syntactic rules of Go. Even so, I did not fix every inconsistency. Where the changes would be too disruptive, I left it alone. The principles I followed in this cleanup are: - Remove aliases that restate the package name. - Remove aliases where the base package name is unambiguous. - Move overly-terse abbreviations from the import to the usage site. - Fix lexical issues (remove underscores, remove capitalization). - Fix import groupings to more closely match the style guide. - Group blank (side-effecting) imports and ensure they are commented. - Add aliases to multiple imports with the same base package name.
3 years ago
cleanup: Reduce and normalize import path aliasing. (#6975) The code in the Tendermint repository makes heavy use of import aliasing. This is made necessary by our extensive reuse of common base package names, and by repetition of similar names across different subdirectories. Unfortunately we have not been very consistent about which packages we alias in various circumstances, and the aliases we use vary. In the spirit of the advice in the style guide and https://github.com/golang/go/wiki/CodeReviewComments#imports, his change makes an effort to clean up and normalize import aliasing. This change makes no API or behavioral changes. It is a pure cleanup intended o help make the code more readable to developers (including myself) trying to understand what is being imported where. Only unexported names have been modified, and the changes were generated and applied mechanically with gofmt -r and comby, respecting the lexical and syntactic rules of Go. Even so, I did not fix every inconsistency. Where the changes would be too disruptive, I left it alone. The principles I followed in this cleanup are: - Remove aliases that restate the package name. - Remove aliases where the base package name is unambiguous. - Move overly-terse abbreviations from the import to the usage site. - Fix lexical issues (remove underscores, remove capitalization). - Fix import groupings to more closely match the style guide. - Group blank (side-effecting) imports and ensure they are commented. - Add aliases to multiple imports with the same base package name.
3 years ago
cleanup: Reduce and normalize import path aliasing. (#6975) The code in the Tendermint repository makes heavy use of import aliasing. This is made necessary by our extensive reuse of common base package names, and by repetition of similar names across different subdirectories. Unfortunately we have not been very consistent about which packages we alias in various circumstances, and the aliases we use vary. In the spirit of the advice in the style guide and https://github.com/golang/go/wiki/CodeReviewComments#imports, his change makes an effort to clean up and normalize import aliasing. This change makes no API or behavioral changes. It is a pure cleanup intended o help make the code more readable to developers (including myself) trying to understand what is being imported where. Only unexported names have been modified, and the changes were generated and applied mechanically with gofmt -r and comby, respecting the lexical and syntactic rules of Go. Even so, I did not fix every inconsistency. Where the changes would be too disruptive, I left it alone. The principles I followed in this cleanup are: - Remove aliases that restate the package name. - Remove aliases where the base package name is unambiguous. - Move overly-terse abbreviations from the import to the usage site. - Fix lexical issues (remove underscores, remove capitalization). - Fix import groupings to more closely match the style guide. - Group blank (side-effecting) imports and ensure they are commented. - Add aliases to multiple imports with the same base package name.
3 years ago
  1. package blocksync
  2. import (
  3. "context"
  4. "os"
  5. "testing"
  6. "time"
  7. "github.com/stretchr/testify/require"
  8. dbm "github.com/tendermint/tm-db"
  9. abciclient "github.com/tendermint/tendermint/abci/client"
  10. abci "github.com/tendermint/tendermint/abci/types"
  11. "github.com/tendermint/tendermint/config"
  12. "github.com/tendermint/tendermint/internal/consensus"
  13. "github.com/tendermint/tendermint/internal/mempool/mock"
  14. "github.com/tendermint/tendermint/internal/p2p"
  15. "github.com/tendermint/tendermint/internal/p2p/p2ptest"
  16. "github.com/tendermint/tendermint/internal/proxy"
  17. sm "github.com/tendermint/tendermint/internal/state"
  18. sf "github.com/tendermint/tendermint/internal/state/test/factory"
  19. "github.com/tendermint/tendermint/internal/store"
  20. "github.com/tendermint/tendermint/internal/test/factory"
  21. "github.com/tendermint/tendermint/libs/log"
  22. bcproto "github.com/tendermint/tendermint/proto/tendermint/blocksync"
  23. "github.com/tendermint/tendermint/types"
  24. )
  25. type reactorTestSuite struct {
  26. network *p2ptest.Network
  27. logger log.Logger
  28. nodes []types.NodeID
  29. reactors map[types.NodeID]*Reactor
  30. app map[types.NodeID]proxy.AppConns
  31. blockSyncChannels map[types.NodeID]*p2p.Channel
  32. peerChans map[types.NodeID]chan p2p.PeerUpdate
  33. peerUpdates map[types.NodeID]*p2p.PeerUpdates
  34. blockSync bool
  35. }
  36. func setup(
  37. ctx context.Context,
  38. t *testing.T,
  39. genDoc *types.GenesisDoc,
  40. privVal types.PrivValidator,
  41. maxBlockHeights []int64,
  42. chBuf uint,
  43. ) *reactorTestSuite {
  44. t.Helper()
  45. var cancel context.CancelFunc
  46. ctx, cancel = context.WithCancel(ctx)
  47. numNodes := len(maxBlockHeights)
  48. require.True(t, numNodes >= 1,
  49. "must specify at least one block height (nodes)")
  50. rts := &reactorTestSuite{
  51. logger: log.TestingLogger().With("module", "block_sync", "testCase", t.Name()),
  52. network: p2ptest.MakeNetwork(ctx, t, p2ptest.NetworkOptions{NumNodes: numNodes}),
  53. nodes: make([]types.NodeID, 0, numNodes),
  54. reactors: make(map[types.NodeID]*Reactor, numNodes),
  55. app: make(map[types.NodeID]proxy.AppConns, numNodes),
  56. blockSyncChannels: make(map[types.NodeID]*p2p.Channel, numNodes),
  57. peerChans: make(map[types.NodeID]chan p2p.PeerUpdate, numNodes),
  58. peerUpdates: make(map[types.NodeID]*p2p.PeerUpdates, numNodes),
  59. blockSync: true,
  60. }
  61. chDesc := &p2p.ChannelDescriptor{ID: BlockSyncChannel, MessageType: new(bcproto.Message)}
  62. rts.blockSyncChannels = rts.network.MakeChannelsNoCleanup(ctx, t, chDesc)
  63. i := 0
  64. for nodeID := range rts.network.Nodes {
  65. rts.addNode(ctx, t, nodeID, genDoc, privVal, maxBlockHeights[i])
  66. i++
  67. }
  68. t.Cleanup(func() {
  69. cancel()
  70. for _, nodeID := range rts.nodes {
  71. if rts.reactors[nodeID].IsRunning() {
  72. rts.reactors[nodeID].Wait()
  73. rts.app[nodeID].Wait()
  74. require.False(t, rts.reactors[nodeID].IsRunning())
  75. }
  76. }
  77. })
  78. return rts
  79. }
  80. func (rts *reactorTestSuite) addNode(
  81. ctx context.Context,
  82. t *testing.T,
  83. nodeID types.NodeID,
  84. genDoc *types.GenesisDoc,
  85. privVal types.PrivValidator,
  86. maxBlockHeight int64,
  87. ) {
  88. t.Helper()
  89. logger := log.TestingLogger()
  90. rts.nodes = append(rts.nodes, nodeID)
  91. rts.app[nodeID] = proxy.NewAppConns(abciclient.NewLocalCreator(&abci.BaseApplication{}), logger, proxy.NopMetrics())
  92. require.NoError(t, rts.app[nodeID].Start(ctx))
  93. blockDB := dbm.NewMemDB()
  94. stateDB := dbm.NewMemDB()
  95. stateStore := sm.NewStore(stateDB)
  96. blockStore := store.NewBlockStore(blockDB)
  97. state, err := sm.MakeGenesisState(genDoc)
  98. require.NoError(t, err)
  99. require.NoError(t, stateStore.Save(state))
  100. blockExec := sm.NewBlockExecutor(
  101. stateStore,
  102. log.TestingLogger(),
  103. rts.app[nodeID].Consensus(),
  104. mock.Mempool{},
  105. sm.EmptyEvidencePool{},
  106. blockStore,
  107. )
  108. for blockHeight := int64(1); blockHeight <= maxBlockHeight; blockHeight++ {
  109. lastCommit := types.NewCommit(blockHeight-1, 0, types.BlockID{}, nil)
  110. if blockHeight > 1 {
  111. lastBlockMeta := blockStore.LoadBlockMeta(blockHeight - 1)
  112. lastBlock := blockStore.LoadBlock(blockHeight - 1)
  113. vote, err := factory.MakeVote(
  114. ctx,
  115. privVal,
  116. lastBlock.Header.ChainID, 0,
  117. lastBlock.Header.Height, 0, 2,
  118. lastBlockMeta.BlockID,
  119. time.Now(),
  120. )
  121. require.NoError(t, err)
  122. lastCommit = types.NewCommit(
  123. vote.Height,
  124. vote.Round,
  125. lastBlockMeta.BlockID,
  126. []types.CommitSig{vote.CommitSig()},
  127. )
  128. }
  129. thisBlock, err := sf.MakeBlock(state, blockHeight, lastCommit)
  130. require.NoError(t, err)
  131. thisParts, err := thisBlock.MakePartSet(types.BlockPartSizeBytes)
  132. require.NoError(t, err)
  133. blockID := types.BlockID{Hash: thisBlock.Hash(), PartSetHeader: thisParts.Header()}
  134. state, err = blockExec.ApplyBlock(ctx, state, blockID, thisBlock)
  135. require.NoError(t, err)
  136. blockStore.SaveBlock(thisBlock, thisParts, lastCommit)
  137. }
  138. rts.peerChans[nodeID] = make(chan p2p.PeerUpdate)
  139. rts.peerUpdates[nodeID] = p2p.NewPeerUpdates(rts.peerChans[nodeID], 1)
  140. rts.network.Nodes[nodeID].PeerManager.Register(ctx, rts.peerUpdates[nodeID])
  141. chCreator := func(ctx context.Context, chdesc *p2p.ChannelDescriptor) (*p2p.Channel, error) {
  142. return rts.blockSyncChannels[nodeID], nil
  143. }
  144. rts.reactors[nodeID], err = NewReactor(
  145. ctx,
  146. rts.logger.With("nodeID", nodeID),
  147. state.Copy(),
  148. blockExec,
  149. blockStore,
  150. nil,
  151. chCreator,
  152. rts.peerUpdates[nodeID],
  153. rts.blockSync,
  154. consensus.NopMetrics(),
  155. nil, // eventbus, can be nil
  156. )
  157. require.NoError(t, err)
  158. require.NoError(t, rts.reactors[nodeID].Start(ctx))
  159. require.True(t, rts.reactors[nodeID].IsRunning())
  160. }
  161. func (rts *reactorTestSuite) start(ctx context.Context, t *testing.T) {
  162. t.Helper()
  163. rts.network.Start(ctx, t)
  164. require.Len(t,
  165. rts.network.RandomNode().PeerManager.Peers(),
  166. len(rts.nodes)-1,
  167. "network does not have expected number of nodes")
  168. }
  169. func TestReactor_AbruptDisconnect(t *testing.T) {
  170. ctx, cancel := context.WithCancel(context.Background())
  171. defer cancel()
  172. cfg, err := config.ResetTestRoot("block_sync_reactor_test")
  173. require.NoError(t, err)
  174. defer os.RemoveAll(cfg.RootDir)
  175. genDoc, privVals := factory.RandGenesisDoc(ctx, t, cfg, 1, false, 30)
  176. maxBlockHeight := int64(64)
  177. rts := setup(ctx, t, genDoc, privVals[0], []int64{maxBlockHeight, 0}, 0)
  178. require.Equal(t, maxBlockHeight, rts.reactors[rts.nodes[0]].store.Height())
  179. rts.start(ctx, t)
  180. secondaryPool := rts.reactors[rts.nodes[1]].pool
  181. require.Eventually(
  182. t,
  183. func() bool {
  184. height, _, _ := secondaryPool.GetStatus()
  185. return secondaryPool.MaxPeerHeight() > 0 && height > 0 && height < 10
  186. },
  187. 10*time.Second,
  188. 10*time.Millisecond,
  189. "expected node to be partially synced",
  190. )
  191. // Remove synced node from the syncing node which should not result in any
  192. // deadlocks or race conditions within the context of poolRoutine.
  193. rts.peerChans[rts.nodes[1]] <- p2p.PeerUpdate{
  194. Status: p2p.PeerStatusDown,
  195. NodeID: rts.nodes[0],
  196. }
  197. rts.network.Nodes[rts.nodes[1]].PeerManager.Disconnected(ctx, rts.nodes[0])
  198. }
  199. func TestReactor_SyncTime(t *testing.T) {
  200. ctx, cancel := context.WithCancel(context.Background())
  201. defer cancel()
  202. cfg, err := config.ResetTestRoot("block_sync_reactor_test")
  203. require.NoError(t, err)
  204. defer os.RemoveAll(cfg.RootDir)
  205. genDoc, privVals := factory.RandGenesisDoc(ctx, t, cfg, 1, false, 30)
  206. maxBlockHeight := int64(101)
  207. rts := setup(ctx, t, genDoc, privVals[0], []int64{maxBlockHeight, 0}, 0)
  208. require.Equal(t, maxBlockHeight, rts.reactors[rts.nodes[0]].store.Height())
  209. rts.start(ctx, t)
  210. require.Eventually(
  211. t,
  212. func() bool {
  213. return rts.reactors[rts.nodes[1]].GetRemainingSyncTime() > time.Nanosecond &&
  214. rts.reactors[rts.nodes[1]].pool.getLastSyncRate() > 0.001
  215. },
  216. 10*time.Second,
  217. 10*time.Millisecond,
  218. "expected node to be partially synced",
  219. )
  220. }
  221. func TestReactor_NoBlockResponse(t *testing.T) {
  222. ctx, cancel := context.WithCancel(context.Background())
  223. defer cancel()
  224. cfg, err := config.ResetTestRoot("block_sync_reactor_test")
  225. require.NoError(t, err)
  226. defer os.RemoveAll(cfg.RootDir)
  227. genDoc, privVals := factory.RandGenesisDoc(ctx, t, cfg, 1, false, 30)
  228. maxBlockHeight := int64(65)
  229. rts := setup(ctx, t, genDoc, privVals[0], []int64{maxBlockHeight, 0}, 0)
  230. require.Equal(t, maxBlockHeight, rts.reactors[rts.nodes[0]].store.Height())
  231. rts.start(ctx, t)
  232. testCases := []struct {
  233. height int64
  234. existent bool
  235. }{
  236. {maxBlockHeight + 2, false},
  237. {10, true},
  238. {1, true},
  239. {100, false},
  240. }
  241. secondaryPool := rts.reactors[rts.nodes[1]].pool
  242. require.Eventually(
  243. t,
  244. func() bool { return secondaryPool.MaxPeerHeight() > 0 && secondaryPool.IsCaughtUp() },
  245. 10*time.Second,
  246. 10*time.Millisecond,
  247. "expected node to be fully synced",
  248. )
  249. for _, tc := range testCases {
  250. block := rts.reactors[rts.nodes[1]].store.LoadBlock(tc.height)
  251. if tc.existent {
  252. require.True(t, block != nil)
  253. } else {
  254. require.Nil(t, block)
  255. }
  256. }
  257. }
  258. func TestReactor_BadBlockStopsPeer(t *testing.T) {
  259. // Ultimately, this should be refactored to be less integration test oriented
  260. // and more unit test oriented by simply testing channel sends and receives.
  261. // See: https://github.com/tendermint/tendermint/issues/6005
  262. t.SkipNow()
  263. ctx, cancel := context.WithCancel(context.Background())
  264. defer cancel()
  265. cfg, err := config.ResetTestRoot("block_sync_reactor_test")
  266. require.NoError(t, err)
  267. defer os.RemoveAll(cfg.RootDir)
  268. maxBlockHeight := int64(48)
  269. genDoc, privVals := factory.RandGenesisDoc(ctx, t, cfg, 1, false, 30)
  270. rts := setup(ctx, t, genDoc, privVals[0], []int64{maxBlockHeight, 0, 0, 0, 0}, 1000)
  271. require.Equal(t, maxBlockHeight, rts.reactors[rts.nodes[0]].store.Height())
  272. rts.start(ctx, t)
  273. require.Eventually(
  274. t,
  275. func() bool {
  276. caughtUp := true
  277. for _, id := range rts.nodes[1 : len(rts.nodes)-1] {
  278. if rts.reactors[id].pool.MaxPeerHeight() == 0 || !rts.reactors[id].pool.IsCaughtUp() {
  279. caughtUp = false
  280. }
  281. }
  282. return caughtUp
  283. },
  284. 10*time.Minute,
  285. 10*time.Millisecond,
  286. "expected all nodes to be fully synced",
  287. )
  288. for _, id := range rts.nodes[:len(rts.nodes)-1] {
  289. require.Len(t, rts.reactors[id].pool.peers, 3)
  290. }
  291. // Mark testSuites[3] as an invalid peer which will cause newSuite to disconnect
  292. // from this peer.
  293. //
  294. // XXX: This causes a potential race condition.
  295. // See: https://github.com/tendermint/tendermint/issues/6005
  296. otherGenDoc, otherPrivVals := factory.RandGenesisDoc(ctx, t, cfg, 1, false, 30)
  297. newNode := rts.network.MakeNode(ctx, t, p2ptest.NodeOptions{
  298. MaxPeers: uint16(len(rts.nodes) + 1),
  299. MaxConnected: uint16(len(rts.nodes) + 1),
  300. })
  301. rts.addNode(ctx, t, newNode.NodeID, otherGenDoc, otherPrivVals[0], maxBlockHeight)
  302. // add a fake peer just so we do not wait for the consensus ticker to timeout
  303. rts.reactors[newNode.NodeID].pool.SetPeerRange("00ff", 10, 10)
  304. // wait for the new peer to catch up and become fully synced
  305. require.Eventually(
  306. t,
  307. func() bool {
  308. return rts.reactors[newNode.NodeID].pool.MaxPeerHeight() > 0 && rts.reactors[newNode.NodeID].pool.IsCaughtUp()
  309. },
  310. 10*time.Minute,
  311. 10*time.Millisecond,
  312. "expected new node to be fully synced",
  313. )
  314. require.Eventuallyf(
  315. t,
  316. func() bool { return len(rts.reactors[newNode.NodeID].pool.peers) < len(rts.nodes)-1 },
  317. 10*time.Minute,
  318. 10*time.Millisecond,
  319. "invalid number of peers; expected < %d, got: %d",
  320. len(rts.nodes)-1,
  321. len(rts.reactors[newNode.NodeID].pool.peers),
  322. )
  323. }