> For the complete documentation index, see [llms.txt](https://solana-unchained.gitbook.io/whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://solana-unchained.gitbook.io/whitepaper/technical-specifications/consensus-finality-and-epoch-anchored-state-settlement.md).

# Consensus Finality & Epoch-Anchored State Settlement

1\. **Solana's Base Consensus Layer**

Solana Unchained is built on Solana, which uses Tower BFT — a Proof-of-History (PoH) enhanced Byzantine Fault Tolerant consensus. Key properties relevant to reorg handling:

* Blocks achieve optimistic confirmation after \~32 validator votes (\~2–3 seconds)
* Blocks reach full finalization after a supermajority (>2/3 of stake) locks in via Tower BFT — approximately 13 seconds
* Deep reorgs (more than a few slots) are economically and cryptographically near-impossible due to exponential lockout penalties on validators who vote on conflicting forks

2\. **Epoch Structure on Solana**

A Solana epoch spans approximately 432,000 slots (\~2.5 days). At each epoch boundary:

* Validator stake weights are recalculated
* Leader schedules are rotated
* Staking rewards are distributed

For Solana Unchained's Vault and staking contracts, epoch boundaries act as settlement anchors — the point at which yield accrual, lock period progression, and reward distribution are finalized.

3\. **How Reorgs Are Handled at the Protocol Level**

| Scenario                             | Outcome                                                                                     |
| ------------------------------------ | ------------------------------------------------------------------------------------------- |
| Short-range fork (1–4 slots)         | Resolved by Tower BFT before epoch anchor is written; no impact on protocol state           |
| Medium-range fork (pre-finalization) | Tower BFT lockout penalties prevent validators from switching; fork resolved within seconds |
| Post-finalization reorg              | Cryptographically impossible — finalized blocks cannot be reversed under Tower BFT          |
| Epoch boundary reorg                 | Cannot occur — epoch anchors are only written after underlying slots are finalized          |

By the time an epoch anchor is recorded, every slot within that epoch is already Tower BFT finalized. The epoch anchor is a downstream artifact of finalized state, not a consensus mechanism itself.

4\. **Protocol-Level Safeguards for Unchained Contracts**

* All state-changing instructions require confirmed or finalized commitment level
* Yield snapshots reference epoch-boundary slot hashes, which are immutable post-finalization
* Lock period expirations are calculated using absolute slot numbers, not timestamps, to prevent clock drift manipulation


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://solana-unchained.gitbook.io/whitepaper/technical-specifications/consensus-finality-and-epoch-anchored-state-settlement.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
