From d3d2347e8fbe390f4bcb0e7d18f4bfda3e22babc Mon Sep 17 00:00:00 2001 From: Arnaud Date: Wed, 8 Oct 2025 12:28:04 +0200 Subject: [PATCH] Add blockRetries parameter --- codex/codex.nim | 2 +- codex/conf.nim | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/codex/codex.nim b/codex/codex.nim index 80658753..b023e8ea 100644 --- a/codex/codex.nim +++ b/codex/codex.nim @@ -326,7 +326,7 @@ proc new*( ) peerStore = PeerCtxStore.new() - pendingBlocks = PendingBlocksManager.new() + pendingBlocks = PendingBlocksManager.new(retries = config.blockRetries) advertiser = Advertiser.new(repoStore, discovery) blockDiscovery = DiscoveryEngine.new(repoStore, peerStore, network, discovery, pendingBlocks) diff --git a/codex/conf.nim b/codex/conf.nim index 6294516e..206a3e04 100644 --- a/codex/conf.nim +++ b/codex/conf.nim @@ -47,13 +47,14 @@ import ./utils/natutils from ./contracts/config import DefaultRequestCacheSize, DefaultMaxPriorityFeePerGas from ./validationconfig import MaxSlots, ValidationGroups +from ./blockexchange/engine/pendingblocks import DefaultBlockRetries export units, net, codextypes, logutils, completeCmdArg, parseCmdArg, NatConfig export ValidationGroups, MaxSlots export DefaultQuotaBytes, DefaultBlockTtl, DefaultBlockInterval, DefaultNumBlocksPerInterval, - DefaultRequestCacheSize, DefaultMaxPriorityFeePerGas + DefaultRequestCacheSize, DefaultMaxPriorityFeePerGas, DefaultBlockRetries type ThreadCount* = distinct Natural @@ -264,6 +265,13 @@ type name: "block-mn" .}: int + blockRetries* {. + desc: "Number of times to retry fetching a block before giving up", + defaultValue: DefaultBlockRetries, + defaultValueDesc: $DefaultBlockRetries, + name: "block-retries" + .}: int + cacheSize* {. desc: "The size of the block cache, 0 disables the cache - " &