Daily headroom
—
Ggas/day for FWSS
FWSS gas/day
—
—
Proving gas/day
—
—
addPieces gas/day
—
—
Worst single tx
—
—
NPP removal gas
—
—
Analysis
All operations — gas model (code-derived, FVM/FEVM, mainnet values)
| Method | Mainnet gas | Scales with | Critical threshold | Key code drivers |
|---|---|---|---|---|
| provePossession | 158.67M + 8.485M×log₂(N) | 5×log₂N SLOAD | Well-bounded. N=1M → ~317M. Not a disaster risk. | 5 challenges × findOnePieceId (log₂N SLOAD binary search in Sum Tree). MerkleVerify is pure compute (off-chain proof). Pyth oracle + BURN_ACTOR. FWSS callback: 2 SSTORE only. |
| nextProvingPeriod (normal) | ~124M | constant | Not a risk alone. CDN adds negligible ~1M. | Epoch mgmt + FWSS: updatePaymentRates() → modifyRailPayment() ×1–3. Mainnet 2.3× Calibnet because mainnet settles real USDFC payments. |
| nextProvingPeriod + K removals | 124M + K×O(log₂N) per removal | K × log₂N | Dynamic — see slider. For N=229: stuck at K>33,244. For N=871k: stuck at K>24,471. Max queue: 2,000 (contract constant). | sumTreeRemove per piece: log₂N iterations of SLOAD+SSTORE. Delete pieceCid (2 SSTORE) + leafCount (1 SSTORE). Never observed at K>~80 on mainnet. |
| addPieces ×K | 215M + 66M×K K=1:281M K=10:778M |
K linear | K>10: unobserved. K>368: stuck forever. |
Per piece: sumTreeAdd (h SLOAD + 1 SSTORE) + pieceCid (2 SSTORE) + leafCount (1 SSTORE). Fixed: FWSS cross-call + EIP-712 + 1 SSTORE/piece metadata. piecesAdded() does NOT call modifyRailRate. |
| createDataSet | 796M no CDN · 840M CDN | constant | Mass creation risk: N datasets/day × 796M. Threshold: daily headroom / 796M. | 6 SSTORE + BURN_ACTOR + FWSS: EIP-712 + 8 SSTORE + 3–7 FilecoinPay FVM calls. |
| terminateDataSetPayment | 136M no CDN · 241M CDN | constant | SP failure risk: all datasets terminated in one day. | terminateRail() ×1 or ×3 (CDN). dataSetDeleted() has TODO — rails NOT auto-terminated, explicit separate call required. |