SmartSelect: intermittent ping failures cause "No endorsed provider available" even when providers are reachable
#849 opened on Jun 16, 2026
Repository metrics
- Stars
- (21 stars)
- PR merge metrics
- (PR metrics pending)
Description
Summary
StorageContext.smartSelect intermittently marks endorsed providers as unreachable due to failed pings, even when the same providers respond successfully on retry. This causes uploads to fail with a hard error rather than retrying or falling back gracefully.
Error
Provider 0xCb9e86945cA31E6C3120725BF0385CBAD684040c (ID: 4) failed ping: Ping failed
Provider 0xa3971A7234a3379A1813d9867B531e7EeB20ae07 (ID: 9) failed ping: Ping failed
Error: StorageContext smartSelect failed: No endorsed provider available — all endorsed provider(s) failed health check
at createError (file:///Users/nick-w3/foc-cli/cli/node_modules/@filoz/synapse-sdk/dist/src/utils/errors.js:8:22)
at StorageContext.smartSelect (file:///Users/nick-w3/foc-cli/cli/node_modules/@filoz/synapse-sdk/dist/src/storage/context.js:290:23)
at async StorageContext.createContexts (file:///Users/nick-w3/foc-cli/cli/node_modules/@filoz/synapse-sdk/dist/src/storage/context.js:109:27)
at async StorageManager.createContexts (file:///Users/nick-w3/foc-cli/cli/node_modules/@filoz/synapse-sdk/dist/src/storage/manager.js:546:26)
Behavior
- Pings to endorsed providers fail intermittently, not consistently.
- Retrying the same operation (e.g. re-running the upload command) succeeds most of the time.
- This points to the ping retry policy being too tight (timeout too short, retry count too low, or no backoff) rather than providers genuinely being down.
Workaround
A custom provider selection implementation was introduced in foc-cli and foc-upload-dapp as a workaround:
[cli/src/provider-selection.ts](https://github.com/FIL-Builders/foc-cli/blob/main/cli/src/provider-selection.ts)[cli/src/commands/multi-upload.ts#L134-L155](https://github.com/FIL-Builders/foc-cli/blob/main/cli/src/commands/multi-upload.ts#L134C2-L155C9)
The key fix was passing providerIds directly into createContexts instead of passing copies, which appears to avoid the condition that triggers false ping failures.
Suggested Fix
Review the ping retry policy inside smartSelect (timeout, retry count, backoff). Consider:
- Increasing the ping timeout threshold
- Adding at least one retry with a short delay before marking a provider as failed