Mina Delegations Explained
A deep dive into the delegation lifecycle on Mina.
Delegation Statuses
On the Mina blockchain, there are no statuses for delegations. However, we find it reasonable to introduce delegation statuses since delegations may come in different states. To do so, it's critical to understand how delegations are processed within the Mina Protocol.
We suggest the following statuses for a delegation: Waiting, Active, Replaced, Skipped, Ended:
WAITING is a status when a new delegation is made until it becomes active. It takes two epochs.
ACTIVE is when a delegation is active and produces rewards.
REPLACED is a status when another delegation replaced a delegation to another validator before rewards were produced since, in the Mina blockchain, there can currently be only one delegation, which fixes the account balance at the end of each epoch.
SKIPPED is a status when a new delegation was made to the same validator again before rewards were produced; such a transaction makes no sense since the account balance will be fixed at the end of the epoch as it is, and the validator remains the same.
ENDED is a status when a delegation cycle ends with rewards being produced, which was triggered by changing the validator two epochs before.
Ledger Stages
Delegation data is entered in 4 ledgers: the snarked ledger, the staking ledger, the next epoch ledger, and the staged ledger. Each ledger extracts data from node databases.
Glossary
Staged ledger - the most recent ledger (from the best tip of that node). A staged ledger can be regarded as a "Pending accounts database" that has transactions (payments, coinbase, and proof-fees) applied, for which there are no snarks available yet.
Snarked ledger - the ledger containing only transactions that have an associated proof.
Next epoch ledger - the staking ledger for the next epoch.
Staking ledger - the ledger used to determine the block producer for a slot.
The diagram below illustrates the delegation lifecycle.
When a delegation is made (Epoch X), it enters the Staged Ledger. The delegation transaction enters the scan state for snark workers to generate a snark proof of the transaction - the amount of time this takes depends on the network's transaction throughput. Once proof containing the delegation transaction is generated, a new snarked ledger is produced.
- By the end of Epoch X, the delegation amount can change with the changes in the account balance. On the last block of the epoch, when the delegation is made, the account balance gets fixed, and this becomes the delegation amount that moves on to the next epoch.
- In the next epoch (Epoch X+1), the delegation amount is fixed starting with the first block of Epoch X+1. From now on, the delegation amount will not change whatever changes may come with the account balance.
After the 290th block of Epoch X+1, the staking ledger is finalized and named the next epoch ledger. However, the delegation is not active yet. - By the end of Epoch X, the delegation amount can change with the changes in the account balance. On the last block of the epoch, when the delegation is made, the account balance gets fixed, and this becomes the delegation amount that moves on to the next epoch.
- In the next epoch (Epoch X+1), the delegation amount is fixed starting with the first block of Epoch X+1. From now on, the delegation amount will not change whatever changes may come with the account balance.
After the 290th block of Epoch X+1, the staking ledger is finalized. However, the delegation is not active yet.
In the next epoch (Epoch X+2), starting from the first block of the epoch, the delegation becomes active. The delegation remains active until the last block of Epoch X+2.
Rewards can be paid in Epoch X+2, Epoch X+3 or later. Mina does not regulate the validator-delegator relationship, so each validator sets its own payout schedule. You can see the reward payment terms here.
For more information on the reward payment please go here.
Updated 9 months ago