# Multi-Oracle Node Reliability & Leadership Rotation

To enhance the reliability and fault tolerance of Cortensor’s oracle infrastructure, a phased approach is being adopted to transition from a single-oracle setup to a distributed and resilient oracle cluster model. This will reduce downtime risks caused by unstable RPC endpoints or stalled oracle nodes.

## Phase 1: Off-Chain Rotation via NTP-Based Logical Coordination

**Overview**\
In the initial phase, leadership among multiple oracle nodes is managed off-chain using synchronized NTP timestamps and logical rules.

### **Mechanism**

* All oracle nodes maintain a synchronized clock using NTP.
* A round-robin rotation schedule determines which node is active leader during a given time window.
* The current leader is responsible for executing critical oracle tasks (e.g., triggering Cognitive tasks, session updates).
* If the leader becomes unresponsive or exceeds its window:
  * The next designated oracle takes over automatically.
  * Leadership changes are based on elapsed time and session activity checks.

### **Advantages**

* Simple and fast to implement.
* Enables automated fallback and basic fault tolerance without requiring contract-level changes.
* Effective during early-stage deployment with low consensus overhead.

***

## Phase 2: On-Chain Coordination via Smart Contract Timestamping

**Overview**\
In the second phase, oracle coordination will be enforced and recorded on-chain, increasing transparency and trustlessness.

### **Mechanism**

* Oracle nodes submit heartbeat or activity proofs (e.g., session commits) to a smart contract.
* The smart contract tracks:
  * The active oracle node.
  * Timestamp of last valid action.
* If a node fails to perform its duties within the expected timeframe:
  * The contract automatically emits a leadership rotation event.
  * The next oracle is granted active status based on a predefined sequence or dynamic reputation.

### **Advantages**

* Trustless and verifiable oracle activity.
* Tamper-proof and permissionless failover logic.
* Lays the foundation for fully decentralized oracle clusters with on-chain accountability.

***

## Summary

| Phase | Coordination Method       | Failover Trigger                | Transparency | Implementation Complexity |
| ----- | ------------------------- | ------------------------------- | ------------ | ------------------------- |
| 1     | NTP-based + Logical Logic | Time window + session check     | Low          | Low                       |
| 2     | Smart contract-based      | On-chain timestamp & inactivity | High         | Medium–High               |

Together, these phases enable a graceful evolution from centralized coordination to decentralized resilience—ensuring Cortensor’s oracle infrastructure scales securely and reliably.
