Skip to content

feat: cleanup deposits#270

Merged
wjmelements merged 22 commits into
mainfrom
cleanup-pieces
May 21, 2026
Merged

feat: cleanup deposits#270
wjmelements merged 22 commits into
mainfrom
cleanup-pieces

Conversation

@wjmelements
Copy link
Copy Markdown
Contributor

Reviewer @rvagg
Closes #269
Spec
It is important that cleanup also works for existing datasets.

Changes

  • implement cleanup deposit
  • remove previous sybil enforcement
  • test

@wjmelements wjmelements requested a review from rvagg May 19, 2026 00:38
@FilOzzy FilOzzy added this to FOC May 19, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC May 19, 2026
@wjmelements wjmelements moved this to 🔎 Awaiting review in PDP May 19, 2026
@wjmelements wjmelements moved this from 📌 Triage to 🔎 Awaiting review in FOC May 19, 2026
Copy link
Copy Markdown

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 PR implements dataset cleanup finalization via a FIL “cleanup deposit” and a new cleanupPieces() flow, removing the prior sybil-fee/USDFC enforcement logic and updating/adding tests to validate the new termination + cleanup behavior (including legacy-deleted datasets).

Changes:

  • Replace sybil fee logic with a per-dataset FIL cleanup deposit (PDPFees.cleanupDeposit()), refunded to whoever completes cleanup.
  • Add cleanup mode + cleanupPieces(setId, maxPieces) to allow incremental storage teardown after deleteDataSet(), with permissionless cleanup after an inactivity window.
  • Update existing Foundry tests and add a new cleanup-focused test suite.

Reviewed changes

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

Show a summary per file
File Description
src/PDPVerifier.sol Adds cleanup mode/deposit accounting and cleanupPieces(), removes prior sybil enforcement code paths.
src/Fees.sol Renames sybil fee to cleanup deposit and updates constants/helpers accordingly.
src/interfaces/IPDPVerifier.sol Exposes cleanupPieces() and updates fee-related getters to the new model.
src/PDPVerifierLayout.sol / src/PDPVerifierLayout.json Extends storage layout with cleanup deposit + cleanup mode epoch mappings.
test/CleanupPieces.t.sol New test coverage for incremental cleanup, permission gates, and deposit payout behavior.
test/PDPVerifier.t.sol / test/PDPVerifierProofTest.t.sol / test/ERC1967Proxy.t.sol Updates tests for new constructor + fee model and new error selectors/constants.
test/Fees.t.sol Removes sybil fee test (but does not add a cleanup deposit constant test).

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

Comment thread src/PDPVerifier.sol
Comment thread src/PDPVerifier.sol
Comment thread test/CleanupPieces.t.sol
Comment thread test/Fees.t.sol
Comment thread src/PDPVerifier.sol
Comment thread src/PDPVerifier.sol
Comment thread src/PDPVerifier.sol
…constructor arg, add MAX_FINALITY upper bound

Assisted-by: Claude:claude-sonnet-4-6
Comment thread src/PDPVerifier.sol Outdated
@wjmelements wjmelements requested a review from rvagg May 20, 2026 21:50
Comment thread tools/deploy-mainnet.sh Outdated
Comment thread src/PDPVerifier.sol
Comment thread src/PDPVerifier.sol Outdated
Copy link
Copy Markdown
Contributor

@rvagg rvagg left a comment

Choose a reason for hiding this comment

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

approving in expectation of resolution of the bash script fixups, and an eye to the underflow panic vs proper error

otherwise lgtm!

@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FOC May 21, 2026
Copy link
Copy Markdown
Collaborator

@Kubuxu Kubuxu left a comment

Choose a reason for hiding this comment

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

Looks good
One nit that is probably not worth fixing:
dataSetLastProvenEpoch became something else, something closer to lastModified.
Maybe a comment on its actual uses would be useful.

Comment thread src/PDPVerifier.sol
@wjmelements wjmelements merged commit f7bb68b into main May 21, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to 🎉 Done in PDP May 21, 2026
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC May 21, 2026
@wjmelements wjmelements deleted the cleanup-pieces branch May 21, 2026 19:33
Reiers added a commit to Reiers/curio that referenced this pull request May 24, 2026
…eposit

PDPVerifier v3.4.0 (announced 2026-05-24, calibration upgrade early
next week, mainnet gated on calibration smoke) introduces a 0.1 FIL
cleanup deposit on new dataset creation:

  - createDataSet() requires msg.value >= FIL_CLEANUP_DEPOSIT()
  - addPieces(NEW_DATA_SET_SENTINEL, ...) same requirement
  - USDFC sybil-fee path removed entirely

Excess msg.value is refunded by the contract. The 0.1 FIL value
matches the existing contract.SybilFee() helper (same numerical
value, different on-chain semantics: was a burn fee, now a refundable
deposit paid to whoever completes cleanup after deletion).

Safe to ship before the upgrade lands: v3.2.0 deployments ignore
msg.value silently on these paths, so this change is a no-op until
the new implementation is wired in behind the proxy.

Both call sites covered:
  - handleCreateDataSetAndAddPieces (line 115)
  - handleCreateDataSet (line 281)

addPieces to an existing dataset (handlers_add.go) is unaffected;
cleanup deposit applies only to NEW dataset creation, not to adding
pieces to a live one.

Refs: FilOzone/pdp CHANGELOG v3.4.0, FilOzone/pdp#270, FilOzone/pdp#271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done
Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

[pdp] Simplified DataSet terminations and cleanup for GA

6 participants