Skip to content

Commit

Permalink
chore: rename merkle-tree -> program-libs, create prover & sdk-libs
Browse files Browse the repository at this point in the history
  • Loading branch information
ananas-block committed Dec 26, 2024
1 parent 667e228 commit 3de3b88
Show file tree
Hide file tree
Showing 638 changed files with 251 additions and 226 deletions.
6 changes: 3 additions & 3 deletions .github/actions/setup-and-build-nocheck/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runs:
with:
path: |
.local
light-prover/proving-keys
prover/server/proving-keys
key: ${{ runner.os }}-local-${{ hashFiles('scripts/install.sh') }}

- name: Install dependencies
Expand Down Expand Up @@ -72,5 +72,5 @@ runs:
with:
path: |
.local
light-prover/proving-keys
key: ${{ runner.os }}-local-${{ hashFiles('scripts/install.sh') }}
prover/server/proving-keys
key: ${{ runner.os }}-local-${{ hashFiles('scripts/install.sh') }}
10 changes: 5 additions & 5 deletions .github/actions/setup-and-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ runs:
with:
path: |
.local
light-prover/proving-keys
key: ${{ runner.os }}-local-${{ hashFiles('scripts/install.sh', 'light-prover/scripts/download_keys.sh') }}
prover/server/proving-keys
key: ${{ runner.os }}-local-${{ hashFiles('scripts/install.sh', 'prover/server/scripts/download_keys.sh') }}

- name: Install dependencies
if: steps.restore-local-cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -62,7 +62,7 @@ runs:
source ./scripts/devenv.sh
mkdir -p /home/runner/.config/solana/
solana-keygen new --no-bip39-passphrase -o /home/runner/.config/solana/id.json
- name: Copy spl_noop.so to target/deploy
shell: bash
run: |
Expand All @@ -75,8 +75,8 @@ runs:
with:
path: |
.local
light-prover/proving-keys
key: ${{ runner.os }}-local-${{ hashFiles('scripts/install.sh', 'light-prover/scripts/download_keys.sh') }}
prover/server/proving-keys
key: ${{ runner.os }}-local-${{ hashFiles('scripts/install.sh', 'prover/server/scripts/download_keys.sh') }}

- name: Check for git changes
shell: bash
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/prover-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release prover binaries
on:
push:
tags:
- 'light-prover*'
- "light-prover*"

jobs:
create_release:
Expand All @@ -18,7 +18,7 @@ jobs:

- name: Build artifacts
run: |
cd light-prover
cd prover/server
for cfgstr in "darwin amd64" "darwin arm64" "linux amd64" "windows amd64"; do
IFS=' ' read -r -a cfg <<< "$cfgstr"
export GOOS="${cfg[0]}"
Expand All @@ -31,7 +31,7 @@ jobs:
uses: softprops/action-gh-release@v2
with:
files: |
light-prover/prover-darwin-amd64
light-prover/prover-darwin-arm64
light-prover/prover-linux-amd64
light-prover/prover-windows-amd64
prover/server/prover-darwin-amd64
prover/server/prover-darwin-arm64
prover/server/prover-linux-amd64
prover/server/prover-windows-amd64
28 changes: 14 additions & 14 deletions .github/workflows/prover-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ on:
push:
branches:
- main
- 'release/**'
- "release/**"
paths:
- "light-prover/**"
- "prover/server/**"
- ".github/workflows/prover-test.yml"
- ".github/workflows/prover-release.yml"
pull_request:
branches:
- "*"
paths:
- "light-prover/**"
- "prover/server/**"
- ".github/workflows/prover-test.yml"
- ".github/workflows/prover-release.yml"
types:
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "./light-prover/go.mod"
go-version-file: "./prover/server/go.mod"

- name: Install Elan
run: |
Expand All @@ -43,50 +43,50 @@ jobs:
- name: Cache dependencies
uses: actions/cache@v4
with:
path: light-prover/formal-verification/lake-packages
path: prover/server/formal-verification/lake-packages
key: "${{ env.LAKE_VERSION }}"

- name: Download keys for lightweight tests
if: ${{ github.event.pull_request.base.ref == 'main' }}
run: |
cd light-prover
cd prover/server
./scripts/download_keys.sh light
- name: Download keys for full tests
if: ${{ github.event.pull_request.base.ref == 'release' }}
run: |
cd light-prover
cd prover/server
./scripts/download_keys.sh full
- name: Build
run: |
cd light-prover
cd prover/server
go build
- name: Unit tests
run: |
cd light-prover
cd prover/server
go test ./prover -timeout 60m
- name: Lightweight integration tests
if: ${{ github.event.pull_request.base.ref == 'main' }}
run: |
cd light-prover
cd prover/server
go test -run TestLightweight -timeout 15m
- name: Full integration tests
if: ${{ github.event.pull_request.base.ref == 'release' }}
run: |
cd light-prover
cd prover/server
go test -run TestFull -timeout 120m
# - name: Extract circuit to Lean
# run: |
# cd light-prover
# cd prover/server
# ./light-prover extract-circuit --output formal-verification/FormalVerification/Circuit.lean --tree-height=26 --compressed-accounts=8

# - name: Build lean project
# run: |
# cd light-prover/formal-verification
# cd prover/server/formal-verification
# ~/.elan/bin/lake exe cache get
# ~/.elan/bin/lake build
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:
- ".cargo/**"
- "**/*.rs"
- "**/Cargo.*"
- "light-prover/**"
- "prover/server/**"
- ".github/workflows/rust.yml"
pull_request:
branches:
- "*"
paths:
- "**/*.rs"
- "**/Cargo.*"
- "light-prover/**"
- "prover/server/**"
- ".github/workflows/rust.yml"

types:
Expand Down
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 49 additions & 41 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
[workspace]
resolver = "2"
members = [
"heap",
"circuit-lib/light-prover-client",
"circuit-lib/verifier",
"macros/aligned-sized",
"macros/light",
"macros/light-sdk-macros",
"merkle-tree/*",
"program-libs/aligned-sized",
"program-libs/batched-merkle-tree",
"program-libs/bloom-filter",
"program-libs/hasher",
"program-libs/utils",
"program-libs/verifier",
"program-libs/merkle-tree-metadata",
"program-libs/bounded-vec",
"program-libs/concurrent-merkle-tree",
"program-libs/hash-set",
"program-libs/indexed-merkle-tree",
"programs/account-compression",
"programs/system",
"programs/compressed-token",
"programs/registry",
"client",
"sdk",
"test-utils",
"utils",
"sdk-libs/client",
"sdk-libs/macros",
"sdk-libs/sdk",
"sdk-libs/photon-api",
"sdk-libs/program-test",
"xtask",
"examples/name-service/programs/*",
"examples/token-escrow/programs/*",
"test-programs/account-compression-test/",
"test-programs/compressed-token-test/",
"test-programs/e2e-test/",
"test-programs/registry-test/",
"test-programs/system-cpi-test/",
"test-programs/system-test/",
"test-programs/sdk-test-program/programs/sdk-test/",
"test-programs/create-address-test-program/",
"program-tests/account-compression-test/",
"program-tests/compressed-token-test/",
"program-tests/e2e-test/",
"program-tests/registry-test/",
"program-tests/system-cpi-test/",
"program-tests/system-test/",
"program-tests/sdk-test-program/programs/sdk-test/",
"program-tests/create-address-test-program/",
"program-tests/utils",
"program-tests/merkle-tree",
"forester-utils",
"forester",
"photon-api",
"light-program-test",
]

[profile.release]
Expand Down Expand Up @@ -78,32 +83,35 @@ log = "0.4"
thiserror = "1.0"

# Light Protocol
light-client = { path = "client", version = "0.9.1" }
light-concurrent-merkle-tree = { path = "merkle-tree/concurrent", version = "1.1.0" }
light-hasher = { path = "merkle-tree/hasher", version = "1.1.0" }
light-indexed-merkle-tree = { path = "merkle-tree/indexed", version = "1.1.0" }
light-macros = { path = "macros/light", version = "1.1.0" }
light-merkle-tree-reference = { path = "merkle-tree/reference", version = "1.1.0" }
light-prover-client = { path = "circuit-lib/light-prover-client", version = "1.2.0" }
light-sdk = { path = "sdk", version = "0.11.0" }
light-sdk-macros = { path = "macros/light-sdk-macros", version = "0.4.0" }
light-utils = { path = "utils", version = "1.1.0" }
light-verifier = { path = "circuit-lib/verifier", version = "1.1.0" }
photon-api = { path = "photon-api", version = "0.45.0" }
light-hash-set = { version = "1.2.0", path = "program-libs/hash-set" }
light-indexed-merkle-tree = { version = "1.1.0", path = "program-libs/indexed-merkle-tree" }
light-concurrent-merkle-tree = { version = "1.1.0" , path= "program-libs/concurrent-merkle-tree"}
light-client = { path = "sdk-libs/client", version = "0.9.1" }
light-hasher = { path = "program-libs/hasher", version = "1.1.0" }
light-macros = { path = "program-libs/macros", version = "1.1.0" }
light-merkle-tree-reference = { path = "program-tests/merkle-tree", version = "1.1.0" }
light-heap = { path = "program-libs/heap", version = "1.1.0" }
light-prover-client = { path = "prover/client", version = "1.2.0" }
light-sdk = { path = "sdk-libs/sdk", version = "0.11.0" }
light-sdk-macros = { path = "sdk-libs/macros", version = "0.4.0" }
light-utils = { path = "program-libs/utils", version = "1.1.0" }
light-verifier = { path = "program-libs/verifier", version = "1.1.0" }
photon-api = { path = "sdk-libs/photon-api", version = "0.45.0" }
forester-utils = { path = "forester-utils", version = "1.2.0" }
light-hash-set = { path = "merkle-tree/hash-set", version = "1.2.0" }
account-compression = { path = "programs/account-compression", version = "1.2.0", features = ["cpi"] }
light-compressed-token = { path = "programs/compressed-token", version = "1.2.0", features = ["cpi"] }
light-system-program = { path = "programs/system", version = "1.2.0", features = ["cpi"] }
light-registry = { path = "programs/registry", version = "1.2.0", features = ["cpi"]}
create-address-test-program = { path = "test-programs/create-address-test-program", version = "1.0.0", features = ["cpi"] }
light-program-test = { path = "light-program-test", version = "0.1.0" }
light-batched-merkle-tree = { path = "merkle-tree/batched", version = "0.1.0" }
light-merkle-tree-metadata = { path = "merkle-tree/metadata", version = "0.1.0" }
aligned-sized = { path = "macros/aligned-sized", version = "1.1.0" }
light-bloom-filter = { path = "merkle-tree/bloom-filter", version = "0.1.0" }
light-bounded-vec = { path = "merkle-tree/bounded-vec", version = "1.1.0" }
create-address-test-program = { path = "program-tests/create-address-test-program", version = "1.0.0", features = ["cpi"] }
light-program-test = { path = "sdk-libs/program-test", version = "0.1.0" }
light-batched-merkle-tree = { path = "program-libs/batched-merkle-tree", version = "0.1.0" }
light-merkle-tree-metadata = { path = "program-libs/merkle-tree-metadata", version = "0.1.0" }
aligned-sized = { path = "program-libs/aligned-sized", version = "1.1.0" }
light-bloom-filter = { path = "program-libs/bloom-filter", version = "0.1.0" }
light-bounded-vec = { path = "program-libs/bounded-vec", version = "1.1.0" }
light-poseidon = { version = "0.2.0" }
light-test-utils = { path = "program-tests/utils", version = "1.2.1" }
create-address-program-test = { path = "program-tests/create-address-test-program", version = "1.0.0" }
bytemuck = { version = "1.17" }
# Math and crypto
num-bigint = "0.4.6"
Expand Down
2 changes: 1 addition & 1 deletion cli/scripts/buildProver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build_prover() {
}

root_dir="$(git rev-parse --show-toplevel)"
gnark_dir="${root_dir}/light-prover"
gnark_dir="${root_dir}/prover/server"
out_dir="${root_dir}/cli/bin"

if [ ! -e "$out_dir" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ solana-sdk = { workspace = true }

[dev-dependencies]
light-client = { workspace = true , features = ["devenv"]}
light-test-utils = { path = "../../../../test-utils", version = "1.2.0", features = ["devenv"] }
light-test-utils = { workspace = true, features = ["devenv"] }
light-program-test = { workspace = true, features = ["devenv"] }
solana-program-test = { workspace = true }
tokio = "1.36.0"
2 changes: 1 addition & 1 deletion examples/name-service/programs/name-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ solana-sdk = { workspace = true }

[dev-dependencies]
light-client = { workspace = true , features = ["devenv"]}
light-test-utils = { path = "../../../../test-utils", version = "1.2.0", features = ["devenv"] }
light-test-utils = { workspace = true, features = ["devenv"] }
light-program-test = { workspace = true }
solana-program-test = { workspace = true }
tokio = "1.36.0"
8 changes: 4 additions & 4 deletions examples/token-escrow/programs/token-escrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ anchor-lang = { workspace = true, features = ["init-if-needed"] }
light-compressed-token = { workspace = true }
light-system-program = { workspace = true }
account-compression = { workspace = true }
light-hasher = { path = "../../../../merkle-tree/hasher", version = "1.1.0" }
light-verifier = { path = "../../../../circuit-lib/verifier", version = "1.1.0" }
light-hasher = { workspace = true }
light-verifier = { workspace = true }
light-sdk = { workspace = true, features = ["legacy"] }

[target.'cfg(not(target_os = "solana"))'.dependencies]
solana-sdk = { workspace = true }

[dev-dependencies]
light-test-utils = { version = "1.2.0", path = "../../../../test-utils", features = ["devenv"] }
light-test-utils = { workspace = true, features = ["devenv"] }
light-program-test = { workspace = true, features = ["devenv"] }
tokio = { workspace = true }
light-prover-client = { path = "../../../../circuit-lib/light-prover-client", version = "1.2.0" }
light-prover-client = { workspace = true, version = "1.2.0" }
anchor-spl = { workspace = true }

[lints.rust.unexpected_cfgs]
Expand Down
14 changes: 7 additions & 7 deletions forester-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ description = "Utility library for Light's Forester node implementation"
account-compression = { workspace = true }
light-compressed-token = { workspace = true }
light-hash-set = { workspace=true }
light-hasher = { version = "1.1.0", path = "../merkle-tree/hasher" }
light-merkle-tree-reference = { version = "1.1.0", path = "../merkle-tree/reference" }
light-concurrent-merkle-tree = { version = "1.1.0", path = "../merkle-tree/concurrent" }
light-indexed-merkle-tree = { path = "../merkle-tree/indexed/", version = "1.1.0" }
light-prover-client = { path = "../circuit-lib/light-prover-client", version = "1.2.0" }
light-hasher = { workspace = true }
light-merkle-tree-reference = { workspace = true }
light-concurrent-merkle-tree = { workspace = true }
light-indexed-merkle-tree = { workspace = true }
light-prover-client = { workspace = true }
light-registry = { workspace = true }
light-system-program = { path = "../programs/system", version = "1.2.0", features = ["cpi"] }
light-utils = { path = "../utils", version = "1.1.0" }
light-system-program = { workspace = true, features = ["cpi"] }
light-utils = { workspace = true }
light-batched-merkle-tree = { workspace = true }

photon-api = { workspace = true }
Expand Down
Loading

0 comments on commit 3de3b88

Please sign in to comment.