57 Commits

Author SHA1 Message Date
Sydhds
1f859c0eff Secu/update dependencies 20251021 (#56)
* Update alloy-dyn-abi (to 1.4.1) && alloy-trie (to 0.9.1)

* Update clap dependency to 4.5.50

* Cargo update
2025-10-21 11:46:34 +02:00
Sydhds
d47719a093 Update Dockerfile + docker doc (#55) 2025-10-21 10:30:21 +02:00
Sydhds
894677563c Add AccountSlashed event in KarmaSC contract (#52)
* Add AccountSlashed event in KarmaSC contract
* Handle slash event in KarmaSCEventListener
2025-10-21 10:27:08 +02:00
Sydhds
85acaad8d2 Secu/update dependencies 20251017 (#54)
* Update alloy to version 1.0.41
* Update rustls to version 0.23.33
* Update tokio to version 1.48.0
2025-10-20 09:37:38 +02:00
Sydhds
4b037ca09a Update to official release of Zerokit 0.9.0 (#53) 2025-10-17 10:04:03 +02:00
Sydhds
07ea466b33 Update proto file with Tx 'estimated gas used' field (#51)
* Update proto file with Tx 'estimated gas used' field
* Update tx_counter according to tx gas quota
* Feature/user spam limit checks (#47)
  * Print proof generation error before sending it
  * Check user spam limit in grpc send_transaction endpoint
2025-10-15 10:57:03 +02:00
Sydhds
d60b93416e Osv scanner required dependencies updates (#50)
* Update tracing-subscriber to 0.3.20
* Update alloy dependency to 1.0.38
* Update tonic, rustls & zeroize dependencies
* Update clap to 4.5.49
* Update opentelemetry to 0.31.0
2025-10-14 15:05:18 +02:00
Sydhds
65f6d60b14 Add command line arg to disable grpc reflection (in production) (#48) 2025-10-13 16:23:59 +02:00
Sydhds
8be586ddfa Add initial code for handling multiple merkle tree in UserDB (#49)
* Add initial code for handling multiple merkle tree in UserDB
* Add unit test for multi tree
* Add test_new_multi_tree unit test
* Introduce UserDbConfig
2025-10-13 16:23:05 +02:00
Sydhds
e1c96b3ef7 Add more arg in command line arguments (#46) 2025-10-01 17:24:28 +02:00
Sydhds
b7967b85e8 Initial code to use Zerokit 0.9 + disable parallel feature (#36)
* Initial code to use Zerokit 0.9 + disable parallel feature

* Support IdSecret for user identity secret hash

* Fix clippy + bench

* Use PmTreeConfig builder

* Improve prover_bench perf

* Fix prover_bench 2nd assert

* Fix prover_bench 2nd assert 2

* Can now enable trace for bench prover_bench

* Use anyhow for error handling (+ error context) in prover_cli (#42)

* Use anyhow for error handling (+ error context) in prover_cli

* Cargo fmt pass

* Feature/feature/init user db ser de 2 (#45)

* Add user db serializer && deserializer init & re-use
2025-10-01 17:00:56 +02:00
Sydhds
55e7f6c3e2 Print an error if too many users are registered (#40) 2025-09-30 11:55:43 +02:00
Vinh Trịnh
ab032ec74b Use all best practice to squeeze a few more TPS out of Prover (#38) 2025-09-23 18:18:52 +07:00
Sydhds
3a56b92515 Add new benchmark (#35)
* Add new benchmark
* Add black_box
2025-09-04 08:42:42 +02:00
Sydhds
8ba18a5ded Update alloy dependencies (#34) 2025-08-29 10:22:15 +02:00
Sydhds
b2f142b0e5 Add initial rln sc register in registry_listener (#33)
* Add initial rln sc register in registry_listener
* Generic over alloy provider
* Fix prover mock startup
* Update handle_transfer_event documentation
2025-08-29 10:18:37 +02:00
Vinh Trịnh
eec2ae76e9 Add CI workflow, resolve clippy warning (#29)
* feat: resolve clippy warning, remove unuse deps, add ci workflow

* chore: add protoc install to CI

* chore: add foundry for test job

* chore: fix benchmark and add comparison

* chore: just run bench 1 time

* chore: try boa-dev/criterion-compare-action@v3

* chore: run all benchmark

* chore: rerun CI

* chore: only run prover_bench|generate_proof

* chore: use matrix strategy for each bench

* feat: add osv-scanner workflow

* chore: not add manually, ill use github UI

* chore: remove changes from Cargo.lock and all Cargo.toml files to avoid conflict with feature/revise_deps branch

* chore: resolve clippy module_inception

* chore: try no bench = false again

* chore: run cargo-udeps with --all-features flags

* chore: update default prover run command

* chore: lint fix

* chore: add osv-scanner.yml to CI workflow

* chore: try osv-scanner v2.2.2
2025-08-28 16:49:25 +07:00
sydhds
ae3b72a807 Add prover bench timing print 2025-08-25 11:45:16 +02:00
sydhds
2e86c528b8 Add env var for prover bench 2025-08-21 12:27:40 +02:00
Sydhds
9e82fc412e Improver prover bench name (#32) 2025-08-21 11:28:20 +02:00
Sydhds
8d937e62b2 Optimize release profile (#31) 2025-08-21 10:24:10 +02:00
Vinh Trịnh
f4a41073e4 Use exact zerokit version, move common deps to workspace, remove unuse deps to reduce build size 2025-08-18 16:41:17 +07:00
Vinh Trịnh
1d44d60df2 Extend testcase timeout to prevent panic, seperate anvil feature for testcase. (#28)
* chore: update unit test timeout to avoid panic, seperate anvil feature for testcase use foundry's anvil

* chore: add constant for the timeout number
2025-08-18 16:09:19 +07:00
Sydhds
11b06a440d Add zeroize support for private key (#27) 2025-08-13 15:15:25 +02:00
Sydhds
dc9d7947b3 Various clippy fixes (#26) 2025-08-13 14:53:35 +02:00
Vinh Trịnh
802872e155 Test and fix smart contract interaction (#24)
* chore: add karma_sc_test, karma_tiers_test, rln_sc_test script

* chore: fix rustls panic erro in prover_cli

* fix: update TierLimits's validate method to handle first tier's minKarma starts at 0

* chore: add NoTier

* chore: update Dockerfile

* chore: update rust version and tooling to build rocksdb deps

* fix: refactor smart contract interaction scripts, add error enum and remove unuse codes

* fix: add PRIVATE_KEY env variable, seperate specific error types, update Dockerfile, remove config.example.toml and use clap's default_value instead

* chore: update Dockerfile

* chore: remove unuse register_user_with_commitment and redundant KarmaSCInstance::from
2025-08-12 22:39:18 +07:00
Sydhds
400d0155a7 Update for new KarmaTiers smart contract (#23)
* Update for new KarmaTiers smart contract
* Add Anvil unit test for KarmaTiers SC
* Add unit test for KarmaSC
* Add rln sc unit test
2025-07-31 11:40:50 +02:00
Sydhds
b802b80664 Add throughput measurement for prover benchmark (#22)
* Add throughput measurement for prover benchmark
* Use rayon instead of tokio spawn blocking
* Add new user_db unit tests for user tx counterx
2025-07-23 12:26:34 +02:00
Sydhds
1ec9f1f48d Split unit tests in several new files (#21) 2025-07-21 16:36:54 +02:00
Sydhds
8b1540cf76 Add histogram metrics for channels (#20) 2025-07-16 14:41:32 +02:00
Sydhds
1e813c6710 Initial code for tracing + oltp (#19)
* Initial code for tracing + oltp
* Add tracing for all grpc endpoints + proof services + epoch service
* Trace result and errors for grpc endpoints
2025-07-16 11:33:43 +02:00
sydhds
9cdac9c184 Do not stop if user is already registered (when using --mock-user) 2025-07-16 09:34:44 +02:00
Sydhds
471dd9a24f Add initial metrics for Prometheus (#18)
* Add metrics for Prometheus
2025-07-15 11:51:27 +02:00
sydhds
6a7bb3ac0e Update .gitignore 2025-07-11 09:58:44 +02:00
Sydhds
e5f88726ae Improve test_notify unit test (more reliable) (#17)
* Improve test_notify unit test (more reliable)
2025-07-11 09:57:38 +02:00
Sydhds
88678afdb2 Initial attempt to benchmark proof generation using the prover (#16)
* Initial attempt to benchmark proof generation using the prover
2025-07-09 15:02:07 +02:00
Sydhds
cdafbadac3 Add end to end grpc test (#15)
* Add end to end grpc test
2025-07-07 15:53:46 +02:00
Sydhds
d33c1016cd Update && enable unit test: test_user_spamming_same_signal (#13)
* Update && enable unit test: test_user_spamming_same_signal
* Add debug_assert in epoch_counters_operands
* Write merkle tree inside db transaction
* Add note about error handling in RegistryListener
* Remove user if it cannot register it to smart contract
* Remove user in db if we cannot add to SC
* Add support for config file
2025-07-04 11:41:36 +02:00
Sydhds
cac235dbcc Add TierLimits unit tests (#12)
* Add TierLimits unit tests
2025-07-01 10:11:08 +02:00
Sydhds
9f4027ed2b Add UserRocksDb - initial attemp to rewrite UserDb with persistent st… (#10)
* Use RocksDb + PmTree for UserDb persistent storage
2025-06-27 15:41:41 +02:00
sydhds
cbb058d330 Can pass arguments directly to docker 2025-06-16 14:48:08 +02:00
sydhds
8e9e6c4b9d Fix tier limits print when --mock-user is enabled 2025-06-13 18:08:50 +02:00
Sydhds
834fa090d2 Fix unit tests compilation (#9)
* Fix unit test: test_set_tier_limits
* Fix unit test: test_user_register
* Fix unit test: test_update_on_epoch_changes
2025-06-13 18:04:12 +02:00
Sydhds
1059b87572 Add Dockerfile 2025-06-13 16:54:22 +02:00
Sydhds
409cdcb651 Move all code related to smart contracts into lib smart_contract (#7)
* Move all code related to smart contracts into lib smart_contract
* Can start the prover with mocked smart contract
* Add KarmaTier integration
* Filter & validate initial tier limits
2025-06-13 12:04:10 +02:00
Sydhds
d8da43e535 Update to zerokit v0.8.0 (#6)
* Update to zerokit v0.8.0
* Switch to OptimalMerkleTree implementation (was pmTree)
* Update various crates
2025-06-10 10:53:26 +02:00
Sydhds
68fbc154bd Add rln sc in grpc register_user (#5)
* Add rln sc in grpc register_user
* Add app argument for RLN Smart contract address
2025-06-06 15:07:10 +02:00
Sydhds
632cf67142 Update RegistryListener to interact with Karma smart contract (#4)
* Update RegistryListener to interact with Karma smart contract
* Add karma sc instance in grpc service
2025-06-06 09:22:19 +02:00
Sydhds
7525c8c226 Add ProofGenerationData structure (#3)
* Add ProofGenerationData structure
* Use shared merkle tree
* Add unit tests for proof service
2025-06-05 10:03:31 +02:00
Sydhds
194ce101fc Add initial code for user db (user reg + tx counter + tier info) (#2)
* Add initial code for user db (user reg + tx counter + tier info)
* Switch to scc hashmap (+ updated benchmark)
* Add KSC into UserDB
* Start user db service in prover main
* Separate between user db service & user db
* Add set tier limits grpc endpoint
* Set tier limits unit test
* Use derive_more
2025-05-30 15:14:09 +02:00