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 (post FWSS v1.2.0, mainnet 30d avg, EGP-based)
| Method | Gas (30d avg) | Scales with | Critical threshold | Key code drivers |
|---|---|---|---|---|
| provePossession | 158.67M + 8.485M×log₂(N) avg 191M (auto-refit daily) |
5×log₂N SLOAD | Well-bounded. N=1M → ~317M. Not a disaster risk. | 5 challenges × findOnePieceId (log₂N binary search in Sum Tree). MerkleVerify is pure compute. Pyth oracle + BURN_ACTOR. FWSS callback: 2 SSTORE only. |
| nextProvingPeriod | ~153M (was 124M pre-v1.2.0) | constant | Not a risk alone. CDN adds ~120M (3 rail settlements). | Epoch mgmt + FWSS: updatePaymentRates() → modifyRailPayment() ×1–3. Increased post v1.2.0 as more datasets/CDN rails raise settlement cost. |
| nextProvingPeriod + K removals | 153M + K×O(log₂N) per removal | K × log₂N | Dynamic — see slider. Max queue: 2,000 (contract constant). | sumTreeRemove per piece: log₂N iterations of SLOAD+SSTORE. Delete pieceCid (2 SSTORE) + leafCount (1 SSTORE). |
| addPieces ×K | 228.72M + 78.20M×K (R²=0.9996) K=1:307M K=10:1,011M |
K linear | K>10: unobserved at scale. K>310: stuck forever. |
Per piece: sumTreeAdd (h SLOAD + 1 SSTORE) + pieceCid (2 SSTORE) + leafCount (1 SSTORE). piecesAdded() does NOT call modifyRailRate. |
| createDataSet | 1,123M no CDN · 1,168M CDN (was 796M/840M pre-v1.2.0) |
constant | Mass creation: N×1,123M/day. Threshold = daily headroom / 1,123M. | 6 SSTORE + BURN_ACTOR + FWSS: EIP-712 + 8 SSTORE + 3–7 FilecoinPay FVM calls. Gas +38% post v1.2.0. |
| terminateService | 137M no CDN · 257M CDN | constant | SP failure: all datasets terminated in one day. | terminateRail() ×1 or ×3 (CDN). Rails NOT auto-terminated on dataset delete — explicit call required. |