Skip to content

feat(pdp): add AddRoots tracking endpoints #535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 20, 2025

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Jun 13, 2025

From #530 for the synapse branch.

Summary is that AddRoots is currently a blind operation, you throw it over to Curio and cross your fingers. This is unlike CreateProofSets where you get a Location header response which points you to a URL which will give you both the transaction to watch on chain and the status as far as Curio is concerned.

This adds similar capabilities for AddRoots; you get a Location header and the ability to track an AddRoots operation. It also fills in the stub implementation of handleGetProofSetRoot which is a generalised "get me root info" endpoint.

This is being used to do the full onboarding lifecycle from the client end, allowing the end-user to track the transaction both on chain and getting Curio confirmation that it agrees it's landed.

feat(pdp): add transaction tracking for root additions

- Add Location header to root addition response with tx hash
- Add GET /proof-sets/{id}/roots/added/{txHash} endpoint for status checks
- Implement handleGetProofSetRoot for retrieving root details
- Return confirmed root IDs after transaction confirmation

and (bugfix):

fix(pdp): use lowercase transaction hashes consistently in database operations

and:

fix(pdp): retain root addition records to prevent 404s on status queries 

Previously, pdp_proofset_root_adds records were deleted after processing,
causing clients to receive 404 errors when querying transaction status
after successful root additions. This created a poor UX as clients couldn't
verify transaction outcomes if they queried too late.

This change aligns root addition tracking with proof set creation by:
- Adding roots_added column to mark processed records instead of deleting
- Updating watcher to UPDATE instead of DELETE when processing completes
- Including roots_added status in API response for client visibility

The fix ensures transaction status remains queryable indefinitely while
maintaining backward compatibility. Existing records will be processed
normally with roots_added=FALSE by default.

API enhancement: /pdp/proof-sets/{id}/roots/added/{txHash} now includes
"rootsAdded" field indicating if roots were fully processed.

@rvagg rvagg force-pushed the rvagg/addroot-enhanced-main branch 2 times, most recently from 5bbe663 to 1761c84 Compare June 14, 2025 01:10
@rvagg
Copy link
Member Author

rvagg commented Jun 14, 2025

@LexLuthr I removed the AuthService stuff from here so it should be good for review now

@ZenGround0
Copy link
Collaborator

#530 LGTM for landing in main, once that review is responded to and this is rebased I'll look this one over one more time.

rvagg added 5 commits June 17, 2025 13:17
- Add Location header to root addition response with tx hash
- Add GET /proof-sets/{id}/roots/added/{txHash} endpoint for status checks
- Implement handleGetProofSetRoot for retrieving root details
- Return confirmed root IDs after transaction confirmation
Previously, pdp_proofset_root_adds records were deleted after processing,
causing clients to receive 404 errors when querying transaction status
after successful root additions. This created a poor UX as clients couldn't
verify transaction outcomes if they queried too late.

This change aligns root addition tracking with proof set creation by:
- Adding roots_added column to mark processed records instead of deleting
- Updating watcher to UPDATE instead of DELETE when processing completes
- Including roots_added status in API response for client visibility

The fix ensures transaction status remains queryable indefinitely while
maintaining backward compatibility. Existing records will be processed
normally with roots_added=FALSE by default.

API enhancement: /pdp/proof-sets/{id}/roots/added/{txHash} now includes
"rootsAdded" field indicating if roots were fully processed.
@LexLuthr LexLuthr merged commit 8b843c1 into filecoin-project:main Jun 20, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants