FWSS — Extreme Scenarios Calculator

Code-derived thresholds · Dynamic critical zones · FVM-aware · ← back to index

How thresholds are computed: Each slider shows where the danger zone begins — derived from the contract code, not arbitrary choices. addPieces stuck threshold: (tipset_budget − 215M) / 66M = 368 pieces. removals warning threshold: dynamic per dataset size N via O(K × log₂N). daily threshold: dynamic per background gas usage. Sliders start at today's mainnet values and go up to the code-defined maximum.
Daily gas budget
Target: 70,560 Ggas/day
OVER
of daily target used
non-FWSS
proving
addPieces
create
terminate
Worst single tx vs tipset budget
Tipset budget: ~24.5 Bgas (5B × 4.9 blocks)
STUCK FOREVER
of tipset budget
worst tx gas
tipset limit
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)
MethodMainnet gasScales with Critical thresholdKey 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.