Commit Graph

426 Commits

Author SHA1 Message Date
sripwoud
6deffe77f9 chore: bump lockfile 2024-08-08 22:20:49 +02:00
Iskander
25b0cd8bfc chore: lift up halo2-* package folders (#444)
* chore: merge staging (#473)

* dev sripwoud (#472)

* fix(ui): check env var def depending client/server side

* refactor(ui): remove `force-dynamic` for server route

* chore(ui): remove TODO

* chore(ui): use `next/legacy/image`

* fix(ui): force asset/nft/punk page to be dynamic

* chore(ui): custom next config instead of soft linking wasm

* upadte cond

* fix: set ARG in Dockerfile

* fix

* refactor

* fix: revert change on wasm file soft link

* chore: restructure the whole halo2 pkgs structure

* fix: cargo lint

* fix: lint

* fix: cargo lint fix

* fix: cargo lint fix

* fix: package.json

* fix: delete .env file

---------

Co-authored-by: sripwoud <me@sripwoud.xyz>
2024-08-07 22:42:08 +02:00
sripwoud
07a908f588 docs: update README.md and .envrc.example 2024-08-07 13:03:56 +02:00
sripwoud
8d2ad7aa64 chore: merge staging (#473) 2024-08-07 13:03:22 +02:00
sripwoud
55e4d2e3e2 chore: add TODO comment 2024-08-03 21:15:42 +02:00
sripwoud
7319796951 chore: merge staging (#465)
* feat(discord-bot): integrate with spartan-ecdsa (#462)

* chore: remove uneeded deps/files

* chore: fix deps

* feat: use en vars for VERIFICATION_CHANNEL_ID and VERIFIED_ROLE_ID

* refactor: change formatting of messages sent by bot

link to channels
use different font style

* chore: remove unused deps

* feat: verify spartan proof with discord bot

* fix: bump @types/node

Need > 20 to have fetch typings

* chore: update comment

* ci: remove debug step

* docs: update .env.example

* docs: update discord/bot/README

* refactor: update error message if missing env var

* fix(ui): do not pre render /api/verify route

* refactor: use verifier object to load wasm async

* fix: link wasm files to `server/static`

webpack 5 breaks dynamic import of wasm
https://github.com/vercel/next.js/issues/25852

* ci: link wasm files to `.next/server/static` in Dockerfile

* chore: debug

* fix(ui): set CORS headers

* refactor: add info logs

* ci: refactor Dockerfile and fly toml

* fix: remove remaining merge hints

* feat: restrict verification request to discord bot origin (#466)

* refactor: add info logs

* wip

* fix  import

* refactor: remove wallet connect id from fly config

Set already in Dockerfile

* ci: refactor setting of env vars in Dockerfile and fly configs (#469)

ci: update dockerfiles and fly env vars
2024-08-03 21:07:31 +02:00
sripwoud
ae38ad7189 chore: fix circular deps (#467)
* chore(ui): fix circular deps

* chore(discord-bot): fix circular deps

* chore(query-api): fix circular deps

* chore: remove `madge` dev dep

* chore: revert change in next config
2024-08-02 15:53:59 +02:00
sripwoud
82d7c5ef28 ci: remove debug step in coverage job 2024-08-02 15:52:04 +02:00
sripwoud
38cb56d1f5 ci: swallow error if no coverage file found 2024-08-02 15:50:15 +02:00
sripwoud
65bd2cf031 ci: fix discord bot deployment (#461)
* ci: fix discord-bot deploy (#460)

* chore: add target to dockerignore

* refactor discord bot dockerfile

* chore: add url for discord bot environments
2024-07-29 18:08:39 +02:00
sripwoud
885959fa9d docs: update README.md (#459) 2024-07-26 18:10:22 +02:00
sripwoud
2c01b3ec80 chore: use lefthook to manage git hooks (#458)
* chore: hide biome config file

* chore: update dprint and biome config

* chore: replace lintstaged and husky by lefthook

* chore: update knip config

* chore: cleanup config files in `ui`

* fix: use dprint action in format workflow step
2024-07-26 17:59:07 +02:00
sripwoud
4c1d809a90 ci: run test coverage in test-rs job (#455)
* ci: run coverage in test-rs job

* ci: upload to coveralls in separate job

* chore: format

* ci: alway run coverage job

* ci: always run `fmt` job

* ci: always run `deps` job

* test: update err message

* ci: exclude halo2-secp256k1-wasm from tests

taking too long

* ci: allow empty report file for coveralls

* ci: get dynamically list of coverage files

* ci: checkout in coveralls job

* ci: exclude halo2wrong-ecdsa from ci tests check

* chore: debug ci

* ci: update coveralls base path input
2024-07-16 17:44:50 +02:00
sripwoud
362c681420 chore(contracts): update oz deps 2024-07-16 15:13:27 +02:00
sripwoud
00424ec7a2 test: fix cli tests error message casing 2024-07-16 14:29:20 +02:00
Iskander
9dcb598908 feat: implement Binary Merkle Tree Halo2 Gadget (#442)
* feat: (wip) impl merkle tree halo2

* feat: (wip) binary merkle tree wasm lib

* feat: binary merkle tree halo2 wasm lib

* fix: lint issue

* feat: merkle tree halo2 chip fn

* fix: rename variables in the verify chip

* fix: renaming gedget and fixing linting

* chore: format

---------

Co-authored-by: sripwoud <me@sripwoud.xyz>
2024-07-16 11:43:42 +02:00
sripwoud
d44779370f fix: do use biome or turbo for fmt script 2024-07-16 11:12:18 +02:00
sripwoud
0245d64b3d chore: merge staging (#454)
* refactor: use `dprint` for formatting (#446)

* ci: bump actions versions

* chore: bump node version

* chore: format with `dprint`

* chore: exclude contracts/lib from fmt, update lintstaged cmd

* ci: update node/pnpm versions

* ci: update actions versions in test workflow

* refactor GH worfklows (#447)

* ci: update actions versions in test workflow

* refactor gh workflows

* fix: bump Cargo.lock

* ci: optimize test workflow (#448)

* ci: optimize test workflow

* ci: merge test with static-analsysi workflow

* chore: rename workflow file

* ci: fix typo

* ci: fix

* ci: fix

* ci: exclude ui from jts modified files

* fix(ci): add changed-files step id

* ci: fix node & pnpm versions

* ci: fix node action input name

* fix: use checkout action in fmt job

* fix: use checkout action in test-node job

* ci: fix cache-hit check

* ci: use actions/cache/restore

* ci: update node/pnpm cache path

* ci: install rustfmt component

* ci: hoist shamefully deps

easier to manage cache of node_modules that way

* ci: do not use cache of `deps`job for test-node job

* chore: delete forge lib

* forge install: openzeppelin-contracts

v5.0.2

* forge install: forge-std

v1.9.1

* fix(contracts): define remappings

* ci: fix output name
2024-07-15 14:35:51 +02:00
sripwoud
57c220c514 chore: update tool-versions and lock file 2024-07-04 16:20:46 +02:00
sripwoud
8813000348 Update README.md 2024-06-26 11:07:30 +02:00
Iskander
f358849ae5 feat(halo2): verify efficiently ECDSA sig + wasm (#437)
* feat: prove the recovered_pk equals to actual_pk

* fix: using anyhow for error handling and resolving warns

* fix: styling the imports

* fix: remove unneeded println

* feat: implementing a wasm wrapper for the halo2 circuit

* feat: add anonklub proof struct

* feat: converting eff_ecdsa into a genaric version

* feat: wip initializing T and U as public inputs

* feat: wip wasm part

* feat: set T and U as public inputs

* feat: get T and U as public instanaces with F encoding

* feat: wip wasm lib

* feat: impl wasm crate for integrating with the browser

* feat: return bool in verify

* feat: overriding verify in halo2_wasm

* feat: verify halo2 proof successfully

* fix: trying to have the same Y point in T and U

* fix: wip in fixing reading public inputs

* feat: finish verifying eff ecdsa off-chain

* chore: optimize serialize instances
2024-06-26 10:48:40 +02:00
Iskander
de4ffe4103 feat(halo2): implement efficient pubkey recovery (#435)
* feat: prove the recovered_pk equals to actual_pk

* fix: using anyhow for error handling and resolving warns

* fix: styling the imports

* fix: remove unneeded println
2024-05-21 19:48:13 +00:00
iskander
a500bc78e6 feat(halo2): recover pubkey "efficiently" (#432)
https://personaelabs.org/posts/efficient-ecdsa-1/
https://personaelabs.org/posts/spartan-ecdsa/

* feat: halo2lib secp256k1 recover pk

* fix: resolve cargo clippy wans
2024-05-02 14:28:15 +00:00
sripwoud
012af29110 chore: allow unused type param for ecc_chip (#433) 2024-04-30 11:58:50 +00:00
sripwoud
f2b4fbeb56 chore: update .tool-versions 2024-04-30 13:10:55 +02:00
iskander
3813ee2073 feat(halo2): implement ecdsa signature verification (#419) 2024-04-23 18:43:31 +00:00
sripwoud
c3b8f4e794 fix(ui): verify anonklub proofs (#429) (#430)
* refactor: load proof text file as ArrayBuffer

* refactor(ui): shorten hooks imports

* fix(ui): add :use client" statements

* fix: instantiate JsonFileInput with Proof.ANONSET

* fix: call function returned by higher order function `useFile` hook

* refactor: extract ellipsify, download/copy file to utils and hooks

* chore: download proof as binary file

* fix: upload proof as binary file

* chore: lint

* refactor: rename `FileType` to `File`, `ProofTxt` to `ProofBin`
2024-04-20 13:47:54 +02:00
sripwoud
5db6078685 chore(spartan-ecdsa): fix sapir imports (#426) 2024-04-16 14:13:52 +00:00
sripwoud
4900818ab7 Version Packages (#424)
* Version Packages

* do not bump deps in ui and circom

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@anonklub/merkle-tree-worker@1.1.4 @anonklub/query@1.2.2 @anonklub/spartan-ecdsa-worker@1.1.2 @anonklub/proof@2.1.2
2024-03-31 19:34:58 +00:00
sripwoud
94eac87e5c chore: replace prettier and eslint by biome (#422)
* chore: replace `prettier` and `eslint` by `biome` (#421)

* chore: replace `prettier` and `eslint` by `biome`

* chore: lint

* changeset
2024-03-30 22:15:54 +00:00
sripwoud
54ae17a914 chore: improve lint-staged rules (#418)
- Include `rustfmt`
- Include `tsc`: unlike running `pnpm typecheck` after `lint-staged`,
- this will check only staged files
2024-03-18 15:31:08 +01:00
i
8f519577af Rust Test Coverage (#414)
* feat: adding halo2 axiom scaffold

* feat: starting on ecdsa

* feat: starting on ecdsa

* feat: starting on ecdsa cont.

* feat: adding halo2wrong ecdsa verison circuit wip

* fix: remove testing json set

* test: wriing a failed test for testing ECDSA chip verification

* fix: clippy warnings fixings

* feat: adding CI github actions for test coverage

* feat: adding inatalltion readme

* fix: lint issues

* fix: lint issues

* fix: undo rust change

* fix: resolve requested changes and rebase

* fix: remove repeated halo2-ecdsa crate

* chore: rename some workflow titles
2024-03-18 15:29:58 +01:00
i
f716552d46 feat: implement ECDSA Halo2 Circuit (#403)
* feat: adding halo2 axiom scaffold

* feat: starting on ecdsa

* feat: starting on ecdsa

* feat: starting on ecdsa cont.

* feat: adding halo2wrong ecdsa verison circuit wip

* fix: remove testing json set

* test: wriing a failed test for testing ECDSA chip verification

* fix: clippy warnings fixings

* fix: prettier issue in cli/readme.md

---------

Co-authored-by: sripwoud <me@sripwoud.xyz>
2024-03-18 11:11:28 +00:00
sripwoud
8e922a5f7d fix(merkle-tree): fix unit test 2024-03-18 11:56:13 +01:00
i
022520e7a6 refactor: display address in missing leaf error message (#384)
* fix: resolving catch leaf is not found bug

* fix: linter errors

* feat: enhancing the error message

* chore: rebase with main

* fix: remove wrong js compiles scripts

* fix: lint issues
2024-03-14 20:33:32 +01:00
sripwoud
c1f103e46f refactor: use anyhow to handle errors (#417)
* refactor: define `hexlify` helper function

* chore: add "not implemented" prints for proof commands

* refactor: handle errors with `anyhow`

* refactor: do not make `WIDTH` a generic param of MerkleTree

* chore: update test.cargo script

* fix wasm target compilation

* chore: format

* test: add more unit tests
2024-03-14 17:46:29 +00:00
sripwoud
fbc253055c feat(akli): generate merkle root (#415)
* refactor: define `root` & `proof` `merkle` subcommands

* fix akli `merkle proof` command test

* refactor: extract merkle tree init/building in helper function

* feat:test(akli): generate merkle root

* fix import in test

* docs: udpate cli README:wq

* chore: format

* fix typo
2024-03-14 08:19:08 +01:00
sripwoud
ee04143c9b chore(ui): update docs link
Use docs.anonklub.xyz instead of anonklub.github.io
2024-03-13 11:25:07 +01:00
sripwoud
0de4a0f001 chore: update value of prod query-api url
Replace anonset.fly.dev to query.anonklub.xyz
2024-03-13 11:10:38 +01:00
sripwoud
570a46fd70 ocs: update links in README 2024-03-12 23:45:40 +01:00
sripwoud
cd3d782d7f chore: format 2024-03-12 23:33:45 +01:00
sripwoud
bbc6877919 chore: update deploy environments urls 2024-03-12 23:33:24 +01:00
sripwoud
60b5fd90f9 Update README.md (#413) 2024-03-12 21:58:34 +01:00
sripwoud
90cec48807 Update README.md 2024-03-12 18:51:19 +01:00
sripwoud
dad4815ab8 Add rust akli badge to readme 2024-03-12 18:48:20 +01:00
sripwoud
4fccbd0f52 chore: publish akli (#412)
* chore: edit crate metadata and bump version

* refactor: use forked anonklub-poseidon crate instead of git

* chore: add license to merkle-tree-wasm crate

* chore: update akli Cargo.toml

* chore: format
2024-03-12 17:34:54 +00:00
sripwoud
ad324b4118 feat(akli): build merkle proof from address and json file inputs (#379)
* add merkle command, parse json file

* feat(akli): build merkle tree from json and address inputs

* chore: format

* fix building hexstring from generate_merkle_proof result

* Update README

* chore: update Cargo.toml for publishing

* chore: remove CHANGELOG.md and content.txt

Relics from node cli

* chore: add exlude list to package section

* chore: add build task to justfile

* Add non wasm target generate_merkle_proof implementation

* chore: add pkgs/cli t default members list

* fix: insert `00` for emtpy leaves instead of `0x`

* refactor: use string interpolation instead of debug pretty printing

* test: add test for cli `merkle` command
2024-03-12 16:07:37 +00:00
sripwoud
7ffc1b819f test(cli): add more tests and mock query api requests (#402)
* test(cli): add more tests and mock query api requests

* fix query_ens test

use strum derive to customize how EnsVoteChoice is serialized

* chore:fix: trigger test workflow on changes in rs files

* chore: include cargo tests in repo wide `test` script

* chore: update test workflow trigger paths
2024-03-11 23:34:13 +01:00
sripwoud
3c8f4a9e0e fix(ui): get json data (#400)
* fix(ui): get json data

json() was already called

* Improve display in ScrollableJson component

Break lines
2024-03-11 16:57:07 +01:00
sripwoud
40ca31589b fix(ui): handle & render dune out of credits error (#397) 2024-03-07 22:04:58 +01:00