From 6f1d754114473faf61126b962537e60885455bc1 Mon Sep 17 00:00:00 2001 From: pmantica11 <151664502+pmantica11@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:50:40 -0500 Subject: [PATCH 1/4] Fix getValidity proof (#254) --- src/api/method/get_validity_proof.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/method/get_validity_proof.rs b/src/api/method/get_validity_proof.rs index aeb4fe4..356ae6f 100644 --- a/src/api/method/get_validity_proof.rs +++ b/src/api/method/get_validity_proof.rs @@ -273,12 +273,12 @@ pub async fn get_validity_proof( && request.newAddresses.is_empty() && request.newAddressesWithTrees.is_empty() { - return Err(PhotonApiError::UnexpectedError( + return Err(PhotonApiError::ValidationError( "No hashes or new addresses provided for proof generation".to_string(), )); } if !request.newAddressesWithTrees.is_empty() && !request.newAddresses.is_empty() { - return Err(PhotonApiError::UnexpectedError( + return Err(PhotonApiError::ValidationError( "Cannot provide both newAddresses and newAddressesWithTree".to_string(), )); } From 5ac2955dee957b5bdedfedb623387f3db3c4a139 Mon Sep 17 00:00:00 2001 From: pmantica11 <151664502+pmantica11@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:58:00 -0500 Subject: [PATCH 2/4] Mark new addresses as deprecated (#255) * Fix getValidity proof * Mark newAddresses field as deprecated --- src/api/method/get_validity_proof.rs | 1 + src/openapi/specs/getCompressedAccount.yaml | 2 +- src/openapi/specs/getCompressedAccountBalance.yaml | 2 +- src/openapi/specs/getCompressedAccountProof.yaml | 2 +- src/openapi/specs/getCompressedAccountsByOwner.yaml | 2 +- src/openapi/specs/getCompressedBalanceByOwner.yaml | 2 +- src/openapi/specs/getCompressedMintTokenHolders.yaml | 2 +- src/openapi/specs/getCompressedTokenAccountBalance.yaml | 2 +- src/openapi/specs/getCompressedTokenAccountsByDelegate.yaml | 2 +- src/openapi/specs/getCompressedTokenAccountsByOwner.yaml | 2 +- src/openapi/specs/getCompressedTokenBalancesByOwner.yaml | 2 +- src/openapi/specs/getCompressedTokenBalancesByOwnerV2.yaml | 2 +- src/openapi/specs/getCompressionSignaturesForAccount.yaml | 2 +- src/openapi/specs/getCompressionSignaturesForAddress.yaml | 2 +- src/openapi/specs/getCompressionSignaturesForOwner.yaml | 2 +- src/openapi/specs/getCompressionSignaturesForTokenOwner.yaml | 2 +- src/openapi/specs/getIndexerHealth.yaml | 2 +- src/openapi/specs/getIndexerSlot.yaml | 2 +- src/openapi/specs/getLatestCompressionSignatures.yaml | 2 +- src/openapi/specs/getLatestNonVotingSignatures.yaml | 2 +- src/openapi/specs/getMultipleCompressedAccountProofs.yaml | 2 +- src/openapi/specs/getMultipleCompressedAccounts.yaml | 2 +- src/openapi/specs/getMultipleNewAddressProofs.yaml | 2 +- src/openapi/specs/getMultipleNewAddressProofsV2.yaml | 2 +- src/openapi/specs/getTransactionWithCompressionInfo.yaml | 2 +- src/openapi/specs/getValidityProof.yaml | 3 ++- 26 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/api/method/get_validity_proof.rs b/src/api/method/get_validity_proof.rs index 356ae6f..b728400 100644 --- a/src/api/method/get_validity_proof.rs +++ b/src/api/method/get_validity_proof.rs @@ -252,6 +252,7 @@ pub struct GetValidityProofRequest { #[serde(default)] pub hashes: Vec, #[serde(default)] + #[schema(deprecated = true)] pub newAddresses: Vec, #[serde(default)] pub newAddressesWithTrees: Vec, diff --git a/src/openapi/specs/getCompressedAccount.yaml b/src/openapi/specs/getCompressedAccount.yaml index 9a73050..f7b529d 100644 --- a/src/openapi/specs/getCompressedAccount.yaml +++ b/src/openapi/specs/getCompressedAccount.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedAccountBalance.yaml b/src/openapi/specs/getCompressedAccountBalance.yaml index a93ce98..c81337b 100644 --- a/src/openapi/specs/getCompressedAccountBalance.yaml +++ b/src/openapi/specs/getCompressedAccountBalance.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedAccountProof.yaml b/src/openapi/specs/getCompressedAccountProof.yaml index 73e1f67..3fe5e36 100644 --- a/src/openapi/specs/getCompressedAccountProof.yaml +++ b/src/openapi/specs/getCompressedAccountProof.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedAccountsByOwner.yaml b/src/openapi/specs/getCompressedAccountsByOwner.yaml index e18c67c..0a33557 100644 --- a/src/openapi/specs/getCompressedAccountsByOwner.yaml +++ b/src/openapi/specs/getCompressedAccountsByOwner.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedBalanceByOwner.yaml b/src/openapi/specs/getCompressedBalanceByOwner.yaml index 3219896..7c7e92e 100644 --- a/src/openapi/specs/getCompressedBalanceByOwner.yaml +++ b/src/openapi/specs/getCompressedBalanceByOwner.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedMintTokenHolders.yaml b/src/openapi/specs/getCompressedMintTokenHolders.yaml index c276a2a..dcc1ad4 100644 --- a/src/openapi/specs/getCompressedMintTokenHolders.yaml +++ b/src/openapi/specs/getCompressedMintTokenHolders.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedTokenAccountBalance.yaml b/src/openapi/specs/getCompressedTokenAccountBalance.yaml index 30ea264..252f4dc 100644 --- a/src/openapi/specs/getCompressedTokenAccountBalance.yaml +++ b/src/openapi/specs/getCompressedTokenAccountBalance.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedTokenAccountsByDelegate.yaml b/src/openapi/specs/getCompressedTokenAccountsByDelegate.yaml index 4971599..b5f8a0e 100644 --- a/src/openapi/specs/getCompressedTokenAccountsByDelegate.yaml +++ b/src/openapi/specs/getCompressedTokenAccountsByDelegate.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedTokenAccountsByOwner.yaml b/src/openapi/specs/getCompressedTokenAccountsByOwner.yaml index 004cf20..4a9b227 100644 --- a/src/openapi/specs/getCompressedTokenAccountsByOwner.yaml +++ b/src/openapi/specs/getCompressedTokenAccountsByOwner.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedTokenBalancesByOwner.yaml b/src/openapi/specs/getCompressedTokenBalancesByOwner.yaml index 7d01cad..9ca3728 100644 --- a/src/openapi/specs/getCompressedTokenBalancesByOwner.yaml +++ b/src/openapi/specs/getCompressedTokenBalancesByOwner.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedTokenBalancesByOwnerV2.yaml b/src/openapi/specs/getCompressedTokenBalancesByOwnerV2.yaml index ad4e039..71d1ddd 100644 --- a/src/openapi/specs/getCompressedTokenBalancesByOwnerV2.yaml +++ b/src/openapi/specs/getCompressedTokenBalancesByOwnerV2.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressionSignaturesForAccount.yaml b/src/openapi/specs/getCompressionSignaturesForAccount.yaml index b6d5f07..e62acec 100644 --- a/src/openapi/specs/getCompressionSignaturesForAccount.yaml +++ b/src/openapi/specs/getCompressionSignaturesForAccount.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressionSignaturesForAddress.yaml b/src/openapi/specs/getCompressionSignaturesForAddress.yaml index eeb0256..2b9bccf 100644 --- a/src/openapi/specs/getCompressionSignaturesForAddress.yaml +++ b/src/openapi/specs/getCompressionSignaturesForAddress.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressionSignaturesForOwner.yaml b/src/openapi/specs/getCompressionSignaturesForOwner.yaml index 21ff2fb..d19fe11 100644 --- a/src/openapi/specs/getCompressionSignaturesForOwner.yaml +++ b/src/openapi/specs/getCompressionSignaturesForOwner.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressionSignaturesForTokenOwner.yaml b/src/openapi/specs/getCompressionSignaturesForTokenOwner.yaml index a37cc65..ea72fa9 100644 --- a/src/openapi/specs/getCompressionSignaturesForTokenOwner.yaml +++ b/src/openapi/specs/getCompressionSignaturesForTokenOwner.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getIndexerHealth.yaml b/src/openapi/specs/getIndexerHealth.yaml index 6b86bac..d40866c 100644 --- a/src/openapi/specs/getIndexerHealth.yaml +++ b/src/openapi/specs/getIndexerHealth.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getIndexerSlot.yaml b/src/openapi/specs/getIndexerSlot.yaml index ff0ac38..29edaa6 100644 --- a/src/openapi/specs/getIndexerSlot.yaml +++ b/src/openapi/specs/getIndexerSlot.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getLatestCompressionSignatures.yaml b/src/openapi/specs/getLatestCompressionSignatures.yaml index ebbc8cc..902f34b 100644 --- a/src/openapi/specs/getLatestCompressionSignatures.yaml +++ b/src/openapi/specs/getLatestCompressionSignatures.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getLatestNonVotingSignatures.yaml b/src/openapi/specs/getLatestNonVotingSignatures.yaml index 1ebea51..004c673 100644 --- a/src/openapi/specs/getLatestNonVotingSignatures.yaml +++ b/src/openapi/specs/getLatestNonVotingSignatures.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getMultipleCompressedAccountProofs.yaml b/src/openapi/specs/getMultipleCompressedAccountProofs.yaml index 0eb3586..c520f8f 100644 --- a/src/openapi/specs/getMultipleCompressedAccountProofs.yaml +++ b/src/openapi/specs/getMultipleCompressedAccountProofs.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getMultipleCompressedAccounts.yaml b/src/openapi/specs/getMultipleCompressedAccounts.yaml index 347ac0e..cbe7ce1 100644 --- a/src/openapi/specs/getMultipleCompressedAccounts.yaml +++ b/src/openapi/specs/getMultipleCompressedAccounts.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getMultipleNewAddressProofs.yaml b/src/openapi/specs/getMultipleNewAddressProofs.yaml index 5b227b8..95efb88 100644 --- a/src/openapi/specs/getMultipleNewAddressProofs.yaml +++ b/src/openapi/specs/getMultipleNewAddressProofs.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getMultipleNewAddressProofsV2.yaml b/src/openapi/specs/getMultipleNewAddressProofsV2.yaml index d215ae5..399efde 100644 --- a/src/openapi/specs/getMultipleNewAddressProofsV2.yaml +++ b/src/openapi/specs/getMultipleNewAddressProofsV2.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getTransactionWithCompressionInfo.yaml b/src/openapi/specs/getTransactionWithCompressionInfo.yaml index b09423f..59ca0c9 100644 --- a/src/openapi/specs/getTransactionWithCompressionInfo.yaml +++ b/src/openapi/specs/getTransactionWithCompressionInfo.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getValidityProof.yaml b/src/openapi/specs/getValidityProof.yaml index 5145d20..94c8b8f 100644 --- a/src/openapi/specs/getValidityProof.yaml +++ b/src/openapi/specs/getValidityProof.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: @@ -48,6 +48,7 @@ paths: type: array items: $ref: '#/components/schemas/SerializablePubkey' + deprecated: true newAddressesWithTrees: type: array items: From 211513fd8b2fae574011f1e2bf3aec8d44386ee8 Mon Sep 17 00:00:00 2001 From: pmantica11 <151664502+pmantica11@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:00:11 -0500 Subject: [PATCH 3/4] Remove newAddresses from documentation (#256) --- src/api/api.rs | 3 ++- src/api/method/get_validity_proof.rs | 11 +++++++++++ src/openapi/specs/getValidityProof.yaml | 5 ----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/api/api.rs b/src/api/api.rs index 9932321..3ad4ff8 100644 --- a/src/api/api.rs +++ b/src/api/api.rs @@ -5,6 +5,7 @@ use solana_client::nonblocking::rpc_client::RpcClient; use utoipa::openapi::{ObjectBuilder, RefOr, Schema, SchemaType}; use utoipa::ToSchema; +use crate::api::method::get_validity_proof::GetValidityProofRequestDocumentation; use crate::api::method::utils::GetNonPaginatedSignaturesResponse; use crate::common::typedefs::unsigned_integer::UnsignedInteger; @@ -375,7 +376,7 @@ impl PhotonApi { }, OpenApiSpec { name: "getValidityProof".to_string(), - request: Some(GetValidityProofRequest::schema().1), + request: Some(GetValidityProofRequestDocumentation::schema().1), response: GetValidityProofResponse::schema().1, }, OpenApiSpec { diff --git a/src/api/method/get_validity_proof.rs b/src/api/method/get_validity_proof.rs index b728400..b5b322f 100644 --- a/src/api/method/get_validity_proof.rs +++ b/src/api/method/get_validity_proof.rs @@ -258,6 +258,17 @@ pub struct GetValidityProofRequest { pub newAddressesWithTrees: Vec, } +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, ToSchema)] +#[serde(deny_unknown_fields, rename_all = "camelCase")] +#[allow(non_snake_case)] +// Create to hide the deprecated newAddresses field from the documentation +pub struct GetValidityProofRequestDocumentation { + #[serde(default)] + pub hashes: Vec, + #[serde(default)] + pub newAddressesWithTrees: Vec, +} + #[derive(Serialize, Deserialize, ToSchema)] #[serde(deny_unknown_fields, rename_all = "camelCase")] pub struct GetValidityProofResponse { diff --git a/src/openapi/specs/getValidityProof.yaml b/src/openapi/specs/getValidityProof.yaml index 94c8b8f..d2abd4e 100644 --- a/src/openapi/specs/getValidityProof.yaml +++ b/src/openapi/specs/getValidityProof.yaml @@ -44,11 +44,6 @@ paths: type: array items: $ref: '#/components/schemas/Hash' - newAddresses: - type: array - items: - $ref: '#/components/schemas/SerializablePubkey' - deprecated: true newAddressesWithTrees: type: array items: From df690fde3101803c528c64d073e127ee1c0a3023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Swen=20Sch=C3=A4ferjohann?= <42959314+SwenSchaeferjohann@users.noreply.github.com> Date: Mon, 23 Dec 2024 00:08:27 +0000 Subject: [PATCH 4/4] Update README.md (#253) link for [zk compression](zkcompression.com) currently resolves to https://github.com/helius-labs/photon/blob/main/zkcompression.com because GitHub interprets it as a relative path within the repo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 76823af..6ff4c9c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Photon: the Indexer for ZK Compression on Solana -Photon is the core indexer for [ZK Compression](zkcompression.com) on the Solana blockchain. It offers rapid indexing capabilities, snapshot support, and flexible database options to cater to local and production deployments. +Photon is the core indexer for [ZK Compression](https://www.zkcompression.com) on the Solana blockchain. It offers rapid indexing capabilities, snapshot support, and flexible database options to cater to local and production deployments. ## 🚀 Quick Start