Bridge: add retry cap or monitoring for stale refund cleanup retries #1286
Summary
When a threshold signing request reaches COMPLETED, the inference BLS hook calls CleanupBridgePendingRefundByBlsRequestID to remove pending bridge refund state.
If this cleanup persistently fails, the request is re-queued under CompletedPostProcessRetryPrefix, but ProcessCompletedPostProcessRetries currently has no maximum retry cap.
Impact
This does not appear to create a direct safety issue:
cancelThresholdSigningRequestrejects cancellation once the BLS request is COMPLETED.- Therefore a stale pending refund entry should not allow double-spend.
However, persistent cleanup failures can cause:
- stale refund entries remaining in state indefinitely
- retry queue growth
- noisy monitoring / operational confusion
Suggested fix
Either:
- add a maximum retry count for completed post-process retries, or
- add monitoring / alerting for retry queue depth and old retry entries.
Relevant code
inference-chain/x/inference/module/bls_hooks.goAfterThresholdSigningCompletedinference-chain/x/inference/keeper/bridge_pending_refund.goCleanupBridgePendingRefundByBlsRequestIDinference-chain/x/bls/keeper/threshold_signing.goProcessCompletedPostProcessRetries
Acceptance criteria
- Persistent cleanup failures cannot retry forever without visibility.
- Either a max retry cap exists, or an alert/metric exists for stale completed post-process retries.
- Existing double-spend protection remains unchanged.
💬 Comments (4)
sure, we will take it @bonujel
Picking this up — I'll add a maximum retry cap for completed post-process retries (with metrics/logging for stale entries) so persistent cleanup failures can't retry forever, while keeping the existing double-spend protection unchanged. PR to follow on the v0.2.14 line.
@GLiberman fyi
🔄 Auto-synced from Issue #1286 every hour.
@Ryanchen911, are you ready to write a fix?