clvk-rs 0.16.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. clvk_rs-0.16.0/.cargo/config.toml +11 -0
  2. clvk_rs-0.16.0/.github/dependabot.yml +80 -0
  3. clvk_rs-0.16.0/.github/workflows/build-arm64-wheels.yml +88 -0
  4. clvk_rs-0.16.0/.github/workflows/build-crate.yml +44 -0
  5. clvk_rs-0.16.0/.github/workflows/build-m1-wheel.yml +110 -0
  6. clvk_rs-0.16.0/.github/workflows/build-npm.yml +51 -0
  7. clvk_rs-0.16.0/.github/workflows/build-test.yml +284 -0
  8. clvk_rs-0.16.0/.gitignore +25 -0
  9. clvk_rs-0.16.0/.prettierrc +4 -0
  10. clvk_rs-0.16.0/Cargo.lock +1886 -0
  11. clvk_rs-0.16.0/Cargo.toml +111 -0
  12. clvk_rs-0.16.0/LICENSE +201 -0
  13. clvk_rs-0.16.0/PKG-INFO +92 -0
  14. clvk_rs-0.16.0/README.md +79 -0
  15. clvk_rs-0.16.0/RELEASE.md +29 -0
  16. clvk_rs-0.16.0/SECURITY.md +9 -0
  17. clvk_rs-0.16.0/benches/0.generator +0 -0
  18. clvk_rs-0.16.0/benches/1.generator +0 -0
  19. clvk_rs-0.16.0/benches/2.generator +1 -0
  20. clvk_rs-0.16.0/benches/3.generator +0 -0
  21. clvk_rs-0.16.0/benches/4.generator +0 -0
  22. clvk_rs-0.16.0/benches/block_af9c3d98.bin +0 -0
  23. clvk_rs-0.16.0/benches/deserialize.rs +94 -0
  24. clvk_rs-0.16.0/benches/run-program.rs +248 -0
  25. clvk_rs-0.16.0/benches/serialize.rs +64 -0
  26. clvk_rs-0.16.0/benches/sha256_hash.rs +42 -0
  27. clvk_rs-0.16.0/benchmark/block-2000.hex +1 -0
  28. clvk_rs-0.16.0/benchmark/compressed-2000.envhex +1 -0
  29. clvk_rs-0.16.0/benchmark/compressed-2000.hex +1 -0
  30. clvk_rs-0.16.0/benchmark/concat.clvk +14 -0
  31. clvk_rs-0.16.0/benchmark/concat.hex +1 -0
  32. clvk_rs-0.16.0/benchmark/count-even.clvk +11 -0
  33. clvk_rs-0.16.0/benchmark/count-even.hex +1 -0
  34. clvk_rs-0.16.0/benchmark/factorial.clvk +8 -0
  35. clvk_rs-0.16.0/benchmark/factorial.hex +1 -0
  36. clvk_rs-0.16.0/benchmark/hash-string.clvk +5 -0
  37. clvk_rs-0.16.0/benchmark/hash-string.hex +1 -0
  38. clvk_rs-0.16.0/benchmark/hash-tree.clvk +8 -0
  39. clvk_rs-0.16.0/benchmark/hash-tree.hex +1 -0
  40. clvk_rs-0.16.0/benchmark/large-block.clvk +1 -0
  41. clvk_rs-0.16.0/benchmark/large-block.hex +1 -0
  42. clvk_rs-0.16.0/benchmark/loop_add.clvk +7 -0
  43. clvk_rs-0.16.0/benchmark/loop_add.hex +1 -0
  44. clvk_rs-0.16.0/benchmark/loop_ior.clvk +7 -0
  45. clvk_rs-0.16.0/benchmark/loop_ior.hex +1 -0
  46. clvk_rs-0.16.0/benchmark/loop_not.clvk +7 -0
  47. clvk_rs-0.16.0/benchmark/loop_not.hex +1 -0
  48. clvk_rs-0.16.0/benchmark/loop_sub.clvk +7 -0
  49. clvk_rs-0.16.0/benchmark/loop_sub.hex +1 -0
  50. clvk_rs-0.16.0/benchmark/loop_xor.clvk +7 -0
  51. clvk_rs-0.16.0/benchmark/loop_xor.hex +1 -0
  52. clvk_rs-0.16.0/benchmark/matrix-multiply.clvk +39 -0
  53. clvk_rs-0.16.0/benchmark/matrix-multiply.hex +1 -0
  54. clvk_rs-0.16.0/benchmark/point-pow.clvk +8 -0
  55. clvk_rs-0.16.0/benchmark/point-pow.hex +1 -0
  56. clvk_rs-0.16.0/benchmark/pubkey-tree.clvk +8 -0
  57. clvk_rs-0.16.0/benchmark/pubkey-tree.hex +1 -0
  58. clvk_rs-0.16.0/benchmark/shift-left.clvk +8 -0
  59. clvk_rs-0.16.0/benchmark/shift-left.hex +1 -0
  60. clvk_rs-0.16.0/benchmark/substr-tree.clvk +12 -0
  61. clvk_rs-0.16.0/benchmark/substr-tree.hex +1 -0
  62. clvk_rs-0.16.0/benchmark/substr.clvk +11 -0
  63. clvk_rs-0.16.0/benchmark/substr.hex +1 -0
  64. clvk_rs-0.16.0/benchmark/sum-tree.clvk +8 -0
  65. clvk_rs-0.16.0/benchmark/sum-tree.hex +1 -0
  66. clvk_rs-0.16.0/benchmarks.txt +120 -0
  67. clvk_rs-0.16.0/docs/compressed-serialization.md +195 -0
  68. clvk_rs-0.16.0/docs/new-operator-checklist.md +45 -0
  69. clvk_rs-0.16.0/op-tests/test-bls-ops.txt +351 -0
  70. clvk_rs-0.16.0/op-tests/test-bls-zk.txt +4 -0
  71. clvk_rs-0.16.0/op-tests/test-blspy-g1.txt +120 -0
  72. clvk_rs-0.16.0/op-tests/test-blspy-g2.txt +120 -0
  73. clvk_rs-0.16.0/op-tests/test-blspy-hash.txt +212 -0
  74. clvk_rs-0.16.0/op-tests/test-blspy-pairing.txt +32 -0
  75. clvk_rs-0.16.0/op-tests/test-blspy-verify.txt +32 -0
  76. clvk_rs-0.16.0/op-tests/test-core-ops.txt +104 -0
  77. clvk_rs-0.16.0/op-tests/test-keccak256-generated.txt +1565 -0
  78. clvk_rs-0.16.0/op-tests/test-keccak256.txt +12 -0
  79. clvk_rs-0.16.0/op-tests/test-modpow.txt +202 -0
  80. clvk_rs-0.16.0/op-tests/test-more-ops.txt +759 -0
  81. clvk_rs-0.16.0/op-tests/test-secp-verify.txt +66 -0
  82. clvk_rs-0.16.0/op-tests/test-secp256k1.txt +41 -0
  83. clvk_rs-0.16.0/op-tests/test-secp256r1.txt +41 -0
  84. clvk_rs-0.16.0/op-tests/test-sha256.txt +370 -0
  85. clvk_rs-0.16.0/package-lock.json +28 -0
  86. clvk_rs-0.16.0/package.json +10 -0
  87. clvk_rs-0.16.0/pyproject.toml +8 -0
  88. clvk_rs-0.16.0/python/clvk_rs/__init__.py +5 -0
  89. clvk_rs-0.16.0/python/clvk_rs/at.py +39 -0
  90. clvk_rs-0.16.0/python/clvk_rs/casts.py +177 -0
  91. clvk_rs-0.16.0/python/clvk_rs/chik_dialect.py +40 -0
  92. clvk_rs-0.16.0/python/clvk_rs/clvk_rs.pyi +22 -0
  93. clvk_rs-0.16.0/python/clvk_rs/clvk_storage.py +26 -0
  94. clvk_rs-0.16.0/python/clvk_rs/clvk_tree.py +114 -0
  95. clvk_rs-0.16.0/python/clvk_rs/curry_and_treehash.py +156 -0
  96. clvk_rs-0.16.0/python/clvk_rs/de.py +119 -0
  97. clvk_rs-0.16.0/python/clvk_rs/eval_error.py +9 -0
  98. clvk_rs-0.16.0/python/clvk_rs/program.py +350 -0
  99. clvk_rs-0.16.0/python/clvk_rs/py.typed +0 -0
  100. clvk_rs-0.16.0/python/clvk_rs/replace.py +38 -0
  101. clvk_rs-0.16.0/python/clvk_rs/ser.py +183 -0
  102. clvk_rs-0.16.0/python/clvk_rs/tree_hash.py +109 -0
  103. clvk_rs-0.16.0/rustup-init.sh +930 -0
  104. clvk_rs-0.16.0/src/allocator.rs +2304 -0
  105. clvk_rs-0.16.0/src/bls_ops.rs +336 -0
  106. clvk_rs-0.16.0/src/chik_dialect.rs +205 -0
  107. clvk_rs-0.16.0/src/core_ops.rs +80 -0
  108. clvk_rs-0.16.0/src/cost.rs +11 -0
  109. clvk_rs-0.16.0/src/dialect.rs +35 -0
  110. clvk_rs-0.16.0/src/error.rs +112 -0
  111. clvk_rs-0.16.0/src/f_table.rs +91 -0
  112. clvk_rs-0.16.0/src/keccak256_ops.rs +31 -0
  113. clvk_rs-0.16.0/src/lib.rs +39 -0
  114. clvk_rs-0.16.0/src/more_ops.rs +1024 -0
  115. clvk_rs-0.16.0/src/number.rs +285 -0
  116. clvk_rs-0.16.0/src/op_utils.rs +652 -0
  117. clvk_rs-0.16.0/src/reduction.rs +8 -0
  118. clvk_rs-0.16.0/src/run_program.rs +1569 -0
  119. clvk_rs-0.16.0/src/runtime_dialect.rs +77 -0
  120. clvk_rs-0.16.0/src/secp_ops.rs +93 -0
  121. clvk_rs-0.16.0/src/serde/bitset.rs +96 -0
  122. clvk_rs-0.16.0/src/serde/bytes32.rs +17 -0
  123. clvk_rs-0.16.0/src/serde/de.rs +47 -0
  124. clvk_rs-0.16.0/src/serde/de_br.rs +386 -0
  125. clvk_rs-0.16.0/src/serde/de_tree.rs +354 -0
  126. clvk_rs-0.16.0/src/serde/identity_hash.rs +44 -0
  127. clvk_rs-0.16.0/src/serde/incremental.rs +423 -0
  128. clvk_rs-0.16.0/src/serde/mod.rs +39 -0
  129. clvk_rs-0.16.0/src/serde/object_cache.rs +320 -0
  130. clvk_rs-0.16.0/src/serde/parse_atom.rs +227 -0
  131. clvk_rs-0.16.0/src/serde/path_builder.rs +196 -0
  132. clvk_rs-0.16.0/src/serde/read_cache_lookup.rs +406 -0
  133. clvk_rs-0.16.0/src/serde/ser.rs +111 -0
  134. clvk_rs-0.16.0/src/serde/ser_br.rs +114 -0
  135. clvk_rs-0.16.0/src/serde/serialized_length.rs +94 -0
  136. clvk_rs-0.16.0/src/serde/test.rs +95 -0
  137. clvk_rs-0.16.0/src/serde/tools.rs +614 -0
  138. clvk_rs-0.16.0/src/serde/tree_cache.rs +790 -0
  139. clvk_rs-0.16.0/src/serde/utils.rs +25 -0
  140. clvk_rs-0.16.0/src/serde/write_atom.rs +185 -0
  141. clvk_rs-0.16.0/src/test_ops.rs +525 -0
  142. clvk_rs-0.16.0/src/tests.rs +136 -0
  143. clvk_rs-0.16.0/src/traverse_path.rs +268 -0
  144. clvk_rs-0.16.0/tests/generate-programs.py +252 -0
  145. clvk_rs-0.16.0/tests/programs/args-add.envhex +1 -0
  146. clvk_rs-0.16.0/tests/programs/args-add.hex +1 -0
  147. clvk_rs-0.16.0/tests/programs/args-all.envhex +1 -0
  148. clvk_rs-0.16.0/tests/programs/args-all.hex +1 -0
  149. clvk_rs-0.16.0/tests/programs/args-and.envhex +1 -0
  150. clvk_rs-0.16.0/tests/programs/args-and.hex +1 -0
  151. clvk_rs-0.16.0/tests/programs/args-any.envhex +1 -0
  152. clvk_rs-0.16.0/tests/programs/args-any.hex +1 -0
  153. clvk_rs-0.16.0/tests/programs/args-cat.envhex +1 -0
  154. clvk_rs-0.16.0/tests/programs/args-cat.hex +1 -0
  155. clvk_rs-0.16.0/tests/programs/args-mul.envhex +1 -0
  156. clvk_rs-0.16.0/tests/programs/args-mul.hex +1 -0
  157. clvk_rs-0.16.0/tests/programs/args-or.envhex +1 -0
  158. clvk_rs-0.16.0/tests/programs/args-or.hex +1 -0
  159. clvk_rs-0.16.0/tests/programs/args-point_add.envhex +1 -0
  160. clvk_rs-0.16.0/tests/programs/args-point_add.hex +1 -0
  161. clvk_rs-0.16.0/tests/programs/args-sha.envhex +1 -0
  162. clvk_rs-0.16.0/tests/programs/args-sha.hex +1 -0
  163. clvk_rs-0.16.0/tests/programs/args-sub.envhex +1 -0
  164. clvk_rs-0.16.0/tests/programs/args-sub.hex +1 -0
  165. clvk_rs-0.16.0/tests/programs/args-unknown-1.envhex +1 -0
  166. clvk_rs-0.16.0/tests/programs/args-unknown-1.hex +1 -0
  167. clvk_rs-0.16.0/tests/programs/args-unknown-2.envhex +1 -0
  168. clvk_rs-0.16.0/tests/programs/args-unknown-2.hex +1 -0
  169. clvk_rs-0.16.0/tests/programs/args-unknown-3.envhex +1 -0
  170. clvk_rs-0.16.0/tests/programs/args-unknown-3.hex +1 -0
  171. clvk_rs-0.16.0/tests/programs/args-unknown-4.envhex +1 -0
  172. clvk_rs-0.16.0/tests/programs/args-unknown-4.hex +1 -0
  173. clvk_rs-0.16.0/tests/programs/args-unknown-5.envhex +1 -0
  174. clvk_rs-0.16.0/tests/programs/args-unknown-5.hex +1 -0
  175. clvk_rs-0.16.0/tests/programs/args-unknown-6.envhex +1 -0
  176. clvk_rs-0.16.0/tests/programs/args-unknown-6.hex +1 -0
  177. clvk_rs-0.16.0/tests/programs/args-unknown-7.envhex +1 -0
  178. clvk_rs-0.16.0/tests/programs/args-unknown-7.hex +1 -0
  179. clvk_rs-0.16.0/tests/programs/args-unknown-8.envhex +1 -0
  180. clvk_rs-0.16.0/tests/programs/args-unknown-8.hex +1 -0
  181. clvk_rs-0.16.0/tests/programs/args-unknown-9.envhex +1 -0
  182. clvk_rs-0.16.0/tests/programs/args-unknown-9.hex +1 -0
  183. clvk_rs-0.16.0/tests/programs/args-xor.envhex +1 -0
  184. clvk_rs-0.16.0/tests/programs/args-xor.hex +1 -0
  185. clvk_rs-0.16.0/tests/programs/recursive-add.envhex +1 -0
  186. clvk_rs-0.16.0/tests/programs/recursive-add.hex +1 -0
  187. clvk_rs-0.16.0/tests/programs/recursive-ash.envhex +1 -0
  188. clvk_rs-0.16.0/tests/programs/recursive-ash.hex +1 -0
  189. clvk_rs-0.16.0/tests/programs/recursive-cat.envhex +1 -0
  190. clvk_rs-0.16.0/tests/programs/recursive-cat.hex +1 -0
  191. clvk_rs-0.16.0/tests/programs/recursive-cons.envhex +1 -0
  192. clvk_rs-0.16.0/tests/programs/recursive-cons.hex +1 -0
  193. clvk_rs-0.16.0/tests/programs/recursive-div.envhex +1 -0
  194. clvk_rs-0.16.0/tests/programs/recursive-div.hex +1 -0
  195. clvk_rs-0.16.0/tests/programs/recursive-lsh.envhex +1 -0
  196. clvk_rs-0.16.0/tests/programs/recursive-lsh.hex +1 -0
  197. clvk_rs-0.16.0/tests/programs/recursive-mul.envhex +1 -0
  198. clvk_rs-0.16.0/tests/programs/recursive-mul.hex +1 -0
  199. clvk_rs-0.16.0/tests/programs/recursive-not.envhex +1 -0
  200. clvk_rs-0.16.0/tests/programs/recursive-not.hex +1 -0
  201. clvk_rs-0.16.0/tests/programs/recursive-pubkey.envhex +1 -0
  202. clvk_rs-0.16.0/tests/programs/recursive-pubkey.hex +1 -0
  203. clvk_rs-0.16.0/tests/programs/recursive-sub.envhex +1 -0
  204. clvk_rs-0.16.0/tests/programs/recursive-sub.hex +1 -0
  205. clvk_rs-0.16.0/tests/programs/softfork-1.envhex +1 -0
  206. clvk_rs-0.16.0/tests/programs/softfork-1.hex +1 -0
  207. clvk_rs-0.16.0/tests/programs/softfork-2.envhex +1 -0
  208. clvk_rs-0.16.0/tests/programs/softfork-2.hex +1 -0
  209. clvk_rs-0.16.0/tests/run-programs.py +148 -0
  210. clvk_rs-0.16.0/tests/run.py +60 -0
  211. clvk_rs-0.16.0/wheel/Cargo.toml +22 -0
  212. clvk_rs-0.16.0/wheel/README.md +79 -0
  213. clvk_rs-0.16.0/wheel/python/tests/__init__.py +0 -0
  214. clvk_rs-0.16.0/wheel/python/tests/test_apis.py +213 -0
  215. clvk_rs-0.16.0/wheel/python/tests/test_curry_and_treehash.py +39 -0
  216. clvk_rs-0.16.0/wheel/python/tests/test_program.py +507 -0
  217. clvk_rs-0.16.0/wheel/python/tests/test_serialize.py +159 -0
  218. clvk_rs-0.16.0/wheel/src/adapt_response.rs +31 -0
  219. clvk_rs-0.16.0/wheel/src/api.rs +97 -0
  220. clvk_rs-0.16.0/wheel/src/lazy_node.rs +54 -0
  221. clvk_rs-0.16.0/wheel/src/lib.rs +3 -0
@@ -0,0 +1,11 @@
1
+ [target.x86_64-apple-darwin]
2
+ rustflags = [
3
+ "-C", "link-arg=-undefined",
4
+ "-C", "link-arg=dynamic_lookup",
5
+ ]
6
+
7
+ [target.aarch64-apple-darwin]
8
+ rustflags = [
9
+ "-C", "link-arg=-undefined",
10
+ "-C", "link-arg=dynamic_lookup",
11
+ ]
@@ -0,0 +1,80 @@
1
+ # This file is managed by the repo-content-updater project. Manual changes here will result in a PR to bring back
2
+ # inline with the upstream template, unless you remove the dependabot managed file property from the repo
3
+
4
+ version: 2
5
+ updates:
6
+ - package-ecosystem: "gomod"
7
+ directory: /
8
+ schedule:
9
+ interval: "weekly"
10
+ day: "tuesday"
11
+ open-pull-requests-limit: 10
12
+ rebase-strategy: auto
13
+ labels:
14
+ - dependencies
15
+ - go
16
+ - "Changed"
17
+ reviewers: ["cmmarslender", "Starttoaster"]
18
+ groups:
19
+ global:
20
+ patterns:
21
+ - "*"
22
+
23
+ - package-ecosystem: "pip"
24
+ directory: /
25
+ schedule:
26
+ interval: "weekly"
27
+ day: "tuesday"
28
+ open-pull-requests-limit: 10
29
+ rebase-strategy: auto
30
+ labels:
31
+ - dependencies
32
+ - python
33
+ - "Changed"
34
+ reviewers: ["emlowe", "altendky"]
35
+
36
+ - package-ecosystem: "github-actions"
37
+ directories: ["/", ".github/actions/*"]
38
+ schedule:
39
+ interval: "weekly"
40
+ day: "tuesday"
41
+ open-pull-requests-limit: 10
42
+ rebase-strategy: auto
43
+ labels:
44
+ - dependencies
45
+ - github_actions
46
+ - "Changed"
47
+ reviewers: ["cmmarslender", "Starttoaster", "pmaslana"]
48
+
49
+ - package-ecosystem: "npm"
50
+ directory: /
51
+ schedule:
52
+ interval: "weekly"
53
+ day: "tuesday"
54
+ open-pull-requests-limit: 10
55
+ rebase-strategy: auto
56
+ labels:
57
+ - dependencies
58
+ - javascript
59
+ - "Changed"
60
+ reviewers: ["cmmarslender", "ChikMineJP"]
61
+
62
+ - package-ecosystem: cargo
63
+ directory: /
64
+ schedule:
65
+ interval: "weekly"
66
+ day: "tuesday"
67
+ open-pull-requests-limit: 10
68
+ rebase-strategy: auto
69
+ labels:
70
+ - dependencies
71
+ - rust
72
+ - "Changed"
73
+
74
+ - package-ecosystem: swift
75
+ directory: /
76
+ schedule:
77
+ interval: "weekly"
78
+ day: "tuesday"
79
+ open-pull-requests-limit: 10
80
+ rebase-strategy: auto
@@ -0,0 +1,88 @@
1
+ name: Build ARM64 wheels on ubuntu-latest
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main1
7
+ - dev
8
+ tags:
9
+ - "**"
10
+ pull_request:
11
+ branches:
12
+ - "**"
13
+
14
+ permissions:
15
+ contents: read
16
+ id-token: write
17
+
18
+ jobs:
19
+ build_wheels:
20
+ name: ARM64 Python Wheels on ARM64 Ubuntu
21
+ runs-on: ${{ matrix.os }}
22
+ strategy:
23
+ matrix:
24
+ os: [[ARM64, Linux]]
25
+
26
+ steps:
27
+ - uses: Chik-Network/actions/clean-workspace@main
28
+
29
+ - name: Checkout repository
30
+ uses: actions/checkout@v4
31
+ with:
32
+ fetch-depth: 1
33
+
34
+ - name: Build Python wheels
35
+ run: |
36
+ docker run --rm \
37
+ -v ${{ github.workspace }}:/ws --workdir=/ws \
38
+ quay.io/pypa/manylinux_2_28_aarch64 \
39
+ bash -exc '\
40
+ echo $PATH && \
41
+ curl -L https://sh.rustup.rs > rustup-init.sh && \
42
+ sh rustup-init.sh -y && \
43
+ yum -y install perl-IPC-Cmd && \
44
+ yum -y install openssl-devel && \
45
+ source $HOME/.cargo/env && \
46
+ rustup target add aarch64-unknown-linux-musl && \
47
+ rm -rf venv && \
48
+ export PATH=/opt/python/cp310-cp310/bin/:$PATH && \
49
+ export PATH=/opt/python/cp39-cp39/bin/:$PATH && \
50
+ export PATH=/opt/python/cp38-cp38/bin/:$PATH && \
51
+ /opt/python/cp38-cp38/bin/python -m venv venv && \
52
+ if [ ! -f "activate" ]; then ln -s venv/bin/activate; fi && \
53
+ . ./activate && \
54
+ pip install maturin && \
55
+ CC=gcc maturin build -m wheel/Cargo.toml --release --strip --manylinux 2_28 --features=openssl \
56
+ '
57
+
58
+ - name: Upload artifacts
59
+ uses: actions/upload-artifact@v4
60
+ with:
61
+ name: wheels
62
+ path: target/wheels/
63
+
64
+ - name: Install Twine
65
+ run: |
66
+ if [ ! -f "venv" ]; then sudo rm -rf venv; fi
67
+ sudo apt-get install python3-venv python3-pip -y
68
+ python3 -m venv venv
69
+ if [ ! -f "activate" ]; then ln -s venv/bin/activate; fi
70
+ . ./activate
71
+ pip install setuptools_rust
72
+ pip install twine
73
+
74
+ - name: publish (PyPi)
75
+ if: startsWith(github.event.ref, 'refs/tags')
76
+ env:
77
+ TWINE_USERNAME: __token__
78
+ TWINE_NON_INTERACTIVE: 1
79
+ TWINE_PASSWORD: ${{ secrets.pypi_password }}
80
+ run: |
81
+ . ./activate
82
+ twine upload --non-interactive --skip-existing --verbose 'target/wheels/*'
83
+
84
+ - name: Clean up AMR64
85
+ if: startsWith(matrix.os, 'ARM64')
86
+ run: |
87
+ rm -rf venv
88
+ rm -rf dist
@@ -0,0 +1,44 @@
1
+ name: Build rust crate
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main1
7
+ - dev
8
+ tags:
9
+ - "**"
10
+ pull_request:
11
+ branches:
12
+ - "**"
13
+
14
+ jobs:
15
+ build_crate:
16
+ name: Crate
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ fail-fast: false
20
+
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ with:
24
+ fetch-depth: 0
25
+
26
+ - name: Set up rusts
27
+ uses: dtolnay/rust-toolchain@stable
28
+
29
+ - name: fmt (stable)
30
+ run: cargo +stable fmt -- --files-with-diff --check
31
+ - name: clippy (stable)
32
+ run: cargo +stable clippy
33
+ - name: tests
34
+ run: cargo test && cargo test --release
35
+ - name: build
36
+ run: cargo build --release
37
+ - name: dry-run of `cargo publish`
38
+ run: cargo publish --dry-run
39
+
40
+ - name: publish to crates.io if tagged
41
+ if: startsWith(github.event.ref, 'refs/tags')
42
+ env:
43
+ CARGO_REGISTRY_TOKEN: ${{ secrets.cargo_registry_token }}
44
+ run: cargo publish
@@ -0,0 +1,110 @@
1
+ name: Build M1 Wheels
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main1
7
+ - dev
8
+ tags:
9
+ - "**"
10
+ pull_request:
11
+ branches:
12
+ - "**"
13
+
14
+ concurrency:
15
+ group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}--${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
16
+ cancel-in-progress: true
17
+
18
+ permissions:
19
+ contents: read
20
+ id-token: write
21
+
22
+ jobs:
23
+ build_wheels:
24
+ name: Build wheel on Mac M1
25
+ runs-on: macos-14
26
+ strategy:
27
+ fail-fast: false
28
+
29
+ steps:
30
+ - uses: Chik-Network/actions/clean-workspace@main
31
+
32
+ - name: Checkout code
33
+ uses: actions/checkout@v4
34
+ with:
35
+ fetch-depth: 0
36
+
37
+ - name: Install python
38
+ uses: Chik-Network/actions/setup-python@main
39
+ with:
40
+ python-version: "3.10"
41
+
42
+ - name: Set up rust
43
+ run: |
44
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rust.sh
45
+ sh rust.sh -y
46
+
47
+ - name: Build m1 wheels
48
+ env:
49
+ MACOSX_DEPLOYMENT_TARGET: "13.0"
50
+ run: |
51
+ python3 -m venv venv
52
+ . ./venv/bin/activate
53
+ export PATH=~/.cargo/bin:$PATH
54
+ pip install maturin
55
+ maturin build -m wheel/Cargo.toml -i python --release --strip --features=openssl
56
+
57
+ - name: Install clvk_rs wheel
58
+ run: |
59
+ . ./venv/bin/activate
60
+ ls ./target/wheels/
61
+ pip install ./target/wheels/clvk_rs*.whl
62
+
63
+ - name: Install other wheels
64
+ run: |
65
+ . ./venv/bin/activate
66
+ python -m pip install pytest
67
+ python -m pip install blspy
68
+
69
+ - name: Run tests from wheel
70
+ run: |
71
+ . ./venv/bin/activate
72
+ cd wheel/python
73
+ pytest --import-mode append tests
74
+ # we use `append` because otherwise the `clvk_rs` source is added
75
+ # to `sys.path` and it uses that instead of the wheel (and so
76
+ # ignoring `clvk_rs.so`, which is pretty important)
77
+
78
+ - name: Upload artifacts
79
+ uses: actions/upload-artifact@v4
80
+ with:
81
+ name: wheels
82
+ path: ./target/wheels/
83
+
84
+ upload:
85
+ name: Upload to PyPI
86
+ runs-on: ubuntu-latest
87
+ needs: build_wheels
88
+ steps:
89
+ - name: Checkout code
90
+ uses: actions/checkout@v4
91
+ with:
92
+ fetch-depth: 0
93
+
94
+ - name: Install python
95
+ uses: Chik-Network/actions/setup-python@main
96
+ with:
97
+ python-version: "3.10"
98
+
99
+ - name: Download artifacts
100
+ uses: actions/download-artifact@v4
101
+ with:
102
+ name: wheels
103
+ path: ./target/wheels/
104
+
105
+ - name: publish (PyPi)
106
+ if: startsWith(github.event.ref, 'refs/tags')
107
+ uses: pypa/gh-action-pypi-publish@release/v1
108
+ with:
109
+ packages-dir: target/wheels/
110
+ skip-existing: true
@@ -0,0 +1,51 @@
1
+ name: Build npm package
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main1
7
+ - dev
8
+ tags:
9
+ - "**"
10
+ pull_request:
11
+ branches:
12
+ - "**"
13
+
14
+ jobs:
15
+ build_crate:
16
+ name: NPM
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ fail-fast: false
20
+
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ with:
24
+ fetch-depth: 0
25
+
26
+ - name: install wasm-pack
27
+ run: cargo install wasm-pack
28
+
29
+ - name: wasm-pack build and pack
30
+ run: wasm-pack build --release --target=nodejs wasm && wasm-pack pack wasm
31
+
32
+ - name: Setup Node 18.x
33
+ uses: actions/setup-node@v4
34
+ with:
35
+ node-version: "18.x"
36
+
37
+ - name: Test wasm
38
+ run: node wasm/tests/index.js
39
+
40
+ - name: Upload npm pkg artifacts
41
+ uses: actions/upload-artifact@v4
42
+ with:
43
+ name: npm-pkg
44
+ path: ./wasm/pkg/clvk_wasm-*.tgz
45
+
46
+ - name: publish to npmjs.com if tagged
47
+ if: startsWith(github.event.ref, 'refs/tags')
48
+ uses: JS-DevTools/npm-publish@v3
49
+ with:
50
+ token: ${{ secrets.node_auth_token }}
51
+ package: wasm/pkg/package.json
@@ -0,0 +1,284 @@
1
+ name: Build Mac, Linux, and Windows wheels
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main1
7
+ - dev
8
+ tags:
9
+ - "**"
10
+ pull_request:
11
+ branches:
12
+ - "**"
13
+
14
+ permissions:
15
+ contents: read
16
+ id-token: write
17
+
18
+ jobs:
19
+ build_wheels:
20
+ name: Wheel on ${{ matrix.os }} py-${{ matrix.python }}
21
+ runs-on: ${{ matrix.os }}
22
+ strategy:
23
+ fail-fast: false
24
+ matrix:
25
+ os: [macos-15-intel, ubuntu-latest, windows-latest]
26
+ python: [3.8]
27
+
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ with:
31
+ fetch-depth: 0
32
+
33
+ - uses: chik-network/actions/setup-python@main
34
+ name: Install Python ${{ matrix.python }}
35
+ with:
36
+ python-version: ${{ matrix.python }}
37
+
38
+ - name: Update pip
39
+ run: |
40
+ python -m pip install --upgrade pip
41
+
42
+ - name: Set up rust
43
+ uses: dtolnay/rust-toolchain@stable
44
+
45
+ - name: Install dependencies
46
+ run: |
47
+ python -m pip install maturin
48
+
49
+ - name: Build MacOs with maturin on Python ${{ matrix.python }}
50
+ if: startsWith(matrix.os, 'macos')
51
+ env:
52
+ MACOSX_DEPLOYMENT_TARGET: "13.0"
53
+ run: |
54
+ python -m venv venv
55
+ ln -s venv/bin/activate
56
+ . ./activate
57
+ maturin build -m wheel/Cargo.toml --sdist -i python --release --strip --features=openssl
58
+
59
+ - name: Build Linux in manylinux_2_28 with maturin on Python ${{ matrix.python }}
60
+ if: startsWith(matrix.os, 'ubuntu')
61
+ run: |
62
+ docker run --rm \
63
+ -v ${{ github.workspace }}:/ws --workdir=/ws \
64
+ quay.io/pypa/manylinux_2_28_x86_64:2025.09.01-1 \
65
+ bash -exc '\
66
+ curl -L https://sh.rustup.rs > rustup-init.sh && \
67
+ sh rustup-init.sh -y && \
68
+ yum -y install perl-IPC-Cmd && \
69
+ yum -y --disablerepo=epel install openssl-devel && \
70
+ source $HOME/.cargo/env && \
71
+ rustup target add x86_64-unknown-linux-musl && \
72
+ PY_VERSION=${{ matrix.python }}
73
+ PY_VERSION=${PY_VERSION/.} && \
74
+ echo "Python version with dot removed is $PY_VERSION" && \
75
+ if [ "$PY_VERSION" = "38" ]; \
76
+ then export SCND_VERSION="${PY_VERSION}m"; \
77
+ else export SCND_VERSION="$PY_VERSION"; fi && \
78
+ echo "Exporting path /opt/python/cp$PY_VERSION-cp$SCND_VERSION/bin" && \
79
+ export PATH=/opt/python/cp$PY_VERSION-cp$SCND_VERSION/bin/:$PATH && \
80
+ /opt/python/cp38-cp38/bin/python -m venv /venv && \
81
+ . /venv/bin/activate && \
82
+ pip install --upgrade pip && \
83
+ pip install maturin && \
84
+ CC=gcc maturin build -m wheel/Cargo.toml --release --strip --manylinux 2_28 --features=openssl --sdist \
85
+ '
86
+ python -m venv venv
87
+ ln -s venv/bin/activate
88
+
89
+ - name: Build Windows with maturin on Python ${{ matrix.python }}
90
+ if: startsWith(matrix.os, 'windows')
91
+ run: |
92
+ python -m venv venv
93
+ . .\venv\Scripts\Activate.ps1
94
+ ln -s venv\Scripts\Activate.ps1 activate
95
+ maturin build -m wheel/Cargo.toml -i python --release --strip
96
+ # this will install into the venv
97
+ # it'd be better to use the wheel, but I can't figure out how to do that
98
+ # TODO: figure this out
99
+ # this does NOT work: pip install target/wheels/clvk_rs-*.whl
100
+ maturin develop --release -m wheel/Cargo.toml
101
+ # the line above also doesn't seem to work
102
+
103
+ - name: Install clvk_rs wheel
104
+ if: ${{ !startsWith(matrix.os, 'windows') }}
105
+ run: |
106
+ . ./activate
107
+ ls target/wheels/
108
+ # this mess puts the name of the `.whl` file into `$WHEEL_PATH`
109
+ # remove the dot, use the `glob` lib to grab the file from the directory
110
+ WHEEL_PATH=$(echo ${{ matrix.python }} | python -c 'DOTLESS=input().replace(".", ""); import glob; print(" ".join(glob.glob("target/wheels/clvk_rs-*-cp%s-abi3-*.whl" % DOTLESS)))' )
111
+ echo ${WHEEL_PATH}
112
+ pip install ${WHEEL_PATH}
113
+
114
+ - name: Install other wheels
115
+ run: |
116
+ . ./activate
117
+ python -m pip install pytest
118
+ python -m pip install blspy
119
+
120
+ - name: Run tests from wheel
121
+ run: |
122
+ . ./activate
123
+ cd wheel/python
124
+ pytest --import-mode append tests
125
+ # we use `append` because otherwise the `clvk_rs` source is added
126
+ # to `sys.path` and it uses that instead of the wheel (and so
127
+ # ignoring `clvk_rs.so`, which is pretty important)
128
+
129
+ - name: Upload artifacts
130
+ uses: actions/upload-artifact@v4
131
+ with:
132
+ name: wheels-${{ matrix.os }}-py-${{ matrix.python }}
133
+ path: ./target/wheels/
134
+
135
+ upload:
136
+ name: Upload to PyPI
137
+ runs-on: ubuntu-latest
138
+ needs: build_wheels
139
+ steps:
140
+ - name: Checkout code
141
+ uses: actions/checkout@v4
142
+ with:
143
+ fetch-depth: 0
144
+
145
+ - name: Install python
146
+ uses: Chik-Network/actions/setup-python@main
147
+ with:
148
+ python-version: "3.10"
149
+
150
+ - name: Download artifacts
151
+ uses: actions/download-artifact@v4
152
+ with:
153
+ merge-multiple: true
154
+ pattern: wheels-*
155
+ path: ./target/wheels/
156
+
157
+ - name: publish (PyPi)
158
+ if: startsWith(github.event.ref, 'refs/tags')
159
+ uses: pypa/gh-action-pypi-publish@release/v1
160
+ with:
161
+ packages-dir: target/wheels/
162
+ skip-existing: true
163
+
164
+ checks:
165
+ runs-on: ubuntu-22.04
166
+ name: Checks
167
+ steps:
168
+ - uses: actions/checkout@v4
169
+ with:
170
+ fetch-depth: 1
171
+ - name: Install rust
172
+ uses: dtolnay/rust-toolchain@1.92.0
173
+ with:
174
+ components: rustfmt, clippy
175
+ - name: Clippy
176
+ run: cargo clippy --all-targets --workspace -- -D warnings
177
+ - name: fmt
178
+ run: cargo fmt --all -- --files-with-diff --check
179
+
180
+ # leaving out Windows fuzzing for now though it seems supported
181
+ # https://llvm.org/docs/LibFuzzer.html#q-does-libfuzzer-support-windows
182
+ fuzz_targets:
183
+ name: Run fuzz targets
184
+ runs-on: ${{ matrix.os }}
185
+ strategy:
186
+ fail-fast: false
187
+ matrix:
188
+ os: [macos-15-intel, ubuntu-latest]
189
+ python: [3.8]
190
+ steps:
191
+ - uses: actions/checkout@v4
192
+ with:
193
+ fetch-depth: 1
194
+ - name: Install rust
195
+ uses: dtolnay/rust-toolchain@master
196
+ with:
197
+ toolchain: nightly
198
+ components: rustfmt, clippy
199
+ - name: fmt
200
+ run: |
201
+ cd fuzz
202
+ cargo fmt -- --files-with-diff --check
203
+ - name: clippy
204
+ run: |
205
+ cd fuzz
206
+ cargo clippy
207
+ - name: cargo-fuzz
208
+ run: cargo install cargo-fuzz
209
+ # TODO: it would be nice to save and restore the corpus between runs
210
+ - name: build corpus
211
+ run: |
212
+ cd tools
213
+ cargo run --bin generate-fuzz-corpus
214
+ - name: build
215
+ run: cargo fuzz list | xargs -I "%" sh -c "cargo fuzz run % -- -max_total_time=30 || exit 255"
216
+
217
+ unit_tests:
218
+ name: Unit tests
219
+ runs-on: ${{ matrix.os }}
220
+ strategy:
221
+ fail-fast: false
222
+ matrix:
223
+ os: [macos-15-intel, ubuntu-latest, windows-latest]
224
+ python: [3.8]
225
+ steps:
226
+ - uses: actions/checkout@v4
227
+ with:
228
+ fetch-depth: 1
229
+ - name: Install rust
230
+ uses: dtolnay/rust-toolchain@stable
231
+ with:
232
+ components: rustfmt, clippy
233
+
234
+ - name: build
235
+ run: cargo build --workspace --exclude clvk_rs-fuzz
236
+
237
+ - name: cargo test (default)
238
+ run: cargo test && cargo test --release
239
+
240
+ - name: cargo test (allocator-debug)
241
+ run: cargo test --features allocator-debug && cargo test --features allocator-debug --release
242
+
243
+ - name: cargo test (counters)
244
+ run: cargo test --features=counters && cargo test --features=counters --release
245
+
246
+ - name: cargo test (pre-eval)
247
+ run: cargo test --features=pre-eval && cargo test --features=pre-eval --release
248
+
249
+ - name: cargo test (pre-eval and counters)
250
+ run: cargo test --features=pre-eval,counters && cargo test --features=pre-eval,counters --release
251
+
252
+ coverage:
253
+ runs-on: ubuntu-latest
254
+ steps:
255
+ - uses: actions/checkout@v4
256
+ - uses: dtolnay/rust-toolchain@stable
257
+ - name: Run for coverage
258
+ run: |
259
+ sudo apt-get update
260
+ sudo apt-get install lcov -y
261
+ rustup component add llvm-tools-preview
262
+ export CARGOFLAGS="-j $(nproc)"
263
+ cargo install grcov
264
+ export RUSTFLAGS="-Cinstrument-coverage"
265
+ export LLVM_PROFILE_FILE=$(pwd)/target/clvk_rs-%p-%m.profraw
266
+ export CARGO_TARGET_DIR=$(pwd)/target
267
+ export RUST_TEST_THREADS=$(nproc)
268
+ cargo test --release --workspace
269
+ python -m venv venv
270
+ source venv/bin/activate
271
+ pip install colorama maturin pytest pytest-cov
272
+ maturin develop --release -m wheel/Cargo.toml --features=openssl
273
+ (cd tests && python generate-programs.py && python run-programs.py) || true
274
+ pytest wheel/python/tests --cov=clvk_rs --cov-report lcov:py_cov.info --cov-branch
275
+ grcov . --binary-path target -s . --branch --ignore-not-existing --ignore='*/.cargo/*' --ignore='target/*' -o pre_rust_cov.info
276
+ python -c 'with open("pre_rust_cov.info") as f: lines = [l for l in f if not (l.startswith("DA:") and int(l.split(",")[1].strip()) >= 2**63)]; open("rust_cov.info", "w").writelines(lines)'
277
+ lcov --add-tracefile rust_cov.info -a py_cov.info -o lcov.info
278
+ - name: Upload to Coveralls
279
+ uses: coverallsapp/github-action@v2
280
+ if: always()
281
+ env:
282
+ COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
283
+ with:
284
+ path-to-lcov: "./lcov.info"
@@ -0,0 +1,25 @@
1
+ # Generated by Cargo
2
+ # will have compiled files and executables
3
+ debug/
4
+ target/
5
+
6
+ # These are backup files generated by rustfmt
7
+ **/*.rs.bk
8
+
9
+ # MSVC Windows builds of rustc generate these, which store debugging information
10
+ *.pdb
11
+
12
+ # RustRover
13
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
14
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
15
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
16
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
17
+ .idea/
18
+
19
+ # python ignore
20
+ /venv
21
+ /.venv
22
+
23
+ # Node.js
24
+ /target
25
+ /node_modules
@@ -0,0 +1,4 @@
1
+ {
2
+ "useTabs": false,
3
+ "tabWidth": 2
4
+ }