fix: include sybil fees in shared upload funding#400
Draft
Conversation
Collaborator
Author
|
@juliangruber feel free to take this over, or discard if its totally out of sync with what is needed to unblock #395 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR is the short-term mitigation for the recent
InsufficientLockupFundsfailures.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
newDataSetCountand include those fees in the planned depositplanFilecoinPayFunding()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 buildpnpm --filter filecoin-pin-upload-action-helper typecheckpnpm exec vitest run --project unit src/test/unit/payments-funding.test.ts src/test/unit/add.test.ts src/test/unit/import.test.tspnpm 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