Skip to content

[codex] Long-term: use SDK upload-cost planning in upload action#401

Draft
rjan90 wants to merge 1 commit intomasterfrom
codex/fix-upload-funding-sdk-prepare
Draft

[codex] Long-term: use SDK upload-cost planning in upload action#401
rjan90 wants to merge 1 commit intomasterfrom
codex/fix-upload-funding-sdk-prepare

Conversation

@rjan90
Copy link
Copy Markdown
Collaborator

@rjan90 rjan90 commented Apr 2, 2026

Summary

This PR is the longer-term cleanup direction, not the tactical patch.

It replaces the upload action's custom deposit estimate with the SDK's multi-context upload cost calculation so funding stays aligned with the actual upload path.

What changed

  • resolve the exact upload contexts before funding
  • replace the upload action's custom deposit estimate with synapse.storage.calculateMultiContextCosts(...)
  • keep approval handling for the zero-deposit but approval-needed case
  • thread withCDN and providerIds into funding so it matches the actual upload path

Why

The upload action currently uses a simplified planner while the actual upload path is SDK-managed and multi-context. That makes it easy for pricing, copy-count, or dataset-creation rules to drift and cause underfunding bugs.

Using the SDK's own upload-cost calculation is the cleaner long-term fix for this class of issue.

Scope and tradeoff

This is a broader behavioral change than the short-term mitigation in #400.

It is valuable as the cleanup direction, but it is not the smallest patch to unblock the immediate failure.

Validation

  • pnpm run build
  • pnpm --filter filecoin-pin-upload-action-helper typecheck
  • pnpm exec biome check upload-action/src/filecoin.js upload-action/src/types.ts upload-action/src/upload.js

@FilOzzy FilOzzy added team/filecoin-pin "Filecoin Pin" project is a stakeholder for this work. team/fs-wg FOC working group is a stakeholder for this work, and thus wants to track it on their project board. labels Apr 2, 2026
@FilOzzy FilOzzy added this to FOC Apr 2, 2026
@github-project-automation github-project-automation bot moved this to 📌 Triage in FOC Apr 2, 2026
@rjan90 rjan90 changed the title [codex] Use SDK upload-cost planning in upload action [codex] Long-term: use SDK upload-cost planning in upload action Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team/filecoin-pin "Filecoin Pin" project is a stakeholder for this work. team/fs-wg FOC working group is a stakeholder for this work, and thus wants to track it on their project board.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants