[PASSED] OP-PIP-18: Pyth oracle upgrade - Pythnet

Abstract

This proposal upgrades the Pyth oracle program on Pythnet to facilitate the transition of aggregation from the oracle program to the validator.

Rationale

Pythnet processes more than 3000 price updates per second and is expected to grow further. To ensure the network can handle this load, the computation-heavy part of the computation is being moved to the validator. Aggregation in the validator is much faster than the program because it is being executed as a native program. This change is expected to improve the latency by 400ms because the aggregation will be performed at the end of block (instead of the next block).

Description

This proposal upgrades the Pyth oracle program with the following changes:

  • Support aggregation in the validator - PR 410

Implementation Plan

Proposal id: EYUsQQkRXEgeHtEzW22PTUNkkurSr9xePpbiJ7DLNved

Verify the implementation following the guide below:

  1. Make sure you have git, Docker and sha256sum.
  2. git: install git from here
  3. Docker: install it from here
  4. sha256sum: if on Mac you can install it as a part of coreutils with brew install coreutils
  5. Clone the pyth-client repo (git clone)
  6. Go to the pyth-client directory and checkout to oracle v2.32.1 release by running git checkout oracle-v2.32.1 command.
  7. run the following command: docker build -f docker/Dockerfile --platform=linux/x86_64 --progress=plain .
  8. Upon a successful build, you should see the following messages containing the hash digest of the program:
sha256sum ./target/deploy/pyth_oracle.so
<hash-digest> ./target/deploy/pyth_oracle.so
  1. Check that the hash digest matches the hash digest of the buffer deployed on Pythnet. Get the buffer account from the proposal and fetch the digest of the program in the buffer account by running the following command:
solana -u https://api2.pythnet.pyth.network program dump <BUFFER> temp_file
sha256sum temp_file
rm temp_file
  1. Make sure the hash from step 8 and from step 9 match
  2. Make sure the buffer authority is the oracle authority. You can verify the authority by going to the solana explorer with https://api2.pythnet.pyth.network as a custom RPC and check the upgrade authority of the oracle program (FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH ) and the buffer.
2 Likes