Skip to content

fix: include sybil fees in shared upload funding#400

Draft
rjan90 wants to merge 2 commits intomasterfrom
codex/fix-upload-funding-sybil-fee
Draft

fix: include sybil fees in shared upload funding#400
rjan90 wants to merge 2 commits intomasterfrom
codex/fix-upload-funding-sybil-fee

Conversation

@rjan90
Copy link
Copy Markdown
Collaborator

@rjan90 rjan90 commented Apr 2, 2026

Summary

This PR is the short-term mitigation for the recent InsufficientLockupFunds failures.

It keeps filecoin-pin's existing funding planner, but patches the shared upload funding path so both the GitHub Action and CLI auto-fund logic include the new-data-set 0.1 USDFC sybil fee.

What changed

  • add the WarmStorage new-data-set sybil fee constant to filecoin-pin payment constants
  • extend the shared funding planner to accept newDataSetCount and include those fees in the planned deposit
  • thread that input through planFilecoinPayFunding()
  • update CLI auto-fund to resolve upload contexts and count how many new data sets will be created
  • update the upload action to do the same and feed the result into the shared planner
  • add targeted unit coverage for the planner and the add/import auto-fund call sites

Why

The failure we hit was caused by funding only the lockup requirement for an upload while omitting the 0.1 USDFC fee charged when a new WarmStorage data set is created.

Because upload-time funding exists in both the upload action and CLI auto-fund flow, the short-term patch should live in the shared planner path rather than only in the action wrapper.

Scope and tradeoff

This is intentionally the tactical fix.

It does not replace filecoin-pin's custom cost planner with Synapse's full upload-cost calculation. Instead, it patches the known missing fee in the existing planner so the immediate failure is addressed with a smaller change set.

The longer-term cleanup direction is in #401.

Validation

  • pnpm run build
  • pnpm --filter filecoin-pin-upload-action-helper typecheck
  • pnpm exec vitest run --project unit src/test/unit/payments-funding.test.ts src/test/unit/add.test.ts src/test/unit/import.test.ts
  • pnpm exec biome check src/core/payments/constants.ts src/core/payments/types.ts src/core/payments/funding.ts src/payments/types.ts src/payments/fund.ts src/common/upload-flow.ts src/add/add.ts src/import/import.ts src/test/unit/payments-funding.test.ts src/test/unit/add.test.ts src/test/unit/import.test.ts upload-action/src/filecoin.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] Fund upload-action sybil fees for new data sets [codex] Short-term: include sybil fees in shared upload funding Apr 2, 2026
@rjan90 rjan90 changed the title [codex] Short-term: include sybil fees in shared upload funding fix: fund upload-action sybil fees for new data sets Apr 2, 2026
@rjan90
Copy link
Copy Markdown
Collaborator Author

rjan90 commented Apr 2, 2026

@juliangruber feel free to take this over, or discard if its totally out of sync with what is needed to unblock #395

@rjan90 rjan90 changed the title fix: fund upload-action sybil fees for new data sets fix: include sybil fees in shared upload funding Apr 2, 2026
@rjan90 rjan90 requested a review from juliangruber April 2, 2026 10:41
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