Skip to content

Support CDN rail top-ups on Filecoin Pay v2 - #687

Open
Filip-L wants to merge 1 commit into
feat/filecoin-pay-v2from
fwss-pay-v2-top-up-cdn
Open

Filip-L wants to merge 1 commit into
feat/filecoin-pay-v2from
fwss-pay-v2-top-up-cdn

Conversation

@Filip-L

@Filip-L Filip-L commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

topUpCDNPaymentRails now also handles FilecoinPayV2 data sets. The storage terms pick the path. FilecoinPayV1 is unchanged.

On FilecoinPayV2, one script with no permissions locks the amounts from the payer's FilecoinPayV2 balance on the CDN and cache-miss rails. Lock and setRail need no grant from the payer.

Part of #669

What's changed

  • LibRailsV2.topUpCDNRails reads both rails before the script. FilecoinPayV2 deletes a terminated rail, so a missing one reverts with CDNPaymentAlreadyTerminated or CacheMissPaymentAlreadyTerminated, as on FilecoinPayV1
  • Both amounts zero, or either above uint128, revert with InvalidTopUpAmount. A short payer balance reverts with FilecoinPayV2's InsufficientBalance
  • A zero amount skips that rail's lock
  • The totals in CDNPaymentRailsToppedUp are each rail's available after the lock, so they account for earlier FilBeam settlements

The CDN rail still uses CDN_RAIL_NONCE_FLAG to match createRails. A follow-up PR will drop the flag from createRails, settleCDNRails and topUpCDNRails together (discussion).

No ABI or storage change.

@FilOzzy FilOzzy added this to FOC Dec 1, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Dec 1, 2026
@FilOzzy FilOzzy moved this from 📌 Triage to 🔎 Awaiting review in FOC Dec 2, 2026

This branch has not been deployed

No deployments
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.

1 participant