# Tiers and timelocks

> The five tiers of a Truss vault, what each covers, how long each waits, and how a delayed change is scheduled, run or cancelled.

Source: https://docs.trusslabs.io/vaults/roles/tiers-and-timelocks

A timelock is a delay between deciding a change and making it. Each role in a vault sits at a tier, and the tier
sets how long its holder waits. Risky changes wait longest, so holders and anyone watching can see them coming.

> **Key points**
>
> - Every role sits at one of five tiers, fixed in the roles table and the same in every vault of an environment.
> - Each vault chooses how many seconds each tier waits when it is deployed.
> - A delayed change is scheduled with its exact call, waits its tier, then runs. The VaultAdmin can cancel it
>   meanwhile.
> - No change waits for pending redemptions, so a delay gives notice, not a way out.

## The five tiers

| Tier | What sits there | Committed preprod configs |
|---|---|---|
| Immediate | Daily operations, settlement, turning fees into shares, pauses, returning capital, every lower and tighten, clearing the instant source, rescues, removing a price adapter, NAV invalidation and re-anchoring, forced transfers | No wait |
| LOW | Raising the instant redemption fee | 1 hour |
| MEDIUM | Raising the entry, exit, management and performance fees | 3 days |
| HIGH | Raising caps, rate limits and instant limits; loosening the freshness gate; unpausing; resetting the high-water mark; changing the fee recipient | 7 days |
| CRITICAL | Adding a sub-account, registering an asset, binding a price adapter, policy or module, allowing call shapes, changing a NAV provider, setting the instant source, and the access manager's admin actions | 14 days |

Each vault's tiers are chosen at deployment. They are either all zero, which turns timelocks off, or strictly
increasing from LOW to CRITICAL. Each must also be at least the factory's floor for it, which is zero on the
committed configs. The committed staging configs set every tier to zero. With timelocks off, every change is one
transaction, and events are the only notice.

## How a delayed change runs

1. The holder schedules the exact call on the vault's access manager with `schedule(target, data, when)`.
2. The access manager emits `OperationScheduled` with the full calldata, so anyone can see what is coming and when.
3. Once the delay has passed, the holder runs it with `execute(target, data)`, or calls the target directly.
4. A scheduled call expires if it is not run within a week of becoming ready.

`cancel(caller, target, data)` cancels a scheduled call. The key that scheduled it can cancel it, and so can the
VaultAdmin, which holds both cancellers. It can cancel any fee raise a vault manager schedules.

A change made while a redemption is pending applies to it. A holder who does not want it can cancel the request
and take every share back, or use the instant path if it is open.

## Grant delays

A grant delay is how long a newly granted holder waits before it holds a role.

| New holder of | Granted by | Can act |
|---|---|---|
| Settler or donor roles, or a sub-account's return role | VaultAdmin or a vault manager | At once |
| Allocator role, or a sub-account's execute role | VaultAdmin or a vault manager | After HIGH |
| Any other immediate role, such as a vault manager's or the Sentry's | VaultAdmin | After CRITICAL |
| A delayed role, such as a fee raise | VaultAdmin, scheduled | After CRITICAL |
| The admin role | VaultAdmin, scheduled | After CRITICAL, then CRITICAL again |

Revoking an immediate role is immediate. Revoking a delayed role waits CRITICAL. The grant delays set at
deployment take effect five days after launch, the access manager's setback. Until then, they do not apply.

## Where to read more

| Page | What it covers |
|---|---|
| [Who can call what](https://docs.trusslabs.io/vaults/roles/function-permissions.md) | The tier of every restricted function |
| [Operator multicalls](https://docs.trusslabs.io/vaults/roles/owned-multicall.md) | Adding, rotating and removing operator keys |
| [Deployment parameters](https://docs.trusslabs.io/vaults/reference/deployment-parameters.md) | The delay tiers and the factory's floors |
| [What can change after deployment](https://docs.trusslabs.io/vaults/overview/what-can-change.md) | Every lever and its tier |
