Skip to content

Comments

pdpv0: Document PDP task inventory and dependency tree #998

Merged
ZenGround0 merged 3 commits intopdpv0from
phi/list-pdp-tasks
Feb 18, 2026
Merged

pdpv0: Document PDP task inventory and dependency tree #998
ZenGround0 merged 3 commits intopdpv0from
phi/list-pdp-tasks

Conversation

@rjan90
Copy link
Collaborator

@rjan90 rjan90 commented Feb 16, 2026

Summary

  • Adds a complete inventory of all 8 PDP harmony tasks and 5 chain-handler watchers to PDPCURIOSPEC.md
  • Adds ASCII dependency tree diagrams covering piece ingestion, the proving cycle, payment settlement/termination, piece removal, and error recovery

Closes remaining parts of #904

pdpv0: document PDP task inventory and dependency tree
@rjan90 rjan90 added this to the M4.1: mainnet ready milestone Feb 16, 2026
@rjan90 rjan90 requested a review from ZenGround0 February 16, 2026 09:04
@rjan90 rjan90 requested a review from a team as a code owner February 16, 2026 09:04
@rjan90 rjan90 added the team/fs-wg Items being worked on or tracked by the "FS Working Group". See FilOzone/github-mgmt #10 label Feb 16, 2026
@FilOzzy FilOzzy added this to FOC Feb 16, 2026
@github-project-automation github-project-automation bot moved this to 📌 Triage in FOC Feb 16, 2026
@rjan90 rjan90 changed the base branch from main to pdpv0 February 16, 2026 09:04
@rjan90 rjan90 linked an issue Feb 16, 2026 that may be closed by this pull request
@rjan90 rjan90 self-assigned this Feb 16, 2026
@rjan90 rjan90 moved this from 📌 Triage to 🔎 Awaiting review in FOC Feb 16, 2026
Copy link
Collaborator

@ZenGround0 ZenGround0 left a comment

Choose a reason for hiding this comment

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

I'm happy to help contribute to this PR to get it merged. The main thing I'd like to see is some changes to the ASCII diagrams for clarity in the Task Dependency Tree section. I think the high level categories are pretty good. But I would probably move from ASCII diagrams to text given that the diagrams are quite dense and they mostly break down into linear sequences of steps.


# PDP Harmony Tasks

All PDP-related functionality is implemented as harmony tasks and chain-handler watchers. Tasks implement the `TaskInterface` and are scheduled by the harmony task engine. Chain-handler watchers are registered via `chainsched.AddHandler` and fire on every new chain head.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I love seeing the chainsched handlers mentioned. Since we are getting into the mechanis I think we should probably have more exposition on how exactly harmony tasks are scheduled by the task engine -- i.e. IAMBored or constructors creating chain handlers that spawn harmony tasks.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok nice I see that this is called out in the registered task table's Trigger column. But some exposition on the interaction between chain handler and tasks and the broader points of poller vs IAMBored from harmony task would be useful here

|-----------|--------|------|---------|-------------|
| `PDPv0_InitPP` | `InitProvingPeriodTask` | `tasks/pdp/task_init_pp.go` | Chain handler | Initializes the first proving period for a dataset by calling `PDPVerifier.nextProvingPeriod()`. Picks up datasets where `init_ready=TRUE` and `prove_at_epoch IS NULL`. |
| `PDPv0_ProvPeriod` | `NextProvingPeriodTask` | `tasks/pdp/task_next_pp.go` | Chain handler | Schedules subsequent proving periods after each challenge window completes. Fires when `prove_at_epoch + challenge_window <= current_height`. Detects `ProvingPeriodNotInitialized` errors and resets dataset back to init state. |
| `PDPv0_Prove` | `ProveTask` | `tasks/pdp/task_prove.go` | Chain handler | Generates SHA-256 Merkle tree proofs and submits them via `PDPVerifier.provePossession()`. Scheduled when the `challenge_request_msg_hash` transaction lands on-chain and `prove_at_epoch` is reached. Most resource-intensive task (2GB RAM for memtree). |
Copy link
Collaborator

Choose a reason for hiding this comment

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

From my POV we could just drop the description field. The descriptions there are ok but mixed between very high level and fine details which makes reading them a bit tricky at least for me. My thinking would be that the rest of this document should be describing these tasks in enough detail that anyone reading this will already understand what they are doing. A reference table listing trigger type is quite useful though.

├── Contract revert ──► exponential backoff
│ (100 blocks * 2^(failures-1), max 28800 blocks)
│ after 5 consecutive failures ──► unrecoverable
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps just my opinion but I get the sense that these ASCII diagrams are too crowded to be very useful. I think a bulleted list or text description would probably better suite presenting this information. Alternatively a more simplified ascii diagram with only arrows between tasks could also be a good direction to take this.

| `PDPv0_PullPiece` | `PDPPullPieceTask` | `tasks/pdp/task_pull_piece.go` | Polling (10s) | Downloads pieces from external URLs, streams data while computing CommP, verifies against expected piece CID, and stores in `parked_pieces` for long-term storage. |
| `PDPv0_TermFWSS` | `TerminateFWSSTask` | `tasks/pdp/task_terminate_fwss.go` | IAmBored (1 min) | Calls `FWSS.terminateService()` for datasets pending service termination. Retrieves `PdpEndEpoch` from the FWSS contract. |
| `PDPv0_DelDataSet` | `DeleteDataSetTask` | `tasks/pdp/task_delete_data_set.go` | IAmBored (1 hour) | Calls `PDPVerifier.deleteDataSet()` for datasets where `service_termination_epoch <= current_block` and `deletion_allowed=TRUE`. |
| `Settle` | `SettleTask` | `tasks/pay/settle_task.go` | IAmBored (12 hours) | Settles the FWSS lockup period for the PDP operator. Calls `filecoinpayment.SettleLockupPeriod()` with the operator and payee addresses. |
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to add PDPv0_Indexing and PDPv0_IPNI

pdpv0: address PR review feedback on PDP spec
@rjan90
Copy link
Collaborator Author

rjan90 commented Feb 18, 2026

I'm happy to help contribute to this PR to get it merged. The main thing I'd like to see is some changes to the ASCII diagrams for clarity in the Task Dependency Tree section.

I pushed some changes that addressed some of your feedback, but also feel free to push directly to the branch fi there are things you would want to change!

Comment on lines 150 to 151
**If a rail is fully settled/finalized:**
3. SettleWatcher calls `ensureDataSetDeletion()`, which sets `deletion_allowed = TRUE` in `pdp_delete_data_set`. This is then picked up by **PDPv0_DelDataSet** at step 6 above.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This piece is redundant, I'll delete

@github-project-automation github-project-automation bot moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FOC Feb 18, 2026
@ZenGround0 ZenGround0 merged commit bbd8fe5 into pdpv0 Feb 18, 2026
15 checks passed
@ZenGround0 ZenGround0 deleted the phi/list-pdp-tasks branch February 18, 2026 18:42
@github-project-automation github-project-automation bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team/fs-wg Items being worked on or tracked by the "FS Working Group". See FilOzone/github-mgmt #10

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pdpv0: PDP subsystem documentation

2 participants