@@ -41,6 +41,11 @@ declareCounter nec_imported_transactions, "Transactions processed during import"
41
41
42
42
declareCounter nec_imported_gas, " Gas processed during import"
43
43
44
+ declareGauge nec_download_block_number, " Latest in order downloaded block number"
45
+
46
+ declareCounter nec_downloaded_blocks, " Blocks downloaded during import"
47
+
48
+
44
49
var running {.volatile.} = true
45
50
46
51
proc openCsv(name: string ): File =
@@ -187,7 +192,7 @@ proc run(config: NimbusConf): PortalNode {.
187
192
# # Portal node setup
188
193
let
189
194
portalProtocolConfig = PortalProtocolConfig.init(
190
- DefaultTableIpLimit, DefaultBucketIpLimit, DefaultBitsPerHop, defaultAlpha , RadiusConfig(kind: Static, logRadius: 249 ),
195
+ DefaultTableIpLimit, DefaultBucketIpLimit, DefaultBitsPerHop, config.alpha , RadiusConfig(kind: Static, logRadius: 249 ),
191
196
defaultDisablePoke, defaultMaxGossipNodes, defaultContentCacheSize,
192
197
defaultDisableContentCache, defaultMaxConcurrentOffers, defaultDisableBanNodes,
193
198
)
@@ -227,7 +232,7 @@ proc getBlockLoop(
227
232
startBlock: uint64 ,
228
233
portalWorkers: int ,
229
234
) : Future[void ] {.async.} =
230
- const bufferSize = 8192
235
+ const bufferSize = 8192 * 4
231
236
232
237
let
233
238
historyNetwork = node.historyNetwork.value()
@@ -257,6 +262,7 @@ proc getBlockLoop(
257
262
258
263
continue
259
264
265
+ nec_downloaded_blocks.inc()
260
266
blocks[i] = init(EthBlock, header, body)
261
267
downloadFinished[i] = true
262
268
totalDownloadCount.inc()
@@ -277,6 +283,9 @@ proc getBlockLoop(
277
283
278
284
while true :
279
285
while downloadFinished[nextReadIndex]:
286
+ # TODO : Fix this counter, it's not accurate as blockNumberOffset updates
287
+ # differently than the block being passed around here
288
+ nec_download_block_number.set ((blockNumberOffset + nextReadIndex.uint64 ).int64 )
280
289
debug " Adding block to the processing queue" ,
281
290
blockNumber = blockNumberOffset + nextReadIndex.uint64
282
291
await blockQueue.addLast(blocks[nextReadIndex])
0 commit comments