From c9368dd63b728786cc7b621f870cac9f749185ef Mon Sep 17 00:00:00 2001 From: Swen Date: Mon, 24 Jun 2024 01:34:22 +0100 Subject: [PATCH 01/10] release photon-api --- scripts/release-all-rust-crates.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/release-all-rust-crates.sh b/scripts/release-all-rust-crates.sh index 4ee5dba242..8a1605e1a3 100755 --- a/scripts/release-all-rust-crates.sh +++ b/scripts/release-all-rust-crates.sh @@ -13,7 +13,8 @@ echo "Logging in to crates.io..." cargo login "${CRATES_IO_TOKEN}" # TODO: allow dynamic releases, and add gh release workflow # PACKAGES=("aligned-sized" "light-heap" "light-bounded-vec" "light-utils" "light-hasher" "light-macros" "light-hash-set" "light-merkle-tree-reference" "light-concurrent-merkle-tree" "light-indexed-merkle-tree" "light-prover-client" "light-verifier" "account-compression" "light-registry" "light-system-program" "light-compressed-token" "light-test-utils") -PACKAGES=("light-compressed-token" "light-test-utils") +# PACKAGES=("light-compressed-token" "light-test-utils") +PACKAGES=("photon-api" "light-test-utils") for PACKAGE in "${PACKAGES[@]}"; do PKG_VERSION=$(cargo pkgid -p "$PACKAGE" | cut -d "#" -f2) VERSION=${PKG_VERSION#*@} From e005026eb4b198248069caadf6c27f0b2ce46fe6 Mon Sep 17 00:00:00 2001 From: Swen Date: Mon, 24 Jun 2024 01:36:53 +0100 Subject: [PATCH 02/10] cargo --- photon-api/Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/photon-api/Cargo.toml b/photon-api/Cargo.toml index 358bdfa502..1c0384b994 100644 --- a/photon-api/Cargo.toml +++ b/photon-api/Cargo.toml @@ -5,6 +5,10 @@ authors = ["OpenAPI Generator team and contributors"] description = "Solana indexer for general compression" license = "Apache-2.0" edition = "2018" +documentation = "https://docs.rs/photon-api" +homepage = "https://github.com/lightprotocol/lightprotocol" +repository = "https://github.com/lightprotocol/lightprotocol" + [dependencies] serde = "^1.0" From 4f42c54e005d04ed6708f82d4b1ba3917013699f Mon Sep 17 00:00:00 2001 From: Swen Date: Mon, 24 Jun 2024 01:37:52 +0100 Subject: [PATCH 03/10] wip --- photon-api/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/photon-api/Cargo.toml b/photon-api/Cargo.toml index 1c0384b994..11016390b5 100644 --- a/photon-api/Cargo.toml +++ b/photon-api/Cargo.toml @@ -2,7 +2,7 @@ name = "photon-api" version = "0.27.0" authors = ["OpenAPI Generator team and contributors"] -description = "Solana indexer for general compression" +description = "Auto-generated API for Helius Labs' Photon Compression Indexer" license = "Apache-2.0" edition = "2018" documentation = "https://docs.rs/photon-api" From 930b0a7054de028a48f0a814a47bc85e7eee629c Mon Sep 17 00:00:00 2001 From: Swen Date: Mon, 24 Jun 2024 01:42:10 +0100 Subject: [PATCH 04/10] wip --- scripts/release-all-rust-crates.sh | 2 +- test-utils/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/release-all-rust-crates.sh b/scripts/release-all-rust-crates.sh index 8a1605e1a3..9679736bf5 100755 --- a/scripts/release-all-rust-crates.sh +++ b/scripts/release-all-rust-crates.sh @@ -14,7 +14,7 @@ cargo login "${CRATES_IO_TOKEN}" # TODO: allow dynamic releases, and add gh release workflow # PACKAGES=("aligned-sized" "light-heap" "light-bounded-vec" "light-utils" "light-hasher" "light-macros" "light-hash-set" "light-merkle-tree-reference" "light-concurrent-merkle-tree" "light-indexed-merkle-tree" "light-prover-client" "light-verifier" "account-compression" "light-registry" "light-system-program" "light-compressed-token" "light-test-utils") # PACKAGES=("light-compressed-token" "light-test-utils") -PACKAGES=("photon-api" "light-test-utils") +PACKAGES=("light-test-utils") for PACKAGE in "${PACKAGES[@]}"; do PKG_VERSION=$(cargo pkgid -p "$PACKAGE" | cut -d "#" -f2) VERSION=${PKG_VERSION#*@} diff --git a/test-utils/Cargo.toml b/test-utils/Cargo.toml index 63cd1d13de..802789e381 100644 --- a/test-utils/Cargo.toml +++ b/test-utils/Cargo.toml @@ -39,7 +39,7 @@ light-verifier = { path = "../circuit-lib/verifier", version = "0.2.0" } light-utils = { path = "../utils", version = "0.2.0" } memoffset = "0.9.1" rand = "0.8" -photon-api = { path = "../photon-api" } +photon-api = { path = "../photon-api", version = "0.27.0" } log = "0.4" [dev-dependencies] From aab49f727937ee9ffe1a6ce9ddc704346cc87d18 Mon Sep 17 00:00:00 2001 From: Swen Date: Mon, 24 Jun 2024 01:43:30 +0100 Subject: [PATCH 05/10] wip --- test-utils/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-utils/Cargo.toml b/test-utils/Cargo.toml index 802789e381..89ccf491ad 100644 --- a/test-utils/Cargo.toml +++ b/test-utils/Cargo.toml @@ -27,7 +27,7 @@ light-compressed-token = { path = "../programs/compressed-token", version = "0.4 light-system-program = { path = "../programs/system", version = "0.4.0", features = ["cpi"] } light-registry = { path = "../programs/registry", version = "0.4.0", features = ["cpi"] } spl-token = { version="3.5.0", features = ["no-entrypoint"] } -solana-transaction-status = { git = "https://github.com/Lightprotocol/agave", branch = "v1.18.11-enforce-cpi-tracking" } +solana-transaction-status = "1.18.11" tokio = "1.36" light-prover-client = { path = "../circuit-lib/light-prover-client", version = "0.2.0" } reqwest = "0.11.26" From b889f8253b12fa19dd17103763e8a22beec6dcbe Mon Sep 17 00:00:00 2001 From: Swen Date: Mon, 24 Jun 2024 02:01:53 +0100 Subject: [PATCH 06/10] test-utils not published --- scripts/release-all-rust-crates.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/release-all-rust-crates.sh b/scripts/release-all-rust-crates.sh index 9679736bf5..549a4927c2 100755 --- a/scripts/release-all-rust-crates.sh +++ b/scripts/release-all-rust-crates.sh @@ -12,8 +12,7 @@ echo "Tagging and releasing all Rust projects..." echo "Logging in to crates.io..." cargo login "${CRATES_IO_TOKEN}" # TODO: allow dynamic releases, and add gh release workflow -# PACKAGES=("aligned-sized" "light-heap" "light-bounded-vec" "light-utils" "light-hasher" "light-macros" "light-hash-set" "light-merkle-tree-reference" "light-concurrent-merkle-tree" "light-indexed-merkle-tree" "light-prover-client" "light-verifier" "account-compression" "light-registry" "light-system-program" "light-compressed-token" "light-test-utils") -# PACKAGES=("light-compressed-token" "light-test-utils") +PACKAGES=("aligned-sized" "light-heap" "light-bounded-vec" "light-utils" "light-hasher" "light-macros" "light-hash-set" "light-merkle-tree-reference" "light-concurrent-merkle-tree" "light-indexed-merkle-tree" "light-prover-client" "light-verifier" "account-compression" "light-registry" "light-system-program" "light-compressed-token" "light-test-utils") PACKAGES=("light-test-utils") for PACKAGE in "${PACKAGES[@]}"; do PKG_VERSION=$(cargo pkgid -p "$PACKAGE" | cut -d "#" -f2) From 6304687809381508dda87cb7865dec47caa53f3b Mon Sep 17 00:00:00 2001 From: Swen Date: Mon, 24 Jun 2024 02:33:37 +0100 Subject: [PATCH 07/10] lfg --- hasher.rs/package.json | 2 +- js/stateless.js/package.json | 4 ++-- js/stateless.js/rollup.config.js | 5 +++++ .../src/test-helpers/merkle-tree/indexed-array.ts | 5 ----- pnpm-lock.yaml | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hasher.rs/package.json b/hasher.rs/package.json index 78c4979113..cb9e56a675 100644 --- a/hasher.rs/package.json +++ b/hasher.rs/package.json @@ -1,6 +1,6 @@ { "name": "@lightprotocol/hasher.rs", - "version": "0.1.0-alpha.1", + "version": "0.2.0", "description": "", "keywords": [], "author": "", diff --git a/js/stateless.js/package.json b/js/stateless.js/package.json index 0ac538a74a..684083d5c3 100644 --- a/js/stateless.js/package.json +++ b/js/stateless.js/package.json @@ -1,6 +1,6 @@ { "name": "@lightprotocol/stateless.js", - "version": "0.3.0", + "version": "0.4.0", "description": "JavaScript API for Light and ZK Compression", "sideEffects": false, "main": "dist/cjs/node/index.cjs", @@ -38,7 +38,6 @@ "@solana/web3.js": "^1.91.8" }, "dependencies": { - "@lightprotocol/hasher.rs": "workspace:*", "@coral-xyz/anchor": "0.29.0", "@noble/hashes": "^1.3.2", "buffer": "^6.0.3", @@ -46,6 +45,7 @@ "tweetnacl": "^1.0.3" }, "devDependencies": { + "@lightprotocol/hasher.rs": "workspace:*", "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@lightprotocol/programs": "workspace:*", "@playwright/test": "^1.43.1", diff --git a/js/stateless.js/rollup.config.js b/js/stateless.js/rollup.config.js index 5e2e73a490..126a18cc8d 100644 --- a/js/stateless.js/rollup.config.js +++ b/js/stateless.js/rollup.config.js @@ -26,6 +26,11 @@ const rolls = (fmt, env) => ({ }), env === 'browser' ? nodePolyfills() : undefined, ].filter(Boolean), + onwarn(warning, warn) { + if (warning.code !== 'CIRCULAR_DEPENDENCY') { + warn(warning); + } + }, }); const typesConfig = { diff --git a/js/stateless.js/src/test-helpers/merkle-tree/indexed-array.ts b/js/stateless.js/src/test-helpers/merkle-tree/indexed-array.ts index 3135d1f1f6..0ec367f16b 100644 --- a/js/stateless.js/src/test-helpers/merkle-tree/indexed-array.ts +++ b/js/stateless.js/src/test-helpers/merkle-tree/indexed-array.ts @@ -500,11 +500,6 @@ if (import.meta.vitest) { const refIndexedArrayElem2 = new IndexedElement(2, bn(30), 1); describe('IndexedArray', () => { - // it("init should match ref", () => { - // const indexedArray = new IndexedArray(refIndexedArrayElem0, refIndexedArrayElem1, refIndexedArrayElem2); - // expect(indexedArray.root).toEqual(refIndexedMerkleTreeInitedRoot); - // }); - beforeAll(async () => { WasmFactory = (await import('@lightprotocol/hasher.rs')) .WasmFactory; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d5a206909d..546438ab4b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -630,9 +630,6 @@ importers: '@coral-xyz/anchor': specifier: 0.29.0 version: 0.29.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - '@lightprotocol/hasher.rs': - specifier: workspace:* - version: link:../../hasher.rs '@noble/hashes': specifier: ^1.3.2 version: 1.3.2 @@ -652,6 +649,9 @@ importers: '@esbuild-plugins/node-globals-polyfill': specifier: ^0.2.3 version: 0.2.3(esbuild@0.21.1) + '@lightprotocol/hasher.rs': + specifier: workspace:* + version: link:../../hasher.rs '@lightprotocol/programs': specifier: workspace:* version: link:../../programs From 124757b12fd658675643fc2923898555288c5166 Mon Sep 17 00:00:00 2001 From: Swen Date: Mon, 24 Jun 2024 02:51:53 +0100 Subject: [PATCH 08/10] version bump ctoken and cli4.1.0 --- cli/package.json | 2 +- js/compressed-token/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/package.json b/cli/package.json index 1272ad2bd5..fc3bd98d03 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "@lightprotocol/zk-compression-cli", - "version": "0.3.0", + "version": "0.4.1", "description": "ZK Compression: Secure Scaling on Solana", "maintainers": [ { diff --git a/js/compressed-token/package.json b/js/compressed-token/package.json index f63a318f42..43bb89972b 100644 --- a/js/compressed-token/package.json +++ b/js/compressed-token/package.json @@ -1,6 +1,6 @@ { "name": "@lightprotocol/compressed-token", - "version": "0.2.0", + "version": "0.3.0", "description": "JS client to interact with the compressed-token program", "sideEffects": false, "type": "module", From aece5d3d5fb2b0b7494911f2c4dddc372e7d3894 Mon Sep 17 00:00:00 2001 From: Swen Date: Mon, 24 Jun 2024 03:21:06 +0100 Subject: [PATCH 09/10] --locked cli --- cli/src/utils/processPhotonIndexer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/utils/processPhotonIndexer.ts b/cli/src/utils/processPhotonIndexer.ts index cd7b2c5005..33938c6b09 100644 --- a/cli/src/utils/processPhotonIndexer.ts +++ b/cli/src/utils/processPhotonIndexer.ts @@ -16,7 +16,7 @@ export async function startIndexer( resolvedOrNull === null || (checkPhotonVersion && !(await isExpectedPhotonVersion(PHOTON_VERSION))) ) { - const message = `Photon indexer not found. Please install it by running "cargo install photon-indexer --version ${PHOTON_VERSION}"`; + const message = `Photon indexer not found. Please install it by running "cargo install photon-indexer --version ${PHOTON_VERSION} --locked"`; console.log(message); throw new Error(message); } else { From 7cf4e9d8d9059f0aec5606a797921cabeac969f7 Mon Sep 17 00:00:00 2001 From: Swen Date: Mon, 24 Jun 2024 04:35:22 +0100 Subject: [PATCH 10/10] update cli readme for testnet --- cli/README.md | 29 +++++++++++++++++++++++++++++ cli/package.json | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/cli/README.md b/cli/README.md index 7b8e7d37ee..eaf6bce42f 100644 --- a/cli/README.md +++ b/cli/README.md @@ -88,6 +88,35 @@ solana balance Now you're all set up to run CLI commands :) +#### Using ZK Testnet + +By default, the CLI interacts with localnet. You can view the current config by running: + +```bash +light config --get +``` + +To switch to ZK Testnet, run: + +```bash + light config --indexerUrl "https://zk-testnet.helius.dev:8784" \ + --proverUrl "https://zk-testnet.helius.dev:3001" \ + --solanaRpcUrl "https://zk-testnet.helius.dev:8899" +``` + +Also adjust your solana config: + +```bash +# Set config +solana config set --url "https://zk-testnet.helius.dev:8899" + +# Airdrop 1 SOL +solana airdrop 1 + +# Print your address +solana address +``` + ### Commands #### Create a compressed token mint diff --git a/cli/package.json b/cli/package.json index fc3bd98d03..cc995e5f49 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "@lightprotocol/zk-compression-cli", - "version": "0.4.1", + "version": "0.4.2", "description": "ZK Compression: Secure Scaling on Solana", "maintainers": [ {