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

message_id range check #210

Merged
merged 6 commits into from
Sep 4, 2023
Merged

message_id range check #210

merged 6 commits into from
Sep 4, 2023

Conversation

tyshko-rostyslav
Copy link
Contributor

@tyshko-rostyslav tyshko-rostyslav commented Aug 28, 2023

  • Adds a range check before the proof generation to ensure the provided messageId is within the userMessageLimit
  • Changed corresponding types to Result, as now they can emit errors
  • Added function level documenation

@tyshko-rostyslav tyshko-rostyslav changed the base branch from master to rln-v2 August 28, 2023 08:11
@github-actions
Copy link

Benchmark for 0351b86

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1247.2±0.60ns 1244.7±12.04ns -0.20%
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 1243.1±2.11ns 1245.5±0.78ns +0.19%
OptimalMerkleTree::compute_root 1386.5±1.34ns 1390.8±0.89ns +0.31%
OptimalMerkleTree::delete 1381.8±1.26ns 1384.1±1.83ns +0.17%
OptimalMerkleTree::get 29.3±0.26ns 29.6±0.01ns +1.02%
OptimalMerkleTree::override_range 7.0±0.00µs 7.0±0.01µs 0.00%
OptimalMerkleTree::set 1386.6±11.67ns 1382.5±5.36ns -0.30%

@github-actions
Copy link

Benchmark for 0351b86

Click to view benchmark
Test Base PR %
Pmtree::compute_root 1.6±0.00ns 1.6±0.00ns 0.00%
Pmtree::get 486.3±0.32ns 480.1±0.36ns -1.27%
Pmtree::override_range 165.8±4.28µs 171.6±13.15µs +3.50%
Pmtree::set 66.5±0.04µs 68.4±0.30µs +2.86%
Pmtree:delete 69.0±0.03µs 68.2±0.04µs -1.16%

@github-actions
Copy link

Benchmark for eba1237

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1479.2±13.09ns 1473.9±24.09ns -0.36%
FullMerkleTree::get 0.1±0.00ns 0.1±0.00ns 0.00%
FullMerkleTree::override_range 3.8±0.02µs 3.7±0.05µs -2.63%
FullMerkleTree::set 1486.8±18.03ns 1492.7±8.40ns +0.40%
OptimalMerkleTree::compute_root 1644.7±24.48ns 1656.0±13.77ns +0.69%
OptimalMerkleTree::delete 1652.6±13.92ns 1658.6±4.64ns +0.36%
OptimalMerkleTree::get 34.5±0.39ns 35.6±0.25ns +3.19%
OptimalMerkleTree::override_range 8.3±0.10µs 8.4±0.08µs +1.20%
OptimalMerkleTree::set 1661.3±5.82ns 1641.1±24.85ns -1.22%

@github-actions
Copy link

Benchmark for eba1237

Click to view benchmark
Test Base PR %
Pmtree::compute_root 2.5±0.14ns 2.3±0.19ns -8.00%
Pmtree::get 582.3±46.23ns 561.7±32.76ns -3.54%
Pmtree::override_range 269.2±25.22µs 246.2±25.23µs -8.54%
Pmtree::set 88.4±8.95µs 84.0±6.39µs -4.98%
Pmtree:delete 85.7±5.18µs 84.3±5.75µs -1.63%

@github-actions
Copy link

Benchmark for 3dfcb07

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1543.5±90.78ns 1514.3±118.67ns -1.89%
FullMerkleTree::get 0.1±0.00ns 0.0±0.00ns -100.00%
FullMerkleTree::override_range 3.7±0.17µs 3.9±0.22µs +5.41%
FullMerkleTree::set 1550.3±82.74ns 1493.3±76.12ns -3.68%
OptimalMerkleTree::compute_root 1795.5±103.33ns 1788.3±60.68ns -0.40%
OptimalMerkleTree::delete 1724.0±119.53ns 1549.0±117.95ns -10.15%
OptimalMerkleTree::get 37.5±2.00ns 37.0±1.61ns -1.33%
OptimalMerkleTree::override_range 8.7±0.28µs 9.1±0.85µs +4.60%
OptimalMerkleTree::set 1661.5±108.00ns 1680.5±65.20ns +1.14%

@github-actions
Copy link

Benchmark for 3dfcb07

Click to view benchmark
Test Base PR %
Pmtree::compute_root 1.7±0.00ns 1.7±0.00ns 0.00%
Pmtree::get 461.7±0.28ns 468.4±2.36ns +1.45%
Pmtree::override_range 172.9±7.00µs 181.0±27.34µs +4.68%
Pmtree::set 66.4±0.94µs 66.5±0.07µs +0.15%
Pmtree:delete 66.1±0.05µs 66.0±0.05µs -0.15%

@github-actions
Copy link

Benchmark for 270336a

Click to view benchmark
Test Base PR %
FullMerkleTree::delete 1213.3±72.13ns 1192.3±56.56ns -1.73%
FullMerkleTree::get 0.0±0.00ns 0.0±0.00ns NaN%
FullMerkleTree::override_range 3.1±0.20µs 3.0±0.12µs -3.23%
FullMerkleTree::set 1223.4±74.49ns 1180.8±43.84ns -3.48%
OptimalMerkleTree::compute_root 1323.8±63.45ns 1386.3±69.66ns +4.72%
OptimalMerkleTree::delete 1365.7±60.10ns 1317.1±48.62ns -3.56%
OptimalMerkleTree::get 27.9±1.48ns 28.7±1.28ns +2.87%
OptimalMerkleTree::override_range 6.9±0.45µs 6.9±0.38µs 0.00%
OptimalMerkleTree::set 1318.2±55.57ns 1345.9±71.81ns +2.10%

@github-actions
Copy link

Benchmark for 270336a

Click to view benchmark
Test Base PR %
Pmtree::compute_root 2.6±0.13ns 2.5±0.25ns -3.85%
Pmtree::get 608.9±34.05ns 603.4±17.07ns -0.90%
Pmtree::override_range 264.9±22.71µs 279.8±43.47µs +5.62%
Pmtree::set 92.0±2.83µs 90.5±3.32µs -1.63%
Pmtree:delete 92.0±4.10µs 94.3±5.59µs +2.50%

@tyshko-rostyslav tyshko-rostyslav marked this pull request as ready for review August 28, 2023 10:25
Copy link
Contributor

@rymnc rymnc left a comment

Choose a reason for hiding this comment

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

LGTM, sorry, thought i approved it last week!

@tyshko-rostyslav tyshko-rostyslav merged commit b87f7c8 into rln-v2 Sep 4, 2023
11 of 16 checks passed
@tyshko-rostyslav tyshko-rostyslav mentioned this pull request Sep 4, 2023
12 tasks
@rymnc rymnc deleted the message_id_range_check branch September 4, 2023 09:30
rymnc added a commit that referenced this pull request Oct 3, 2023
* feat(rln-v2): update serde for rln-v2 (#202)

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

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

* s/id_commitments/rate_commitments (#205)

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

* fix: into()

* `message_id` range check (#210)

* feature: range check added

* fmt

* feature: message_id_range_check

* fix: corresponding change of types

* comments: function level

* fmt

* fix(rln): tests (#212)

* most changes

* fix

* fix protocol tests

* fmt

* ffi tests fix

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

* 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

* fix: rln-wasm tests

* fix: ffi tests

* fix: rln-wasm test

* fix: recover_id_secret

* Fix message (#217)



---------

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

* chore: Release

---------

Co-authored-by: tyshko-rostyslav <122977916+tyshko-rostyslav@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants