Skip to content

Per-operation pricing for FilecoinWarmStorageService #469

@rvagg

Description

@rvagg

Project Tracking

This is the master tracking issue for the per-operation pricing changes for GA. Below is intended to make sure we're thinking wholistically on delivering for this effort:

About

FWSS currently charges clients a single streaming USDFC rate per dataset, scaled by stored data with a minimum floor. Storage providers are expected to absorb the gas cost of every onchain operation.

The proposed change is to introduce per-operation pricing. Onchain operations (create data set, add pieces, schedule piece removals, delete data set, terminate service) become individual billable line items, paid by the client to the SP at the moment the operation occurs. The streaming rate is split into a fixed Proving Service fee per data set plus a per-TiB storage rate.

All operation fees flow through the existing PDP payment rail via FilecoinPay's one-time payment mechanism. A small lifecycle reserve is locked at data set creation, replenished as operations occur, and refunded if unused at rail finalisation. No new payment rails are introduced.

Proposed prices (USDFC)

Initial values derived from observed gas costs at current FIL prices with headroom for volatility. Reasoning will be captured alongside the values so they can be revisited as conditions change; see #468. Tunability is a core requirement: prices must be adjustable as network conditions, gas, and FIL price drift.

This is the current draft price list, I'll update it if/when it changes. There's still some ongoing investigation.

Item Charge Notes
Storage $2.50 / TiB / month streaming rate, paid to SP
Proving Service $0.024 / data set / month streaming rate, additive to storage, paid to SP
Create Data Set $0
$0.00112
$0.0025
$0.025
one-time on creation, paid to SP.
Network Congestion Fee (below) also applies.
Network Congestion Fee $0.10 one-time on every data set creation, burned via FilecoinPay's USDFC auction (Sybil Fee)
Add Pieces $0.002
$0.0005 + $0.0003 x N
per addPieces call (flat per batch) (N = number of pieces in a batch), paid to SP
Schedule Piece Removals $0.002 per schedulePieceDeletions call (flat per batch), paid to SP
Delete Data Set $0.00112 only when user-signed authorisation is supplied, paid to SP
Terminate Service $0.00112 only when user-initiated, paid to SP
Egress / cache miss up to $0.014 / GB usage-settled by FilBeam

Implementation nuances

  • Empty data sets pay nothing. Storage rate and proving fee are zero until pieces exist. Both activate on first piecesAdded. Charge floor price even if zero data #458 likely won't be needed.
  • Proving fee is additive, not a floor. Rate becomes naturalRate(bytes) + provingFee, replacing the current max(naturalRate, floor).
  • Add vs delete batch asymmetry. addPieces is bounded to 61 pieces per call by the extraData size limit. schedulePieceDeletions has no equivalent cap (only PDPVerifier's MAX_ENQUEUED_REMOVALS = 2000 per-data set queue limit). Per-op delete pricing creates SP gas asymmetry at large batch sizes. Cost of delete is spread over schedulePieceDeletions and nextProvingPeriod so is hard to measure. addPieces batch size may be lifted (Should we increase the extradata limits ? #460) and we may reconsider this cost based on the higher limits.
  • Lifecycle reserve. A small fixed-lockup pool (in the order of ~$0.10) is maintained on the PDP rail to give users headroom for wind-down operations after termination, when FilecoinPay forbids refilling a terminated rail's lockup. While the rail is active the pool also smooths per-op gas: most ops draw their fee from the pool in a single call, with periodic refills back to target when the balance drops below a threshold. Users see ~$0.10 of additional USDFC locked while the data set is active, refunded at rail finalisation.
  • Lockup window after termination. Per-op fees continue firing from the existing lifecycle reserve. FilecoinPay forbids raising a terminated rail's fixed lockup, so the pool cannot be refilled. Users wanting more wind-down deletions than their pool supports must pre-fund before terminating; SP-terminated users are stuck with whatever was in the pool at termination.
  • Asymmetric termination paths. User-initiated terminateService charges the termination fee and best-effort tops up the lifecycle reserve. SP-initiated termination charges no fee and does not top up.
  • Delete-data set fee gated by user signature. Per FilOzone/filecoin-services#457 (now in scope), the fee fires only when the SP supplies a valid client EIP-712 authorization. SP-unilateral deletions remain free.
  • Token precision. $0.024/month math fits 18-decimal USDFC. Does not fit 6-decimal stablecoins (axlUSDC etc.). Launch is USDFC-only; multi-token support is will have a per-token PriceList and 6-decimal tokens likely get a proving fee of $0.0864/month.
  • Existing data sets are not back-filled. Live rails keep their pre-upgrade rate until the next piecesAdded or nextProvingPeriod-with-removals triggers a recalculation. Dormant pre-upgrade datasets stay at the old rate indefinitely.
  • Per-epoch precision. The rail rate is (storagePerMonth + provingServicePerMonth) / EPOCHS_PER_MONTH, integer-divided. Each summed component truncates sub-USDFC per epoch; total cumulative loss is ~1e-13 USDFC per month, well below USDFC's smallest representable unit. Same magnitude as the existing floor model, just two truncations summed instead of one MAX'd. Lockup and pre-flight math must use multiply-first form (perMonth × months) to preserve the exact user-facing monthly value; per-epoch truncation is a rail-side artefact only. Same pattern the contract already uses for the floor; SDK should mirror it.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
⌨️ In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions