Assessment reports>Filecoin Services Payments>Threat Model>modifyRailLockup

Function: modifyRailLockup(uint256 railId, uint256 period, uint256 lockupFixed)

This function modifies a rail’s lockup configuration. If the rail is terminated, only the fixed lockup may be reduced and the period must remain unchanged. If the rail is active, the period and/or fixed lockup may be adjusted subject to account-funding and operator-allowance constraints. The function settles the payer’s account before and after.

Inputs

  • railId

    • Control: Chosen by the operator.

    • Constraints: Must reference an active rail (validateRailActive(railId)), and onlyRailOperator(railId) must hold. Account lockup is settled before/after via settleAccountLockupBeforeAndAfterForRail(railId, false, 0).

    • Impact: Selects which Rail is modified and which event is emitted.

  • period

    • Control: Chosen by the operator.

    • Constraints: If the rail is terminated, it must equal rail.lockupPeriod. If the rail is active and the payer’s account is not fully settled, it must also equal rail.lockupPeriod. When increasing the period on an active rail, it must be ≤ operatorApproval.maxLockupPeriod.

    • Impact: Determines the dynamic component of the new lockup — may change rail.lockupPeriod (active rails only) and adjust payer.lockupCurrent and operator lockup usage accordingly.

  • lockupFixed

    • Control: Chosen by the operator.

    • Constraints: If the rail is terminated, it must be ≤ current rail.lockupFixed. If the rail is active and the payer’s account is not fully settled, it must be ≤ current rail.lockupFixed. Any increase requires sufficient operator lockup allowance and sufficient payer funds.

    • Impact: Contributes to the new lockup — updates payer.lockupCurrent, operator lockup usage, and rail.lockupFixed.

Branches and code coverage

Intended branches

  • For a terminated rail — reduce lockupFixed only, keep period unchanged, update payer lockup and operator usage, and emit RailLockupModified.

  • For an active rail, payer fully settled — change period and/or lockupFixed within operator limits, adjust payer lockup and operator usage, and emit event.

  • For an active rail, payer not fully settled — only allow lockupFixed to decrease and period to remain unchanged and emit event.

  • Revert — terminated rail with period change or lockupFixed increase.

  • Revert — increasing period beyond operatorApproval.maxLockupPeriod.

  • Revert — insufficient payer.lockupCurrent for old/new lockup requirements or postsettlement check failure.

Zellic © 2025Back to top ↑