Skip to content

feat: emit PiecesScheduledForRemoval when scheduling piece deletions - #287

Open
nishant-uxs wants to merge 2 commits into
FilOzone:mainfrom
nishant-uxs:feat/pieces-scheduled-for-removal-event
Open

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

Conversation

@nishant-uxs

Copy link
Copy Markdown

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

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

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

2 participants