Skip to content

feat: add terminate command to terminate a dataset#307

Open
akronim26 wants to merge 10 commits intofilecoin-project:masterfrom
akronim26:add/data-set_--terminate
Open

feat: add terminate command to terminate a dataset#307
akronim26 wants to merge 10 commits intofilecoin-project:masterfrom
akronim26:add/data-set_--terminate

Conversation

@akronim26
Copy link

Fixes #189

@akronim26 akronim26 closed this Jan 27, 2026
@akronim26 akronim26 reopened this Jan 27, 2026
@BigLep BigLep added team/fs-wg FOC working group is a stakeholder for this work, and thus wants to track it on their project board. team/filecoin-pin "Filecoin Pin" project is a stakeholder for this work. labels Jan 28, 2026
@BigLep BigLep requested a review from Copilot January 28, 2026 19:18
@FilOzzy FilOzzy added this to FOC Jan 28, 2026
@github-project-automation github-project-automation bot moved this to 📌 Triage in FOC Jan 28, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a new terminate command to the data-set CLI that allows users to terminate a dataset and its associated payment rails. This addresses issue #189 which requested a convenient way to cleanup and stop paying utility for datasets.

Changes:

  • Added a new terminate subcommand to the data-set command that terminates both the dataset and its payment rails
  • Implemented ownership validation to ensure only the dataset owner can terminate
  • Added idempotent handling for already-terminated datasets
  • Enhanced piece display to show terminated datasets' pieces as "onchain orphaned"

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/commands/data-set.ts Adds the new terminate subcommand registration with argument parsing and error handling
src/data-set/run.ts Implements runTerminateDataSetCommand with owner validation, confirmation prompt, transaction submission, and result display
src/data-set/display.ts Updates renderPieces to mark pieces as ONCHAIN_ORPHANED when dataset's payment rail is terminated
src/test/unit/data-set.test.ts Adds comprehensive test coverage for successful termination, permission denial, and already-terminated scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if (dataSet.pdpEndEpoch > 0) {
for (const piece of dataSet.pieces) {
renderPiece({ ...piece, status: PieceStatus.ONCHAIN_ORPHANED }, indentLevel + 1)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why you're adding status: PieceStatus.ONCHAIN_ORPHANED here? if the dataSet.pdpEndEpoch > 0, that means the dataset is terminated, not that pdp/chain is out of sync (orphaned pieces)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohhh, okayy. I was mixing up between the two. I will modify PIeceStatus into

export enum PieceStatus {
  ACTIVE = 'ACTIVE',
  PENDING_REMOVAL = 'PENDING_REMOVAL',
  ONCHAIN_ORPHANED = 'ONCHAIN_ORPHANED',
  OFFCHAIN_ORPHANED = 'OFFCHAIN_ORPHANED',
  TERMINATED = 'TERMINATED'
}

@github-project-automation github-project-automation bot moved this from 📌 Triage to ⌨️ In Progress in FOC Feb 4, 2026
@akronim26 akronim26 requested a review from SgtPooki February 7, 2026 20:57
@rjan90
Copy link
Collaborator

rjan90 commented Feb 12, 2026

@SgtPooki looks like this is ready for a re-review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team/filecoin-pin "Filecoin Pin" project is a stakeholder for this work. team/fs-wg FOC working group is a stakeholder for this work, and thus wants to track it on their project board.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add data-set $dataSetId --terminate

4 participants