refs akash-network/node#2060
Oracle v2 represents a fundamental architectural redesign from v1. The core shift replaces block-height-based time referencing with wall-clock timestamps and durations, making staleness detection, TWAP computation, and price querying independent of block production cadence. Key v2 additions include: epoch-based pruning for bounded state growth, explicit source identity management via auto-incrementing numeric IDs, a transient store for per-block sequence disambiguation, lexicographically-sortable timestamp key encoding for efficient range queries, future-time-drift protection, and a flattened message/event schema separating price values from timestamps. The query API was upgraded from single-height lookups to time-range filters. The v1-to-v2 migration employed a complete state wipe followed by re-initialization with a freshly deployed Pyth contract, as the fundamental incompatibility between block-height-keyed and timestamp-keyed storage schemas precluded data conversion. The module now uses the modern cosmossdk.io/collections library for typed, indexed state management, replacing raw KV store operations.
refs akash-network/node#2060
Oracle v2 represents a fundamental architectural redesign from v1. The core shift replaces block-height-based time referencing with wall-clock timestamps and durations, making staleness detection, TWAP computation, and price querying independent of block production cadence. Key v2 additions include: epoch-based pruning for bounded state growth, explicit source identity management via auto-incrementing numeric IDs, a transient store for per-block sequence disambiguation, lexicographically-sortable timestamp key encoding for efficient range queries, future-time-drift protection, and a flattened message/event schema separating price values from timestamps. The query API was upgraded from single-height lookups to time-range filters. The v1-to-v2 migration employed a complete state wipe followed by re-initialization with a freshly deployed Pyth contract, as the fundamental incompatibility between block-height-keyed and timestamp-keyed storage schemas precluded data conversion. The module now uses the modern cosmossdk.io/collections library for typed, indexed state management, replacing raw KV store operations.