generated from MetaMask/metamask-module-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Problem: isRetryableNetworkError treats all network errors as retryable, but we can't distinguish "not running now" from "will never be running again" from "wrong address". This causes wasted retries for permanently unreachable peers.
Expected Behavior:
- Track error patterns per peer over time (error codes, frequency, success rate)
- Classify persistent failures as permanently non-retryable after threshold
- Stop retrying when pattern indicates permanent failure (wrong address, dead peer)
- Continue retrying for transient failures (temporary network issues)
Implementation:
- Add error tracking to
ReconnectionManager(error history per peer) - Track consecutive identical errors, error frequency, and success rate
- Implement heuristics: e.g., "same error code N times without success = permanent"
- Add permanent failure state to
ReconnectionManager - Modify
isRetryableNetworkErroror addisPermanentlyFailed(peerId)check - Integrate with
attemptReconnectionto stop on permanent failure - Consider "wrong address" patterns (persistent
ECONNREFUSED/EHOSTUNREACH)
Acceptance Criteria:
- Error patterns are tracked per peer
- Persistent failures are classified as permanent after threshold
- Permanent failures stop retry attempts
- Transient failures continue to retry
- Tests verify pattern detection and permanent failure classification
Metadata
Metadata
Assignees
Labels
No labels