SupplyPolicy

data class SupplyPolicy(val lowWatermarkSlots: Long = 1, val targetSlots: Long = 2)

How much supply a LocalHeddle keeps ahead of its leases, in rounds of capacity: one round is every slot (LocalHeddle.reconcileCapacity) leased once at LocalPolicy.defaultReservation.

When an LocalHeddle.acquire or LocalHeddle.extend would leave the root holding less than lowWatermarkSlots rounds, it first mints enough that the root still holds targetSlots rounds after it. So a top-up runs about once per targetSlots − lowWatermarkSlots rounds of leases, and the low watermark is the headroom kept for what is never refused: an overrun charged at LocalHeddle.complete, and an LocalHeddle.admit. Work beyond that headroom is still charged, through a mint of its own. A top-up never carries the root's minted supply past the lifetime watermark (LocalHeddle.LIFETIME_HEADROOM): it is trimmed there first, so the float is never what refuses an acquire.

Constructors

Link copied to clipboard
constructor(lowWatermarkSlots: Long = 1, targetSlots: Long = 2)

Properties

Link copied to clipboard

the rounds of supply below which a top-up runs. Non-negative.

Link copied to clipboard

the rounds of supply a top-up leaves. At least lowWatermarkSlots.