[ONGOING] OP-PIP-64: Upgrade Pyth oracle on TON Testnet v2

Abstract

This PR enhances the Pyth oracle contract on TON by implementing cell chain traversal for price feed ID parsing. The change allows handling more than 3 price feed IDs in a single update by properly managing TON’s cell bit limitations.

Rationale

TON cells have a fundamental limitation of 1023 bits per cell. Given that each price feed ID is 256 bits:

  • A single cell can only store 3 complete price feed IDs (768 bits)
  • Previous implementation would fail when attempting to parse more than 3 IDs
  • Applications need to handle more than 3 price feeds in a single update

Description

This proposal upgrades the Pyth oracle program on TON with the following major change:

  • feat(target_chains/ton): add helper function to parse price IDs beyond a single cell and enhance update handling - PR 2558

Implementation Plan

Proposal id: Buc7e1fxqGHEfydYMu5cnJFYiVcWtqAzSqA6NDhMQp2V
Verify the implementation by comparing the hash 553364b57e4a72918cce30a58cd219f30fb11947af185e22290c3252901a986c:

  • checkout the pyth-crosschain repo
  • pnpm install --frozen-lockfile
  • pnpm turbo build --filter "@pythnetwork/pyth-ton"
  • check that the hash in the output matches with the package hash in the proposal
1 Like