Skip to content

createContext provider resolution can select PDP-dead datasets #780

@SgtPooki

Description

@SgtPooki

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

  1. 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.

  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🐱 Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions