StorageContext.resolveByProviderId selects candidate datasets from WarmStorageService.getClientDataSets() and filters on pdpEndEpoch === 0n. It does not check PDP dataSetLive.
PDP and FWSS can disagree: a dataset may be terminated in PDP, for example after unrecoverable proving failure, while FWSS still reports pdpEndEpoch === 0n until terminateService is called. In that state, createContext({ providerId, metadata }) can return a context for the dead dataset, and the next add-pieces path fails with:
Data set has been terminated due to unrecoverable proving failure
Proposed changes
-
Add a targeted PDP liveness check during provider resolution.
After candidate evaluation selects a dataset, check dataSetLive. If the selected dataset is dead, skip it and continue scanning already-evaluated candidates before fetching another batch. This keeps the normal path cheap and only adds extra work when the selected candidate is unusable.
-
Add a typed terminated-dataset error on write paths.
StorageContext.commit() wraps SP.addPieces and SP.createDataSetAndAddPieces. Detect PDP terminated-dataset reverts and throw a typed DataSetTerminatedError so callers can recover programmatically. Prefer structured revert detection over substring matching.
Context
Encountered in FilOzone/dealbot#379. Dealbot is tracking a local workaround there by routing repair through its data_set_creation job.
StorageContext.resolveByProviderIdselects candidate datasets fromWarmStorageService.getClientDataSets()and filters onpdpEndEpoch === 0n. It does not check PDPdataSetLive.PDP and FWSS can disagree: a dataset may be terminated in PDP, for example after unrecoverable proving failure, while FWSS still reports
pdpEndEpoch === 0nuntilterminateServiceis called. In that state,createContext({ providerId, metadata })can return a context for the dead dataset, and the next add-pieces path fails with:Data set has been terminated due to unrecoverable proving failureProposed changes
Add a targeted PDP liveness check during provider resolution.
After candidate evaluation selects a dataset, check
dataSetLive. If the selected dataset is dead, skip it and continue scanning already-evaluated candidates before fetching another batch. This keeps the normal path cheap and only adds extra work when the selected candidate is unusable.Add a typed terminated-dataset error on write paths.
StorageContext.commit()wrapsSP.addPiecesandSP.createDataSetAndAddPieces. Detect PDP terminated-dataset reverts and throw a typedDataSetTerminatedErrorso callers can recover programmatically. Prefer structured revert detection over substring matching.Context
Encountered in FilOzone/dealbot#379. Dealbot is tracking a local workaround there by routing repair through its
data_set_creationjob.