From bb1aaa793b48bcc70ac15f200858f53c760f1c22 Mon Sep 17 00:00:00 2001 From: Aditya Arora Date: Mon, 2 Dec 2024 14:34:28 -0500 Subject: [PATCH 1/6] chore(pricefeed)-add-solana-anchor --- pages/price-feeds/troubleshoot.mdx | 1 + pages/price-feeds/troubleshoot/_meta.json | 3 ++- pages/price-feeds/troubleshoot/svm.mdx | 18 ++++++++++++++++++ .../price-feeds/use-real-time-data/solana.mdx | 7 ++++++- 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 pages/price-feeds/troubleshoot/svm.mdx diff --git a/pages/price-feeds/troubleshoot.mdx b/pages/price-feeds/troubleshoot.mdx index 90a77e7c..635b0319 100644 --- a/pages/price-feeds/troubleshoot.mdx +++ b/pages/price-feeds/troubleshoot.mdx @@ -4,3 +4,4 @@ The following guide helps users integrating pyth price feeds to solve common iss Please select the component where you are facing the issue to get the troubleshooting steps. - [EVM Price Feeds Contract](troubleshoot/evm) +- [SVM Price Feeds Contract](troubleshoot/svm) diff --git a/pages/price-feeds/troubleshoot/_meta.json b/pages/price-feeds/troubleshoot/_meta.json index e549315a..c7e8d833 100644 --- a/pages/price-feeds/troubleshoot/_meta.json +++ b/pages/price-feeds/troubleshoot/_meta.json @@ -1,3 +1,4 @@ { - "evm": "EVM Price Feeds Contract" + "evm": "EVM Price Feeds Contract", + "svm": "SVM Price Feeds Contract" } diff --git a/pages/price-feeds/troubleshoot/svm.mdx b/pages/price-feeds/troubleshoot/svm.mdx new file mode 100644 index 00000000..5202dc1c --- /dev/null +++ b/pages/price-feeds/troubleshoot/svm.mdx @@ -0,0 +1,18 @@ +# Troubleshoot Solana Price Feeds Contract + +This reference page is designed to help you troubleshoot common issues you may encounter when using Pyth Price Feeds on SVM chains. +Follow the steps provided below to diagnose and resolve the issue. + +### compilation error[E0277]: the trait bound PriceUpdateV2: anchor_lang::AccountDeserialize is not satisfied + +This error is caused by an `anchor-lang` version mismatch. +Make sure the transitive version of `anchor-lang` brough by [pyth-solana-receiver-sdk](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) +matchers the version of `anchor-lang` of your programs `Cargo.toml`. + +You can fix it by following steps: + +- Check the version of `anchor-lang` in your `Cargo.toml` (in the example `0.29.0{:js}`) call it `x.y.z` +- Check the version of `anchor-lang` in the `pyth-solana-receiver-sdk` tree in `Cargo.lock` (in the example `0.30.1{:js}`) call it `a.b.c` +- Run `cargo update -p anchor-lang@a.b.c --precise x.y.z{:bash}` +replacing `a.b.c` and `x.y.z` by the versions in the previous steps. For example:\ +`cargo update -p anchor-lang@0.30.1 --precise 0.29.0{:bash}` diff --git a/pages/price-feeds/use-real-time-data/solana.mdx b/pages/price-feeds/use-real-time-data/solana.mdx index 53a2ebed..72d043d0 100644 --- a/pages/price-feeds/use-real-time-data/solana.mdx +++ b/pages/price-feeds/use-real-time-data/solana.mdx @@ -14,7 +14,7 @@ Pyth provides two SDKs for Solana applications to cover the on- and off-chain po ### Rust SDK -The [pyth-solana-receiver-sdk crate](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) can be used to consume Pyth prices inside Solana programs written in Rust. +The [pyth-solana-receiver-sdk](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) crate can be used to consume Pyth prices inside Solana programs written in Rust. Add this crate to the dependencies section of your `Cargo.toml` file: ```toml copy @@ -22,6 +22,11 @@ Add this crate to the dependencies section of your `Cargo.toml` file: pyth-solana-receiver-sdk ="x.y.z" # get the latest version from https://crates.io/crates/pyth-solana-receiver-sdk ``` + +At the time of writing, [pyth-solana-receiver-sdk](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) is compatible with Anchor `v0.28.0{:js}`, `0.29.0{:js}`, and `0.30.1{:js}`. +If you are on `0.30.0{:js}` or any other version, please move to `0.30.1{:js}`. + + ### Typescript SDK Pyth provides two Typescript packages, [@pythnetwork/price-service-client](https://github.com/pyth-network/pyth-crosschain/tree/main/price_service/client/js) and [@pythnetwork/pyth-solana-receiver](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/sdk/js/pyth_solana_receiver), for fetching Pyth prices and submitting them to the blockchain respectively. From b7a672622642753ec3d12f232b947964e523e378 Mon Sep 17 00:00:00 2001 From: Aditya Arora Date: Mon, 2 Dec 2024 14:35:42 -0500 Subject: [PATCH 2/6] pre-commit --- pages/price-feeds/troubleshoot/svm.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/price-feeds/troubleshoot/svm.mdx b/pages/price-feeds/troubleshoot/svm.mdx index 5202dc1c..a8d2642c 100644 --- a/pages/price-feeds/troubleshoot/svm.mdx +++ b/pages/price-feeds/troubleshoot/svm.mdx @@ -5,8 +5,8 @@ Follow the steps provided below to diagnose and resolve the issue. ### compilation error[E0277]: the trait bound PriceUpdateV2: anchor_lang::AccountDeserialize is not satisfied -This error is caused by an `anchor-lang` version mismatch. -Make sure the transitive version of `anchor-lang` brough by [pyth-solana-receiver-sdk](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) +This error is caused by an `anchor-lang` version mismatch. +Make sure the transitive version of `anchor-lang` brough by [pyth-solana-receiver-sdk](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) matchers the version of `anchor-lang` of your programs `Cargo.toml`. You can fix it by following steps: @@ -14,5 +14,5 @@ You can fix it by following steps: - Check the version of `anchor-lang` in your `Cargo.toml` (in the example `0.29.0{:js}`) call it `x.y.z` - Check the version of `anchor-lang` in the `pyth-solana-receiver-sdk` tree in `Cargo.lock` (in the example `0.30.1{:js}`) call it `a.b.c` - Run `cargo update -p anchor-lang@a.b.c --precise x.y.z{:bash}` -replacing `a.b.c` and `x.y.z` by the versions in the previous steps. For example:\ -`cargo update -p anchor-lang@0.30.1 --precise 0.29.0{:bash}` + replacing `a.b.c` and `x.y.z` by the versions in the previous steps. For example:\ + `cargo update -p anchor-lang@0.30.1 --precise 0.29.0{:bash}` From 38cd74b918a62ac8c49c303dd12e50c16ff39f11 Mon Sep 17 00:00:00 2001 From: Aditya Arora Date: Tue, 3 Dec 2024 11:20:18 -0500 Subject: [PATCH 3/6] requested changes --- pages/price-feeds/troubleshoot/svm.mdx | 20 +++++++++---------- .../price-feeds/use-real-time-data/solana.mdx | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pages/price-feeds/troubleshoot/svm.mdx b/pages/price-feeds/troubleshoot/svm.mdx index a8d2642c..a45bab61 100644 --- a/pages/price-feeds/troubleshoot/svm.mdx +++ b/pages/price-feeds/troubleshoot/svm.mdx @@ -3,16 +3,16 @@ This reference page is designed to help you troubleshoot common issues you may encounter when using Pyth Price Feeds on SVM chains. Follow the steps provided below to diagnose and resolve the issue. -### compilation error[E0277]: the trait bound PriceUpdateV2: anchor_lang::AccountDeserialize is not satisfied +1. `compilation error[E0277]: the trait bound PriceUpdateV2: anchor_lang::AccountDeserialize is not satisfied{:rust}` -This error is caused by an `anchor-lang` version mismatch. -Make sure the transitive version of `anchor-lang` brough by [pyth-solana-receiver-sdk](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) -matchers the version of `anchor-lang` of your programs `Cargo.toml`. + This error happens when a program using the [`pyth-solana-receiver-sdk`](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) fails to compile. It is caused by an `anchor-lang` version mismatch. + Make sure the transitive version of `anchor-lang` brought by `pyth-solana-receiver-sdk` + matches the version of `anchor-lang` of your program's `Cargo.toml`. -You can fix it by following steps: + You can fix it by following steps: -- Check the version of `anchor-lang` in your `Cargo.toml` (in the example `0.29.0{:js}`) call it `x.y.z` -- Check the version of `anchor-lang` in the `pyth-solana-receiver-sdk` tree in `Cargo.lock` (in the example `0.30.1{:js}`) call it `a.b.c` -- Run `cargo update -p anchor-lang@a.b.c --precise x.y.z{:bash}` - replacing `a.b.c` and `x.y.z` by the versions in the previous steps. For example:\ - `cargo update -p anchor-lang@0.30.1 --precise 0.29.0{:bash}` + - Check the version of [`anchor-lang`](https://github.com/guibescos/anchor-pyth/blob/broken-build/programs/anchor-pyth/Cargo.toml) in your `Cargo.toml` (in the example `0.29.0{:js}`) call it `x.y.z` + - Check the version of `anchor-lang` in the `pyth-solana-receiver-sdk` tree in `Cargo.lock` (in the example `0.30.1{:js}`) call it `a.b.c` + - Run `cargo update -p anchor-lang@a.b.c --precise x.y.z{:bash}` + replacing `a.b.c` and `x.y.z` by the versions in the previous steps. For example:\ + `cargo update -p anchor-lang@0.30.1 --precise 0.29.0{:bash}` diff --git a/pages/price-feeds/use-real-time-data/solana.mdx b/pages/price-feeds/use-real-time-data/solana.mdx index 72d043d0..c6e9cdc0 100644 --- a/pages/price-feeds/use-real-time-data/solana.mdx +++ b/pages/price-feeds/use-real-time-data/solana.mdx @@ -23,8 +23,8 @@ pyth-solana-receiver-sdk ="x.y.z" # get the latest version from https://crates.i ``` -At the time of writing, [pyth-solana-receiver-sdk](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) is compatible with Anchor `v0.28.0{:js}`, `0.29.0{:js}`, and `0.30.1{:js}`. -If you are on `0.30.0{:js}` or any other version, please move to `0.30.1{:js}`. +At the time of writing, [pyth-solana-receiver-sdk](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) is compatible with Anchor `v0.28.0{:js}`, `v0.29.0{:js}`, and `v0.30.1{:js}`. +If you are on `v0.30.0{:js}` or any other version, please move to `v0.30.1{:js}`. ### Typescript SDK From 1018addaf6886602f3af022641ccbf3aedc94207 Mon Sep 17 00:00:00 2001 From: Aditya Arora Date: Tue, 3 Dec 2024 11:30:12 -0500 Subject: [PATCH 4/6] pre-commit --- pages/price-feeds/troubleshoot/svm.mdx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pages/price-feeds/troubleshoot/svm.mdx b/pages/price-feeds/troubleshoot/svm.mdx index a45bab61..977bed10 100644 --- a/pages/price-feeds/troubleshoot/svm.mdx +++ b/pages/price-feeds/troubleshoot/svm.mdx @@ -5,14 +5,14 @@ Follow the steps provided below to diagnose and resolve the issue. 1. `compilation error[E0277]: the trait bound PriceUpdateV2: anchor_lang::AccountDeserialize is not satisfied{:rust}` - This error happens when a program using the [`pyth-solana-receiver-sdk`](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) fails to compile. It is caused by an `anchor-lang` version mismatch. - Make sure the transitive version of `anchor-lang` brought by `pyth-solana-receiver-sdk` - matches the version of `anchor-lang` of your program's `Cargo.toml`. + This error happens when a program using the [`pyth-solana-receiver-sdk`](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) fails to compile. It is caused by an `anchor-lang` version mismatch. + Make sure the transitive version of `anchor-lang` brought by `pyth-solana-receiver-sdk` + matches the version of `anchor-lang` of your program's `Cargo.toml`. - You can fix it by following steps: + You can fix it by following steps: - - Check the version of [`anchor-lang`](https://github.com/guibescos/anchor-pyth/blob/broken-build/programs/anchor-pyth/Cargo.toml) in your `Cargo.toml` (in the example `0.29.0{:js}`) call it `x.y.z` - - Check the version of `anchor-lang` in the `pyth-solana-receiver-sdk` tree in `Cargo.lock` (in the example `0.30.1{:js}`) call it `a.b.c` - - Run `cargo update -p anchor-lang@a.b.c --precise x.y.z{:bash}` - replacing `a.b.c` and `x.y.z` by the versions in the previous steps. For example:\ - `cargo update -p anchor-lang@0.30.1 --precise 0.29.0{:bash}` + - Check the version of [`anchor-lang`](https://github.com/guibescos/anchor-pyth/blob/broken-build/programs/anchor-pyth/Cargo.toml) in your `Cargo.toml` (in the example `0.29.0{:js}`) call it `x.y.z` + - Check the version of `anchor-lang` in the `pyth-solana-receiver-sdk` tree in `Cargo.lock` (in the example `0.30.1{:js}`) call it `a.b.c` + - Run `cargo update -p anchor-lang@a.b.c --precise x.y.z{:bash}` + replacing `a.b.c` and `x.y.z` by the versions in the previous steps. For example:\ + `cargo update -p anchor-lang@0.30.1 --precise 0.29.0{:bash}` From ff9a50fce802effeba22065d49612e2def34aea0 Mon Sep 17 00:00:00 2001 From: Guillermo Bescos Date: Mon, 9 Dec 2024 16:24:00 +0000 Subject: [PATCH 5/6] fix more stuff --- pages/price-feeds/troubleshoot/svm.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/price-feeds/troubleshoot/svm.mdx b/pages/price-feeds/troubleshoot/svm.mdx index 977bed10..2e2915c2 100644 --- a/pages/price-feeds/troubleshoot/svm.mdx +++ b/pages/price-feeds/troubleshoot/svm.mdx @@ -3,16 +3,16 @@ This reference page is designed to help you troubleshoot common issues you may encounter when using Pyth Price Feeds on SVM chains. Follow the steps provided below to diagnose and resolve the issue. -1. `compilation error[E0277]: the trait bound PriceUpdateV2: anchor_lang::AccountDeserialize is not satisfied{:rust}` +1. `error[E0277]: the trait bound PriceUpdateV2: anchor_lang::AccountDeserialize is not satisfied{:rust}` This error happens when a program using the [`pyth-solana-receiver-sdk`](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) fails to compile. It is caused by an `anchor-lang` version mismatch. Make sure the transitive version of `anchor-lang` brought by `pyth-solana-receiver-sdk` matches the version of `anchor-lang` of your program's `Cargo.toml`. - You can fix it by following steps: + You can fix it by following these steps: - - Check the version of [`anchor-lang`](https://github.com/guibescos/anchor-pyth/blob/broken-build/programs/anchor-pyth/Cargo.toml) in your `Cargo.toml` (in the example `0.29.0{:js}`) call it `x.y.z` - - Check the version of `anchor-lang` in the `pyth-solana-receiver-sdk` tree in `Cargo.lock` (in the example `0.30.1{:js}`) call it `a.b.c` + - Check the version of `anchor-lang` in your [`Cargo.toml`](https://github.com/guibescos/anchor-pyth/blob/broken-build/programs/anchor-pyth/Cargo.toml) (in the example `0.29.0{:js}`) call it `x.y.z` + - Check the version of `anchor-lang` in the `pyth-solana-receiver-sdk` tree in [`Cargo.lock`](https://github.com/guibescos/anchor-pyth/blob/broken-build/programs/anchor-pyth/Cargo.lock) (in the example `0.30.1{:js}`) call it `a.b.c` - Run `cargo update -p anchor-lang@a.b.c --precise x.y.z{:bash}` replacing `a.b.c` and `x.y.z` by the versions in the previous steps. For example:\ `cargo update -p anchor-lang@0.30.1 --precise 0.29.0{:bash}` From 8d4e4c3720807e72f3f91a301ddd40795d5dc63d Mon Sep 17 00:00:00 2001 From: Guillermo Bescos Date: Mon, 9 Dec 2024 16:31:49 +0000 Subject: [PATCH 6/6] update link --- pages/price-feeds/troubleshoot/svm.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/price-feeds/troubleshoot/svm.mdx b/pages/price-feeds/troubleshoot/svm.mdx index 2e2915c2..05ead346 100644 --- a/pages/price-feeds/troubleshoot/svm.mdx +++ b/pages/price-feeds/troubleshoot/svm.mdx @@ -12,7 +12,7 @@ Follow the steps provided below to diagnose and resolve the issue. You can fix it by following these steps: - Check the version of `anchor-lang` in your [`Cargo.toml`](https://github.com/guibescos/anchor-pyth/blob/broken-build/programs/anchor-pyth/Cargo.toml) (in the example `0.29.0{:js}`) call it `x.y.z` - - Check the version of `anchor-lang` in the `pyth-solana-receiver-sdk` tree in [`Cargo.lock`](https://github.com/guibescos/anchor-pyth/blob/broken-build/programs/anchor-pyth/Cargo.lock) (in the example `0.30.1{:js}`) call it `a.b.c` + - Check the version of `anchor-lang` in the `pyth-solana-receiver-sdk` tree in [`Cargo.lock`](https://github.com/guibescos/anchor-pyth/blob/broken-build/Cargo.lock#L1400) (in the example `0.30.1{:js}`) call it `a.b.c` - Run `cargo update -p anchor-lang@a.b.c --precise x.y.z{:bash}` replacing `a.b.c` and `x.y.z` by the versions in the previous steps. For example:\ `cargo update -p anchor-lang@0.30.1 --precise 0.29.0{:bash}`