Skip to content

Conversation

Chaitu-Tatipamula
Copy link
Contributor

Description

This PR implements the feature described in #171 at filecoin-services to merge createDataset and addPieces operations for a streamlined user experience.

Changes

PDP Verifier Updates

  • Enhanced addPieces function: Now accepts (datasetID, listenerAddress, pieces, extraData) parameters
  • New dataset creation: Use datasetID = NEW_DATA_SET_SENTINEL (type(uint256).max) with a valid listenerAddress to create a new dataset and add pieces in a single transaction
  • Existing dataset updates: Use listenerAddress = 0 with an existing datasetID to add pieces to existing datasets
  • Removed createDataset method: No longer needed as functionality is merged into addPieces

Test Improvements

  • Added comprehensive test coverage for the combined create-and-add flow
  • Fixed listener initialization issues across test contracts
  • Added TestConstants.sol for shared constants like NEW_DATA_SET_SENTINEL
  • Updated all test contracts to use the new streamlined approach

Benefits

  • Single transaction: Users can create datasets and add pieces in one operation
  • Reduced wait times: No need to wait for dataset creation confirmation before adding pieces
  • Simplified UX: One client signing operation instead of two
  • Backward compatibility: Existing functionality for adding to existing datasets preserved

Testing

  • All existing tests pass
  • New tests cover the combined create-and-add flow
  • Listener initialization issues resolved
  • Event emission verified for both dataset creation and piece addition

Related Issue

Closes #171 at filecoin-services

@rjan90 rjan90 moved this to 🔎 Awaiting review in PDP Sep 18, 2025
@rjan90 rjan90 requested review from Copilot, ZenGround0, Kubuxu and aarshkshah1992 and removed request for Copilot September 18, 2025 12:20
@Chaitu-Tatipamula Chaitu-Tatipamula force-pushed the feature/merge-create-dataset-add-pieces branch from f475b64 to 53eb289 Compare September 18, 2025 14:03
@Chaitu-Tatipamula Chaitu-Tatipamula force-pushed the feature/merge-create-dataset-add-pieces branch from 53eb289 to 162dc83 Compare September 18, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔎 Awaiting review
Development

Successfully merging this pull request may close these issues.

Merge createDataset and addPiece for streamlined dataset creation and piece addition
1 participant