Repository navigation
feat: emit PiecesScheduledForRemoval when scheduling piece deletions - #287
wjmelements merged 2 commits into
Conversation
Make scheduled deletions observable to event-driven indexers before nextProvingPeriod processes removals.
| scheduledRemovals[setId].push(pieceId); | ||
| } | ||
|
|
||
| emit PiecesScheduledForRemoval(setId, pieceIds); |
There was a problem hiding this comment.
emit after listener instead of before, in case listener rejects
|
Addressed in 8aba46b — emit now happens after the listener call, matching the other listener/emit sequences in |
|
thanks @nishant-uxs, this is going to need an abi update, |
|
Thanks @rvagg — addressed.
FilOzone/filecoin-services#566 Once this PR merges, we can bump |
|
This PR limits the number of scheduled pieces per transaction to about ~254 due to the 8KiB event size limit. I detected this while running a benchmark sweep. |
|
👍 my preference would be to do it in chunks, at some boundary like 100, but doing it by ID I guess could be fine too since indexers would have the original mapping of cid to id; or at least they'll have to |
These are still 32 bytes in solidity. |
You are right, interesting that that is the definition of alignment rules. |
Summary
PiecesScheduledForRemoval(setId, pieceIds)fromschedulePieceDeletionsso indexers can observe scheduled removals immediately, without waiting forPiecesRemovedat the next proving boundary.IPDPEventsalongside the existing piece lifecycle events.Closes #281
Files Changed
src/interfaces/IPDPEvents.solsrc/PDPVerifier.soltest/PDPVerifier.t.solTesting Performed
forge build --via-irforge test --via-ir(187 passed)Known Limitations
piecesScheduledRemovebehavior; event is for log-driven consumers.Risk Assessment