feat(chain_sync): add retry logic with exponential backoff for RPC connections and block imports
- Add retry mechanism with exponential backoff for block broadcast loop - Implement max 5 retries with 2s base delay for RPC connection failures - Reset retry count on successful connection - Add 20s wait period after max retries before resetting counter - Add retry logic for block import with 3 attempts and 1s base delay - Handle non-200 HTTP responses as exceptions to trigger retries - Improve error logging
This commit is contained in:
@@ -148,7 +148,11 @@ class BlockchainNode:
|
||||
max_size=settings.mempool_max_size,
|
||||
min_fee=settings.min_fee,
|
||||
)
|
||||
self._start_proposers()
|
||||
# Start proposers only if enabled (followers set enable_block_production=False)
|
||||
if getattr(settings, "enable_block_production", True):
|
||||
self._start_proposers()
|
||||
else:
|
||||
logger.info("Block production disabled on this node", extra={"proposer_id": settings.proposer_id})
|
||||
await self._setup_gossip_subscribers()
|
||||
try:
|
||||
await self._stop_event.wait()
|
||||
|
||||
Reference in New Issue
Block a user