Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rln-v2 #204

Merged
merged 12 commits into from
Oct 3, 2023
Merged

feat: rln-v2 #204

merged 12 commits into from
Oct 3, 2023

Conversation

rymnc
Copy link
Contributor

@rymnc rymnc commented Aug 17, 2023

  • feat(rln-v2): update serde for rln-v2

  • fix: public tests that needed to append the new fields

  • circuit artifact updates

  • message_id range check validation

* feat(rln-v2): update serde for rln-v2

* fix: public tests that needed to append the new fields
@github-actions
Copy link

Benchmark for 3b6cb47

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1421.2±29.79ns 1422.9±28.33ns +0.12%
FullMerkleTree::get 0.0±0.00ns 0.0±0.00ns NaN%
FullMerkleTree::override_range 3.6±0.07µs 3.6±0.09µs 0.00%
FullMerkleTree::set 1423.2±39.15ns 1420.7±33.49ns -0.18%
OptimalMerkleTree::compute_root 1614.7±24.64ns 1611.5±33.57ns -0.20%
OptimalMerkleTree::delete 1610.3±24.41ns 1591.8±29.74ns -1.15%
OptimalMerkleTree::get 34.6±0.76ns 34.8±0.65ns +0.58%
OptimalMerkleTree::override_range 8.0±0.18µs 8.0±0.25µs 0.00%
OptimalMerkleTree::set 1607.8±40.95ns 1588.7±25.18ns -1.19%

@github-actions
Copy link

Benchmark for 3b6cb47

Click to view benchmark
Test Base PR %
Pmtree::compute_root 2.0±0.03ns 2.0±0.02ns 0.00%
Pmtree::get 555.0±14.17ns 551.2±5.43ns -0.68%
Pmtree::override_range 207.8±12.44µs 219.0±23.47µs +5.39%
Pmtree::set 79.1±0.56µs 79.3±0.42µs +0.25%
Pmtree:delete 79.4±0.16µs 79.9±0.16µs +0.63%

* feat: rename public, protocol and update tests to use rate_commitments

* fix: into()
@github-actions
Copy link

Benchmark for 0969049

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1242.8±0.69ns 1242.3±0.40ns -0.04%
FullMerkleTree::get 0.0±0.00ns 0.0±0.00ns NaN%
FullMerkleTree::override_range 3.1±0.00µs 3.1±0.00µs 0.00%
FullMerkleTree::set 1248.1±0.62ns 1249.5±0.97ns +0.11%
OptimalMerkleTree::compute_root 1391.0±1.49ns 1391.6±0.90ns +0.04%
OptimalMerkleTree::delete 1382.8±2.44ns 1381.5±0.66ns -0.09%
OptimalMerkleTree::get 29.7±0.02ns 33.8±0.02ns +13.80%
OptimalMerkleTree::override_range 7.0±0.01µs 7.0±0.01µs 0.00%
OptimalMerkleTree::set 1385.4±15.00ns 1385.7±10.63ns +0.02%

@github-actions
Copy link

Benchmark for 0969049

Click to view benchmark
Test Base PR %
Pmtree::compute_root 1.7±0.08ns 1.8±0.05ns +5.88%
Pmtree::get 510.2±28.80ns 514.7±14.50ns +0.88%
Pmtree::override_range 178.0±11.30µs 193.0±13.74µs +8.43%
Pmtree::set 74.8±4.92µs 77.3±2.38µs +3.34%
Pmtree:delete 72.8±3.80µs 73.5±2.05µs +0.96%

* feature: range check added

* fmt

* feature: message_id_range_check

* fix: corresponding change of types

* comments: function level

* fmt
@github-actions
Copy link

github-actions bot commented Sep 4, 2023

Benchmark for 2af1812

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1207.6±1.75ns 1210.3±2.03ns +0.22%
FullMerkleTree::get 0.1±0.00ns 0.1±0.00ns 0.00%
FullMerkleTree::override_range 3.0±0.00µs 3.0±0.00µs 0.00%
FullMerkleTree::set 1216.5±2.18ns 1212.2±7.11ns -0.35%
OptimalMerkleTree::compute_root 1397.9±14.30ns 1409.0±2.15ns +0.79%
OptimalMerkleTree::delete 1387.2±1.63ns 1390.9±2.39ns +0.27%
OptimalMerkleTree::get 30.5±0.06ns 31.5±0.07ns +3.28%
OptimalMerkleTree::override_range 7.0±0.01µs 7.1±0.05µs +1.43%
OptimalMerkleTree::set 1382.2±3.43ns 1388.2±4.01ns +0.43%

@github-actions
Copy link

github-actions bot commented Sep 4, 2023

Benchmark for 2af1812

Click to view benchmark
Test Base PR %
Pmtree::compute_root 2.0±0.01ns 2.0±0.02ns 0.00%
Pmtree::get 565.6±0.58ns 566.4±6.69ns +0.14%
Pmtree::override_range 207.0±9.91µs 204.7±7.80µs -1.11%
Pmtree::set 78.8±0.27µs 79.7±1.23µs +1.14%
Pmtree:delete 78.9±0.81µs 78.5±0.53µs -0.51%

* most changes

* fix

* fix protocol tests

* fmt

* ffi tests fix
@github-actions
Copy link

github-actions bot commented Sep 4, 2023

Benchmark for 22e0e2e

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1266.1±0.87ns 1242.9±0.59ns -1.83%
FullMerkleTree::get 0.0±0.00ns 0.0±0.00ns NaN%
FullMerkleTree::override_range 3.1±0.00µs 3.1±0.00µs 0.00%
FullMerkleTree::set 1261.8±0.59ns 1246.3±4.76ns -1.23%
OptimalMerkleTree::compute_root 1387.9±0.80ns 1389.6±1.05ns +0.12%
OptimalMerkleTree::delete 1381.8±1.38ns 1386.4±0.78ns +0.33%
OptimalMerkleTree::get 29.2±0.07ns 29.2±0.32ns 0.00%
OptimalMerkleTree::override_range 7.0±0.01µs 7.0±0.05µs 0.00%
OptimalMerkleTree::set 1384.2±1.31ns 1384.6±1.01ns +0.03%

@github-actions
Copy link

github-actions bot commented Sep 4, 2023

Benchmark for 22e0e2e

Click to view benchmark
Test Base PR %
Pmtree::compute_root 1.7±0.00ns 1.7±0.01ns 0.00%
Pmtree::get 466.8±0.33ns 472.0±0.37ns +1.11%
Pmtree::override_range 173.3±8.74µs 180.6±18.36µs +4.21%
Pmtree::set 65.6±0.72µs 65.7±0.17µs +0.15%
Pmtree:delete 65.6±0.07µs 65.8±0.16µs +0.30%

* feat(rln-v2): new artifacts, removed older ones

* wip: working branch

* fix: remove more refs to epoch + rln_identifier

* Updated serde in RLN proof verification

* Updated artifacts

* chore: update

* chore: update

* hardcoded test works

* fix: proof generation and verification
@rymnc rymnc self-assigned this Sep 30, 2023
@rymnc rymnc added the track:rln RLN Track - (Secure Messaging/Applied ZK), relay and applications label Sep 30, 2023
@github-actions
Copy link

Benchmark for daadf3a

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1241.9±0.78ns 1247.6±0.74ns +0.46%
FullMerkleTree::get 4.0±0.04ns 4.0±0.02ns 0.00%
FullMerkleTree::override_range 3.1±0.03µs 3.1±0.00µs 0.00%
FullMerkleTree::set 1243.2±0.71ns 1240.8±0.58ns -0.19%
OptimalMerkleTree::compute_root 1422.1±39.90ns 1418.2±4.16ns -0.27%
OptimalMerkleTree::delete 1403.4±1.30ns 1388.3±1.39ns -1.08%
OptimalMerkleTree::get 26.5±0.04ns 25.7±1.20ns -3.02%
OptimalMerkleTree::override_range 7.1±0.01µs 7.1±0.07µs 0.00%
OptimalMerkleTree::set 1401.9±1.11ns 1386.8±1.50ns -1.08%

@github-actions
Copy link

Benchmark for daadf3a

Click to view benchmark
Test Base PR %
Pmtree::compute_root 2.0±0.00ns 2.0±0.01ns 0.00%
Pmtree::get 452.6±0.28ns 455.6±1.42ns +0.66%
Pmtree::override_range 174.9±7.04µs 171.8±3.72µs -1.77%
Pmtree::set 69.3±0.04µs 70.6±0.35µs +1.88%
Pmtree:delete 69.4±0.37µs 71.2±0.28µs +2.59%

@github-actions
Copy link

github-actions bot commented Oct 2, 2023

Benchmark for 1738a02

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1240.1±0.65ns 1247.0±0.60ns +0.56%
FullMerkleTree::get 4.0±0.02ns 4.0±0.05ns 0.00%
FullMerkleTree::override_range 3.1±0.00µs 3.1±0.00µs 0.00%
FullMerkleTree::set 1241.8±0.88ns 1246.9±0.72ns +0.41%
OptimalMerkleTree::compute_root 1396.2±1.47ns 1421.4±1.15ns +1.80%
OptimalMerkleTree::delete 1391.9±1.51ns 1425.0±3.29ns +2.38%
OptimalMerkleTree::get 26.5±0.01ns 25.8±0.01ns -2.64%
OptimalMerkleTree::override_range 7.1±0.01µs 7.1±0.01µs 0.00%
OptimalMerkleTree::set 1389.2±1.36ns 1420.6±1.30ns +2.26%

@github-actions
Copy link

github-actions bot commented Oct 2, 2023

Benchmark for 1738a02

Click to view benchmark
Test Base PR %
Pmtree::compute_root 1.7±0.00ns 2.0±0.00ns +17.65%
Pmtree::get 452.2±3.58ns 458.0±0.40ns +1.28%
Pmtree::override_range 177.6±3.88µs 180.8±11.15µs +1.80%
Pmtree::set 69.3±0.08µs 69.2±0.11µs -0.14%
Pmtree:delete 69.6±0.07µs 69.1±0.04µs -0.72%

@github-actions
Copy link

github-actions bot commented Oct 2, 2023

Benchmark for 1ecd05d

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1240.6±0.88ns 1254.4±0.90ns +1.11%
FullMerkleTree::get 4.0±0.02ns 4.0±0.12ns 0.00%
FullMerkleTree::override_range 3.1±0.00µs 3.2±0.01µs +3.23%
FullMerkleTree::set 1240.6±1.19ns 1241.3±2.69ns +0.06%
OptimalMerkleTree::compute_root 1395.8±4.13ns 1399.1±2.13ns +0.24%
OptimalMerkleTree::delete 1384.0±1.28ns 1385.4±1.58ns +0.10%
OptimalMerkleTree::get 25.7±0.02ns 25.8±0.18ns +0.39%
OptimalMerkleTree::override_range 7.2±0.03µs 7.1±0.01µs -1.39%
OptimalMerkleTree::set 1388.1±15.99ns 1387.6±4.82ns -0.04%

@github-actions
Copy link

github-actions bot commented Oct 2, 2023

Benchmark for 1ecd05d

Click to view benchmark
Test Base PR %
Pmtree::compute_root 2.0±0.03ns 2.4±0.04ns +20.00%
Pmtree::get 538.4±4.76ns 533.9±7.27ns -0.84%
Pmtree::override_range 209.4±13.71µs 209.0±7.04µs -0.19%
Pmtree::set 81.8±1.43µs 82.2±1.45µs +0.49%
Pmtree:delete 81.8±0.91µs 83.2±0.91µs +1.71%

@github-actions
Copy link

github-actions bot commented Oct 2, 2023

Benchmark for 76a1cf4

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1212.2±40.51ns 1207.5±7.91ns -0.39%
FullMerkleTree::get 3.6±0.02ns 3.6±0.01ns 0.00%
FullMerkleTree::override_range 3.0±0.00µs 3.1±0.01µs +3.33%
FullMerkleTree::set 1205.7±1.75ns 1229.0±1.76ns +1.93%
OptimalMerkleTree::compute_root 1383.4±1.91ns 1430.1±1.90ns +3.38%
OptimalMerkleTree::delete 1367.3±5.73ns 1397.7±6.26ns +2.22%
OptimalMerkleTree::get 27.9±0.09ns 28.5±0.17ns +2.15%
OptimalMerkleTree::override_range 7.0±0.02µs 7.1±0.05µs +1.43%
OptimalMerkleTree::set 1369.6±18.62ns 1392.2±12.67ns +1.65%

@github-actions
Copy link

github-actions bot commented Oct 2, 2023

Benchmark for 76a1cf4

Click to view benchmark
Test Base PR %
Pmtree::compute_root 1.7±0.00ns 2.0±0.01ns +17.65%
Pmtree::get 449.9±0.23ns 452.9±1.30ns +0.67%
Pmtree::override_range 178.7±6.67µs 193.6±31.56µs +8.34%
Pmtree::set 69.3±0.80µs 69.2±0.05µs -0.14%
Pmtree:delete 69.4±0.31µs 69.1±0.15µs -0.43%

@github-actions
Copy link

github-actions bot commented Oct 2, 2023

Benchmark for 7d67813

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1241.5±1.13ns 1239.3±0.56ns -0.18%
FullMerkleTree::get 4.0±0.04ns 4.0±0.04ns 0.00%
FullMerkleTree::override_range 3.1±0.00µs 3.1±0.01µs 0.00%
FullMerkleTree::set 1241.3±1.02ns 1240.1±1.17ns -0.10%
OptimalMerkleTree::compute_root 1397.5±2.17ns 1396.5±1.41ns -0.07%
OptimalMerkleTree::delete 1386.2±1.16ns 1389.0±6.05ns +0.20%
OptimalMerkleTree::get 26.5±0.01ns 26.5±0.06ns 0.00%
OptimalMerkleTree::override_range 7.1±0.01µs 7.1±0.03µs 0.00%
OptimalMerkleTree::set 1387.9±14.07ns 1388.8±10.48ns +0.06%

@github-actions
Copy link

github-actions bot commented Oct 2, 2023

Benchmark for 7d67813

Click to view benchmark
Test Base PR %
Pmtree::compute_root 2.0±0.00ns 1.6±0.00ns -20.00%
Pmtree::get 451.3±0.74ns 454.8±0.58ns +0.78%
Pmtree::override_range 180.8±24.51µs 174.6±9.20µs -3.43%
Pmtree::set 69.3±0.39µs 70.0±0.16µs +1.01%
Pmtree:delete 69.4±0.07µs 70.0±0.50µs +0.86%

@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Benchmark for 3429219

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1266.2±0.67ns 1256.5±0.71ns -0.77%
FullMerkleTree::get 4.0±0.04ns 4.0±0.03ns 0.00%
FullMerkleTree::override_range 3.2±0.00µs 3.2±0.00µs 0.00%
FullMerkleTree::set 1239.5±0.89ns 1246.3±5.50ns +0.55%
OptimalMerkleTree::compute_root 1417.1±1.21ns 1425.4±14.43ns +0.59%
OptimalMerkleTree::delete 1406.1±2.41ns 1408.3±1.76ns +0.16%
OptimalMerkleTree::get 25.5±0.02ns 25.5±0.08ns 0.00%
OptimalMerkleTree::override_range 7.2±0.01µs 7.2±0.01µs 0.00%
OptimalMerkleTree::set 1408.5±1.79ns 1414.6±9.74ns +0.43%

@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Benchmark for 3429219

Click to view benchmark
Test Base PR %
Pmtree::compute_root 1.6±0.00ns 1.6±0.01ns 0.00%
Pmtree::get 457.9±0.46ns 463.2±0.43ns +1.16%
Pmtree::override_range 167.8±3.69µs 172.4±12.05µs +2.74%
Pmtree::set 69.5±0.99µs 70.6±0.05µs +1.58%
Pmtree:delete 69.3±0.25µs 70.3±0.03µs +1.44%

@rymnc rymnc marked this pull request as ready for review October 3, 2023 11:32
@rymnc rymnc requested a review from tyshko-rostyslav October 3, 2023 11:33
@rymnc
Copy link
Contributor Author

rymnc commented Oct 3, 2023

@SionoiS could you please sanity check my rust? would really help

Copy link

@SionoiS SionoiS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some beautiful Rust code!

rln/src/protocol.rs Show resolved Hide resolved

---------

Co-authored-by: rymnc <43716372+rymnc@users.noreply.github.com>
Copy link
Contributor

@tyshko-rostyslav tyshko-rostyslav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Benchmark for c2a169b

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1239.6±0.60ns 1239.2±0.67ns -0.03%
FullMerkleTree::get 4.0±0.02ns 4.0±0.04ns 0.00%
FullMerkleTree::override_range 3.1±0.00µs 3.1±0.00µs 0.00%
FullMerkleTree::set 1238.9±1.09ns 1239.4±1.00ns +0.04%
OptimalMerkleTree::compute_root 1394.4±6.96ns 1397.0±3.07ns +0.19%
OptimalMerkleTree::delete 1387.0±1.65ns 1390.8±2.65ns +0.27%
OptimalMerkleTree::get 25.8±0.15ns 26.1±0.06ns +1.16%
OptimalMerkleTree::override_range 7.1±0.06µs 7.1±0.02µs 0.00%
OptimalMerkleTree::set 1387.8±15.17ns 1391.3±12.97ns +0.25%

@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Benchmark for c2a169b

Click to view benchmark
Test Base PR %
Pmtree::compute_root 1.7±0.00ns 2.0±0.00ns +17.65%
Pmtree::get 451.4±0.40ns 449.2±1.91ns -0.49%
Pmtree::override_range 183.8±22.89µs 177.1±8.00µs -3.65%
Pmtree::set 69.4±0.04µs 69.0±0.05µs -0.58%
Pmtree:delete 69.5±0.07µs 69.0±0.19µs -0.72%

@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Benchmark for eaf0cf2

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1253.0±0.89ns 1242.9±0.77ns -0.81%
FullMerkleTree::get 4.0±0.04ns 4.0±0.04ns 0.00%
FullMerkleTree::override_range 3.2±0.00µs 3.1±0.00µs -3.13%
FullMerkleTree::set 1240.5±1.26ns 1244.5±3.56ns +0.32%
OptimalMerkleTree::compute_root 1395.2±1.26ns 1395.8±4.91ns +0.04%
OptimalMerkleTree::delete 1387.4±1.89ns 1388.0±12.59ns +0.04%
OptimalMerkleTree::get 26.5±0.03ns 26.0±0.02ns -1.89%
OptimalMerkleTree::override_range 7.1±0.01µs 7.1±0.05µs 0.00%
OptimalMerkleTree::set 1387.7±3.40ns 1388.8±14.13ns +0.08%

@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Benchmark for eaf0cf2

Click to view benchmark
Test Base PR %
Pmtree::compute_root 1.7±0.00ns 2.1±0.03ns +23.53%
Pmtree::get 451.2±0.22ns 454.3±0.42ns +0.69%
Pmtree::override_range 177.6±7.64µs 184.8±24.40µs +4.05%
Pmtree::set 69.1±0.23µs 69.7±0.40µs +0.87%
Pmtree:delete 69.5±4.18µs 69.9±0.06µs +0.58%

@rymnc rymnc merged commit 8614b2a into master Oct 3, 2023
23 checks passed
@rymnc rymnc deleted the rln-v2 branch October 3, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
track:rln RLN Track - (Secure Messaging/Applied ZK), relay and applications
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants