From 75e531f66ab8473fbe43fec28013610245442276 Mon Sep 17 00:00:00 2001 From: claus Date: Fri, 12 Dec 2025 16:00:25 -0300 Subject: [PATCH] fix: updating the docs related to validator exit --- .../optimistic-democracy/staking.mdx | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/staking.mdx b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/staking.mdx index 973b2833..877f6704 100644 --- a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/staking.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/staking.mdx @@ -214,10 +214,34 @@ Rewards automatically increase the stake-per-share ratio without requiring user Both validators and delegators face a **7-epoch unbonding period** when withdrawing: - Prevents rapid stake movements that could destabilize the network -- Tokens stop earning rewards immediately upon exit +- Exit is not processed immediately - validator remains active until next `validatorPrime()` call at next epoch +- Exited tokens stop earning rewards only after the exit is processed in the next epoch - Countdown starts from the exit epoch - Funds become claimable when: `current_epoch >= exit_epoch + 7` +**Detailed Exit Flow**: + +``` +Epoch N: validatorExit(all_shares) called + → Exit scheduled in contract state + → Validator STILL ACTIVE and earning rewards + → Can still be selected for consensus participation + +Epoch N+1: validatorPrime() called (by anyone) + → Exit processed: stake reduced to 0 + → Removed from validator tree + → No longer active or earning rewards + → Cannot be selected for new transactions + +Epoch N+2: epochAdvance() called + → Validator officially not in active validator set + → Fully excluded from consensus operations + +Epoch N+7: validatorClaim() callable + → 7 epochs have passed since exit call (epoch N) + → Tokens released to validator owner +``` + ## Validator Priming `validatorPrime(address validator)` is a critical function that: