Skip to content

feat(fwss): emit dataset deletion auth signer#474

Draft
rvagg wants to merge 3 commits into
mainfrom
rvagg/delete-dataset-validated-event
Draft

feat(fwss): emit dataset deletion auth signer#474
rvagg wants to merge 3 commits into
mainfrom
rvagg/delete-dataset-validated-event

Conversation

@rvagg
Copy link
Copy Markdown
Collaborator

@rvagg rvagg commented May 11, 2026

Lift the DeleteDataSet EIP-712 typehash into SignatureVerificationLib and use it to optionally verify deletion auth passed through PDP extraData.

Emit an FWSS DataSetDeleted event with the authorized signer when the client or a valid session key signed the delete request, or address(0) when deletion is unauthenticated, malformed, or unilateral.

Closes: #457

Lift the DeleteDataSet EIP-712 typehash into SignatureVerificationLib and use
it to optionally verify deletion auth passed through PDP extraData.

Emit an FWSS DataSetDeleted event with the authorized signer when the client
or a valid session key signed the delete request, or address(0) when deletion
is unauthenticated, malformed, or unilateral.

Closes: #457
@rvagg rvagg requested review from Kubuxu, Copilot and wjmelements May 11, 2026 11:30
@FilOzzy FilOzzy added this to FOC May 11, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC May 11, 2026
Copy link
Copy Markdown
Contributor

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 adds optional EIP-712 attribution for dataset deletions in the FilecoinWarmStorageService (FWSS) callback flow: when a delete request includes a valid DeleteDataSet(uint256 dataSetId) signature (from the payer or an authorized session key), FWSS emits the authorized signer in a new DataSetDeleted event; otherwise it emits address(0) while still allowing deletion.

Changes:

  • Lift DeleteDataSet(uint256 dataSetId) EIP-712 typehash into SignatureVerificationLib and add non-reverting signer recovery + authorization helper for optional delete signatures.
  • Extend FWSS dataSetDeleted callback to parse optional extraData, verify attribution, and emit DataSetDeleted(dataSetId, payer, serviceProvider, signer).
  • Add tests covering tryRecoverSigner behavior and DataSetDeleted signer attribution scenarios; update fixtures/spec/ABI accordingly.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
SPEC.md Documents optional delete authorization via PDP extraData and expected event attribution semantics.
service_contracts/src/lib/SignatureVerificationLib.sol Adds DELETE_DATA_SET_TYPEHASH, tryRecoverSigner, and authorizedDeleteDataSetSigner helper.
service_contracts/src/FilecoinWarmStorageService.sol Decodes optional delete auth from extraData, computes EIP-712 digest, emits new DataSetDeleted event.
service_contracts/test/FilecoinWarmStorageService.t.sol Adds unit tests for tryRecoverSigner and deletion event signer attribution paths.
service_contracts/test/SignatureFixtureTest.t.sol Switches delete typehash fixture to reference library constant.
service_contracts/abi/FilecoinWarmStorageService.abi.json Adds DataSetDeleted event and names the extraData parameter in dataSetDeleted.

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

Comment thread service_contracts/src/lib/SignatureVerificationLib.sol
Comment thread service_contracts/src/lib/SignatureVerificationLib.sol Outdated
_hashTypedDataV4(keccak256(abi.encode(SignatureVerificationLib.DELETE_DATA_SET_TYPEHASH, dataSetId)));

return SignatureVerificationLib.authorizedDeleteDataSetSigner(payer, signature, digest, sessionKeyRegistry);
}
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.

Should we move this to SignatureVerificationLib to not increase the size of this contract?

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.

Unfortunately, moving _hashTypedDataV4 out of the contract is nontrivial. We would have to find another library.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Latest commit saves 2 bytes, but not really by moving stuff.

We could move the typehash creation out of here into the library, we'd want to do the same with schedulePieceRemovals, but then we incur a cross-contract call gas just to do a trivial abi.encode in both cases. The createDataSet and addPieces typehash creation is in the library right now, so conceptually everything belongs in there, but in those two cases there's a non-trivial amount of work to do.

This whole change so far adds 43 bytes to the contract. We still have 594 bytes headroom so the pricing changes may be forced to use library calls.

Comment thread service_contracts/src/FilecoinWarmStorageService.sol Outdated
@BigLep BigLep moved this from 📌 Triage to ⌨️ In Progress in FOC May 11, 2026
@rvagg rvagg requested review from Kubuxu and wjmelements May 12, 2026 05:17
@rvagg rvagg marked this pull request as draft May 12, 2026 06:09
@rvagg
Copy link
Copy Markdown
Collaborator Author

rvagg commented May 12, 2026

Converting to draft for now, #469 (comment) is an important point, the timing of using the 712 for this call makes an awkward gap from client->deletion. We need a better mechanism here to incentivise clean-up, make it so the client doesn't have to submit an on-chain msg under normal circumstances, and get the SP some funds to justify the clean-up work. Will move some design discussion back to #457 first cause there are options.

@rvagg
Copy link
Copy Markdown
Collaborator Author

rvagg commented May 15, 2026

Closing this pending #477; same code could be reused but some of it will need to change.

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

Labels

None yet

Projects

Status: ⌨️ In Progress

Development

Successfully merging this pull request may close these issues.

Emit event from dataSetDeleted method, handle optional signed user auth

6 participants