Skip to content

feat: emit PiecesScheduledForRemoval when scheduling piece deletions - #287

Merged
wjmelements merged 2 commits into
FilOzone:mainfrom
nishant-uxs:feat/pieces-scheduled-for-removal-event
Aug 4, 2026
Merged

feat: emit PiecesScheduledForRemoval when scheduling piece deletions#287
wjmelements merged 2 commits into
FilOzone:mainfrom
nishant-uxs:feat/pieces-scheduled-for-removal-event

Conversation

@nishant-uxs

Copy link
Copy Markdown
Contributor

Summary

  • Emit PiecesScheduledForRemoval(setId, pieceIds) from schedulePieceDeletions so indexers can observe scheduled removals immediately, without waiting for PiecesRemoved at the next proving boundary.
  • Declare the event in IPDPEvents alongside the existing piece lifecycle events.

Closes #281

Files Changed

  • src/interfaces/IPDPEvents.sol
  • src/PDPVerifier.sol
  • test/PDPVerifier.t.sol

Testing Performed

  • forge build --via-ir
  • forge test --via-ir (187 passed)

Known Limitations

  • Does not change listener/piecesScheduledRemove behavior; event is for log-driven consumers.

Risk Assessment

  • Low: additive event only; no storage layout or ABI-breaking logic changes beyond a new event topic.

Make scheduled deletions observable to event-driven indexers before
nextProvingPeriod processes removals.
Comment thread src/PDPVerifier.sol Outdated
scheduledRemovals[setId].push(pieceId);
}

emit PiecesScheduledForRemoval(setId, pieceIds);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

emit after listener instead of before, in case listener rejects

@nishant-uxs

Copy link
Copy Markdown
Contributor Author

Addressed in 8aba46b — emit now happens after the listener call, matching the other listener/emit sequences in PDPVerifier (e.g. _createDataSet, deleteDataSet, nextProvingPeriod), so a rejecting listener reverts before the event is recorded.

@rvagg

rvagg commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

thanks @nishant-uxs, this is going to need an abi update, make update-abi should do it

@nishant-uxs

nishant-uxs commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @rvagg — addressed.

make update-abi lives in FilOzone/filecoin-services (not this repo), so I opened a companion draft PR that adds PiecesScheduledForRemoval to the checked-in PDPVerifier ABI:

FilOzone/filecoin-services#566

Once this PR merges, we can bump service_contracts/lib/pdp to the merge commit and re-run make -C service_contracts update-abi so check-abi matches source.

@wjmelements
wjmelements merged commit 8f5821a into FilOzone:main Aug 4, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this to 🎉 Done in PDP Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

Emit an event when pieces are scheduled for removal (schedulePieceDeletions)

3 participants