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

Rust docs noise_sv2 #1111

Merged
merged 12 commits into from
Oct 14, 2024
Merged

Rust docs noise_sv2 #1111

merged 12 commits into from
Oct 14, 2024

Conversation

Shourya742
Copy link
Contributor

@Shourya742 Shourya742 commented Aug 18, 2024

closes #1013

Copy link
Contributor

github-actions bot commented Aug 18, 2024

🐰Bencher

ReportTue, September 3, 2024 at 10:59:01 UTC
ProjectStratum V2 (SRI)
Branchdoc-noise-sv2
Testbedsv2
Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Lower Boundary
nanoseconds (ns) | (%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client_sv2_handle_message_common✅ (view plot)45.26 (+1.34%)43.53 (96.17%)45.79 (98.83%)
client_sv2_handle_message_mining✅ (view plot)73.10 (-1.10%)64.04 (87.60%)83.80 (87.24%)
client_sv2_mining_message_submit_standard✅ (view plot)14.66 (-0.01%)14.60 (99.63%)14.71 (99.61%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)260.45 (-2.37%)246.39 (94.60%)287.16 (90.70%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)588.78 (-0.84%)555.96 (94.43%)631.60 (93.22%)
client_sv2_open_channel✅ (view plot)163.45 (-1.43%)159.07 (97.32%)172.55 (94.72%)
client_sv2_open_channel_serialize✅ (view plot)268.95 (-4.39%)265.56 (98.74%)297.05 (90.54%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)377.83 (+0.05%)324.18 (85.80%)431.11 (87.64%)
client_sv2_setup_connection✅ (view plot)165.74 (+1.33%)150.35 (90.71%)176.79 (93.75%)
client_sv2_setup_connection_serialize✅ (view plot)448.46 (-4.52%)411.92 (91.85%)527.50 (85.02%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)996.92 (+1.37%)882.23 (88.50%)1,084.74 (91.90%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

Copy link
Contributor

github-actions bot commented Aug 18, 2024

🐰Bencher

ReportTue, September 3, 2024 at 10:59:04 UTC
ProjectStratum V2 (SRI)
Branchdoc-noise-sv2
Testbedsv1

🚨 2 ALERTS: Threshold Boundary Limits exceeded!
BenchmarkMeasure (units)ViewValueLower BoundaryUpper Boundary
serialize_deserialize_authorizeEstimated Cycles (estimated cycles)🚨 (view plot | view alert)24,931.00 (+1.48%)24,241.26 (97.23%)24,893.89 (100.15%)
serialize_deserialize_authorizeRAM Accesses (accesses)🚨 (view plot | view alert)307.00 (+3.13%)289.54 (94.31%)305.85 (100.38%)

Click to view all benchmark results
BenchmarkEstimated CyclesEstimated Cycles Results
estimated cycles | (Δ%)
Estimated Cycles Lower Boundary
estimated cycles | (%)
Estimated Cycles Upper Boundary
estimated cycles | (%)
InstructionsInstructions Results
instructions | (Δ%)
Instructions Lower Boundary
instructions | (%)
Instructions Upper Boundary
instructions | (%)
L1 AccessesL1 Accesses Results
accesses | (Δ%)
L1 Accesses Lower Boundary
accesses | (%)
L1 Accesses Upper Boundary
accesses | (%)
L2 AccessesL2 Accesses Results
accesses | (Δ%)
L2 Accesses Lower Boundary
accesses | (%)
L2 Accesses Upper Boundary
accesses | (%)
RAM AccessesRAM Accesses Results
accesses | (Δ%)
RAM Accesses Lower Boundary
accesses | (%)
RAM Accesses Upper Boundary
accesses | (%)
get_authorize✅ (view plot)8,545.00 (+1.26%)8,190.11 (95.85%)8,687.71 (98.36%)✅ (view plot)3,772.00 (+0.68%)3,635.98 (96.39%)3,856.90 (97.80%)✅ (view plot)5,295.00 (+0.77%)5,103.12 (96.38%)5,405.68 (97.95%)✅ (view plot)6.00 (-18.73%)4.29 (71.57%)10.47 (57.30%)✅ (view plot)92.00 (+2.30%)86.34 (93.84%)93.53 (98.37%)
get_submit✅ (view plot)95,442.00 (-0.06%)94,988.50 (99.52%)96,019.56 (99.40%)✅ (view plot)59,522.00 (+0.09%)59,199.22 (99.46%)59,740.05 (99.63%)✅ (view plot)85,507.00 (+0.11%)85,032.82 (99.45%)85,791.52 (99.67%)✅ (view plot)48.00 (-3.60%)33.23 (69.23%)66.36 (72.33%)✅ (view plot)277.00 (-1.50%)274.96 (99.26%)287.49 (96.35%)
get_subscribe✅ (view plot)8,064.00 (+0.78%)7,746.40 (96.06%)8,256.25 (97.67%)✅ (view plot)2,848.00 (+0.47%)2,728.71 (95.81%)2,940.68 (96.85%)✅ (view plot)3,984.00 (+0.55%)3,820.72 (95.90%)4,103.69 (97.08%)✅ (view plot)11.00 (-19.91%)6.36 (57.85%)21.11 (52.12%)✅ (view plot)115.00 (+1.37%)109.28 (95.03%)117.60 (97.79%)
serialize_authorize✅ (view plot)12,328.00 (+0.70%)11,970.48 (97.10%)12,514.56 (98.51%)✅ (view plot)5,343.00 (+0.48%)5,206.98 (97.45%)5,427.90 (98.44%)✅ (view plot)7,458.00 (+0.56%)7,265.14 (97.41%)7,568.04 (98.55%)✅ (view plot)8.00 (-16.82%)5.55 (69.37%)13.69 (58.46%)✅ (view plot)138.00 (+1.09%)131.83 (95.53%)141.19 (97.74%)
serialize_deserialize_authorize🚨 (view plot | view alert)24,931.00 (+1.48%)24,241.26 (97.23%)24,893.89 (100.15%)✅ (view plot)9,920.00 (+0.22%)9,769.83 (98.49%)10,026.59 (98.94%)✅ (view plot)14,016.00 (+0.34%)13,781.15 (98.32%)14,156.46 (99.01%)✅ (view plot)34.00 (-5.25%)29.48 (86.70%)42.29 (80.40%)🚨 (view plot | view alert)307.00 (+3.13%)289.54 (94.31%)305.85 (100.38%)
serialize_deserialize_handle_authorize✅ (view plot)30,431.00 (+0.68%)29,935.24 (98.37%)30,514.31 (99.73%)✅ (view plot)12,097.00 (+0.04%)11,978.42 (99.02%)12,205.64 (99.11%)✅ (view plot)17,141.00 (+0.14%)16,959.31 (98.94%)17,276.02 (99.22%)✅ (view plot)54.00 (-6.20%)50.58 (93.67%)64.56 (83.65%)✅ (view plot)372.00 (+1.57%)358.60 (96.40%)373.93 (99.48%)
serialize_deserialize_handle_submit✅ (view plot)126,463.00 (+0.01%)125,927.17 (99.58%)126,972.00 (99.60%)✅ (view plot)73,363.00 (+0.13%)72,940.44 (99.42%)73,594.86 (99.68%)✅ (view plot)105,198.00 (+0.16%)104,559.13 (99.39%)105,496.71 (99.72%)✅ (view plot)109.00 (-3.26%)89.67 (82.27%)135.68 (80.34%)✅ (view plot)592.00 (-0.66%)590.14 (99.69%)601.77 (98.38%)
serialize_deserialize_handle_subscribe✅ (view plot)27,971.00 (+1.22%)27,101.87 (96.89%)28,163.44 (99.32%)✅ (view plot)9,666.00 (+0.25%)9,532.23 (98.62%)9,751.20 (99.13%)✅ (view plot)13,681.00 (+0.32%)13,486.38 (98.58%)13,789.03 (99.22%)✅ (view plot)58.00 (-10.31%)56.15 (96.81%)73.19 (79.25%)✅ (view plot)400.00 (+2.40%)376.76 (94.19%)404.47 (98.89%)
serialize_deserialize_submit✅ (view plot)115,445.00 (+0.25%)114,656.33 (99.32%)115,654.03 (99.82%)✅ (view plot)68,223.00 (+0.21%)67,767.05 (99.33%)68,390.13 (99.76%)✅ (view plot)97,935.00 (+0.25%)97,228.68 (99.28%)98,152.06 (99.78%)✅ (view plot)65.00 (-0.35%)52.35 (80.53%)78.10 (83.22%)✅ (view plot)491.00 (+0.27%)483.88 (98.55%)495.48 (99.10%)
serialize_deserialize_subscribe✅ (view plot)23,469.00 (+1.79%)22,530.53 (96.00%)23,584.31 (99.51%)✅ (view plot)8,225.00 (+0.35%)8,085.81 (98.31%)8,306.56 (99.02%)✅ (view plot)11,589.00 (+0.38%)11,393.21 (98.31%)11,696.44 (99.08%)✅ (view plot)38.00 (-0.77%)32.89 (86.55%)43.70 (86.96%)✅ (view plot)334.00 (+3.26%)310.14 (92.86%)336.78 (99.17%)
serialize_submit✅ (view plot)99,835.00 (-0.06%)99,407.64 (99.57%)100,375.83 (99.46%)✅ (view plot)61,566.00 (+0.08%)61,239.72 (99.47%)61,788.14 (99.64%)✅ (view plot)88,350.00 (+0.11%)87,870.19 (99.46%)88,642.69 (99.67%)✅ (view plot)50.00 (-1.89%)36.61 (73.22%)65.31 (76.56%)✅ (view plot)321.00 (-1.28%)319.49 (99.53%)330.83 (97.03%)
serialize_subscribe✅ (view plot)11,405.00 (+0.24%)11,106.55 (97.38%)11,648.72 (97.91%)✅ (view plot)4,195.00 (+0.32%)4,075.71 (97.16%)4,287.68 (97.84%)✅ (view plot)5,840.00 (+0.36%)5,677.61 (97.22%)5,960.71 (97.97%)✅ (view plot)14.00 (-3.32%)8.80 (62.84%)20.16 (69.43%)✅ (view plot)157.00 (+0.16%)151.46 (96.47%)162.04 (96.89%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

Copy link
Contributor

github-actions bot commented Aug 18, 2024

🐰 Bencher Report

Branch1111/merge
Testbedsv1
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
client-submit-serialize📈 view plot
🚷 view threshold
6,694.20
(-2.46%)
7,883.56
(84.91%)
client-submit-serialize-deserialize📈 view plot
🚷 view threshold
7,853.80
(-0.87%)
8,813.55
(89.11%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle📈 view plot
🚷 view threshold
8,345.20
(-1.53%)
9,436.99
(88.43%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle📈 view plot
🚷 view threshold
926.90
(+0.15%)
1,030.97
(89.91%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize📈 view plot
🚷 view threshold
736.81
(+1.02%)
835.76
(88.16%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize📈 view plot
🚷 view threshold
248.35
(-1.30%)
285.48
(86.99%)
client-sv1-get-authorize/client-sv1-get-authorize📈 view plot
🚷 view threshold
159.66
(+0.01%)
175.13
(91.17%)
client-sv1-get-submit📈 view plot
🚷 view threshold
6,462.20
(-2.55%)
7,472.71
(86.48%)
client-sv1-get-subscribe/client-sv1-get-subscribe📈 view plot
🚷 view threshold
273.06
(-1.95%)
302.86
(90.16%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle📈 view plot
🚷 view threshold
774.13
(-0.96%)
888.51
(87.13%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize📈 view plot
🚷 view threshold
623.15
(-3.43%)
741.13
(84.08%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize📈 view plot
🚷 view threshold
199.49
(-5.06%)
244.40
(81.62%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Aug 18, 2024

🐰Bencher

ReportTue, September 3, 2024 at 10:59:05 UTC
ProjectStratum V2 (SRI)
Branchdoc-noise-sv2
Testbedsv2

🚨 2 ALERTS: Threshold Boundary Limits exceeded!
BenchmarkMeasure (units)ViewValueLower BoundaryUpper Boundary
client_sv2_handle_message_commonEstimated Cycles (estimated cycles)🚨 (view plot | view alert)2,159.00 (+4.36%)1,984.12 (91.90%)2,153.39 (100.26%)
client_sv2_handle_message_commonRAM Accesses (accesses)🚨 (view plot | view alert)40.00 (+7.31%)34.60 (86.50%)39.95 (100.12%)

Click to view all benchmark results
BenchmarkEstimated CyclesEstimated Cycles Results
estimated cycles | (Δ%)
Estimated Cycles Lower Boundary
estimated cycles | (%)
Estimated Cycles Upper Boundary
estimated cycles | (%)
InstructionsInstructions Results
instructions | (Δ%)
Instructions Lower Boundary
instructions | (%)
Instructions Upper Boundary
instructions | (%)
L1 AccessesL1 Accesses Results
accesses | (Δ%)
L1 Accesses Lower Boundary
accesses | (%)
L1 Accesses Upper Boundary
accesses | (%)
L2 AccessesL2 Accesses Results
accesses | (Δ%)
L2 Accesses Lower Boundary
accesses | (%)
L2 Accesses Upper Boundary
accesses | (%)
RAM AccessesRAM Accesses Results
accesses | (Δ%)
RAM Accesses Lower Boundary
accesses | (%)
RAM Accesses Upper Boundary
accesses | (%)
client_sv2_handle_message_common🚨 (view plot | view alert)2,159.00 (+4.36%)1,984.12 (91.90%)2,153.39 (100.26%)✅ (view plot)473.00 (+0.33%)457.33 (96.69%)485.52 (97.42%)✅ (view plot)734.00 (+0.10%)711.90 (96.99%)754.59 (97.27%)✅ (view plot)5.00 (-19.01%)-0.60 (-12.04%)12.95 (38.61%)🚨 (view plot | view alert)40.00 (+7.31%)34.60 (86.50%)39.95 (100.12%)
client_sv2_handle_message_mining✅ (view plot)8,146.00 (-0.68%)8,091.52 (99.33%)8,311.85 (98.00%)✅ (view plot)2,137.00 (+0.22%)2,093.00 (97.94%)2,171.74 (98.40%)✅ (view plot)3,166.00 (+0.42%)3,089.14 (97.57%)3,216.47 (98.43%)✅ (view plot)30.00 (-18.27%)29.43 (98.10%)43.98 (68.22%)✅ (view plot)138.00 (-0.73%)136.21 (98.71%)141.81 (97.32%)
client_sv2_mining_message_submit_standard✅ (view plot)6,311.00 (+0.49%)6,183.26 (97.98%)6,376.84 (98.97%)✅ (view plot)1,750.00 (-0.01%)1,736.79 (99.25%)1,763.53 (99.23%)✅ (view plot)2,551.00 (-0.10%)2,532.38 (99.27%)2,574.66 (99.08%)✅ (view plot)17.00 (-1.36%)11.14 (65.50%)23.33 (72.85%)✅ (view plot)105.00 (+0.95%)101.02 (96.21%)107.00 (98.13%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)14,734.00 (-0.21%)14,554.39 (98.78%)14,974.73 (98.39%)✅ (view plot)4,694.00 (-0.00%)4,680.79 (99.72%)4,707.53 (99.71%)✅ (view plot)6,759.00 (+0.04%)6,736.27 (99.66%)6,776.53 (99.74%)✅ (view plot)41.00 (-8.87%)36.63 (89.33%)53.35 (76.85%)✅ (view plot)222.00 (-0.17%)215.67 (97.15%)229.09 (96.91%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)27,588.00 (+0.30%)27,220.89 (98.67%)27,792.33 (99.26%)✅ (view plot)10,585.00 (+0.23%)10,506.34 (99.26%)10,615.82 (99.71%)✅ (view plot)15,403.00 (+0.23%)15,287.98 (99.25%)15,447.08 (99.71%)✅ (view plot)78.00 (-4.83%)74.89 (96.01%)89.03 (87.61%)✅ (view plot)337.00 (+0.56%)326.05 (96.75%)344.19 (97.91%)
client_sv2_open_channel✅ (view plot)4,439.00 (-0.01%)4,275.70 (96.32%)4,603.61 (96.42%)✅ (view plot)1,461.00 (+0.05%)1,447.38 (99.07%)1,473.11 (99.18%)✅ (view plot)2,159.00 (+0.17%)2,135.30 (98.90%)2,175.54 (99.24%)✅ (view plot)8.00 (-24.76%)4.81 (60.07%)16.46 (48.60%)✅ (view plot)64.00 (+0.40%)58.74 (91.78%)68.75 (93.09%)
client_sv2_open_channel_serialize✅ (view plot)14,026.00 (-0.84%)13,880.77 (98.96%)14,408.49 (97.35%)✅ (view plot)5,064.00 (+0.01%)5,050.38 (99.73%)5,076.11 (99.76%)✅ (view plot)7,331.00 (+0.13%)7,299.27 (99.57%)7,343.88 (99.82%)✅ (view plot)30.00 (-15.08%)28.63 (95.43%)42.02 (71.39%)✅ (view plot)187.00 (-1.53%)181.55 (97.08%)198.25 (94.33%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)22,691.00 (+0.21%)22,354.57 (98.52%)22,933.81 (98.94%)✅ (view plot)8,027.00 (+0.31%)7,948.93 (99.03%)8,055.40 (99.65%)✅ (view plot)11,676.00 (+0.30%)11,562.82 (99.03%)11,719.55 (99.63%)✅ (view plot)75.00 (+1.90%)64.31 (85.75%)82.89 (90.48%)✅ (view plot)304.00 (+0.05%)294.60 (96.91%)313.11 (97.09%)
client_sv2_setup_connection✅ (view plot)4,737.00 (+1.02%)4,623.16 (97.60%)4,755.00 (99.62%)✅ (view plot)1,502.00 (+0.05%)1,488.38 (99.09%)1,514.11 (99.20%)✅ (view plot)2,277.00 (+0.01%)2,256.32 (99.09%)2,297.35 (99.11%)✅ (view plot)9.00 (-4.03%)4.06 (45.13%)14.69 (61.25%)✅ (view plot)69.00 (+2.10%)65.45 (94.85%)69.72 (98.97%)
client_sv2_setup_connection_serialize✅ (view plot)16,204.00 (-0.08%)16,001.83 (98.75%)16,432.78 (98.61%)✅ (view plot)5,963.00 (+0.01%)5,949.38 (99.77%)5,975.11 (99.80%)✅ (view plot)8,664.00 (+0.06%)8,634.96 (99.66%)8,682.31 (99.79%)✅ (view plot)38.00 (-10.03%)31.82 (83.74%)52.65 (72.18%)✅ (view plot)210.00 (+0.03%)203.38 (96.85%)216.47 (97.01%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)35,650.00 (+0.29%)35,377.31 (99.24%)35,713.14 (99.82%)✅ (view plot)14,855.00 (+0.17%)14,775.24 (99.46%)14,883.96 (99.81%)✅ (view plot)21,820.00 (+0.17%)21,692.12 (99.41%)21,872.61 (99.76%)✅ (view plot)92.00 (-3.23%)77.29 (84.01%)112.85 (81.52%)✅ (view plot)382.00 (+0.62%)375.21 (98.22%)384.08 (99.46%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

@Fi3
Copy link
Collaborator

Fi3 commented Aug 18, 2024

just two minor non blocking things for me:

  1. I would remove dead and unused code
  2. I usually do not documents methods on trait impl but only one trait definition

@Shourya742
Copy link
Contributor Author

just two minor non blocking things for me:

  1. I would remove dead and unused code
  2. I usually do not documents methods on trait impl but only one trait definition

noted, will push these.

@Shourya742 Shourya742 marked this pull request as ready for review August 19, 2024 15:03
@plebhash plebhash linked an issue Aug 20, 2024 that may be closed by this pull request
Copy link
Contributor

@average-gary average-gary left a comment

Choose a reason for hiding this comment

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

Some typos and grammer corrections and some general questions for my curiousity.

Should generate_key be documented for handshake.rs?

protocols/v2/noise-sv2/src/aed_cipher.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/aed_cipher.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/aed_cipher.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/cipher_state.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/cipher_state.rs Show resolved Hide resolved
protocols/v2/noise-sv2/src/responder.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/responder.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/responder.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/responder.rs Show resolved Hide resolved
protocols/v2/noise-sv2/src/signature_message.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@rrybarczyk rrybarczyk left a comment

Choose a reason for hiding this comment

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

Here is my first pass, mainly focusing on the initiator, responder, and handshake trait. I will leave another review for the remaining modules, but this review is already quite large. Everything you are doing is great! Most of this are just my nits.

  1. We should add some top level docs in lib.rs that follow the same format as this which is from my PR Rust docs for protocols::v2::codec-sv2 #1040. Please use the sv2-spec/04-Protocol-Security.md for reference when describing what the crate does in this section.
  2. Each module (file) should have the appropriate top level docs.
  3. lib.rs needs to have doc comments on the PARITY constant and the NoiseCodec struct and its implemented methods.
  4. All documentation should span the full 100 character line length instead of 80 characters.
  5. Avoid including language like "This struct performs ABC" or "This is a trait defining XYZ", just say "Performs ABC" or "Defines XYZ".

protocols/v2/noise-sv2/src/initiator.rs Show resolved Hide resolved
protocols/v2/noise-sv2/src/initiator.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/initiator.rs Show resolved Hide resolved
protocols/v2/noise-sv2/src/initiator.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/initiator.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/handshake.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/handshake.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/handshake.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/handshake.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/handshake.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/aed_cipher.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/aed_cipher.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/aed_cipher.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/aed_cipher.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/aed_cipher.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/signature_message.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/signature_message.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/signature_message.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/signature_message.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/signature_message.rs Outdated Show resolved Hide resolved
@plebhash plebhash changed the base branch from dev to main August 28, 2024 19:21
@plebhash
Copy link
Collaborator

plebhash commented Sep 2, 2024

//! Implement Sv2 noise https://github.com/stratum-mining/sv2-spec/blob/main/04-Protocol-Security.md#4-protocol-security

which generates this warning:

warning: this URL is not a hyperlink
 --> v2/noise-sv2/src/lib.rs:1:25
  |
1 | ...se https://github.com/stratum-mining/sv2-spec/blob/main/04-Protocol-Security.md#4-protocol-security
  |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://github.com/stratum-mining/sv2-spec/blob/main/04-Protocol-Security.md#4-protocol-security>`
  |
  = note: bare URLs are not automatically turned into clickable links
  = note: `#[warn(rustdoc::bare_urls)]` on by default

we could give this link some neat markdown formatting, something like:

Implement Noise encryption according to [the SV2 spec](https://github.com/stratum-mining/sv2-spec/blob/main/04-Protocol-Security.md#4-protocol-security)

Copy link
Contributor

github-actions bot commented Sep 12, 2024

🐰 Bencher Report

Branch1111/merge
Testbedsv2
Click to view all benchmark results
BenchmarkEstimated CyclesBenchmark Result
estimated cycles
(Result Δ%)
Upper Boundary
estimated cycles
(Limit %)
InstructionsBenchmark Result
instructions
(Result Δ%)
Upper Boundary
instructions
(Limit %)
L1 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
L2 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
RAM AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
client_sv2_handle_message_common📈 view plot
🚷 view threshold
2,137.00
(+2.50%)
2,209.24
(96.73%)
📈 view plot
🚷 view threshold
473.00
(+0.05%)
490.93
(96.35%)
📈 view plot
🚷 view threshold
732.00
(-0.42%)
761.07
(96.18%)
📈 view plot
🚷 view threshold
8.00
(+39.32%)
14.25
(56.14%)
📈 view plot
🚷 view threshold
39.00
(+3.33%)
41.28
(94.49%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
8,200.00
(-0.10%)
8,320.86
(98.55%)
📈 view plot
🚷 view threshold
2,137.00
(-0.01%)
2,143.84
(99.68%)
📈 view plot
🚷 view threshold
3,160.00
(-0.01%)
3,170.81
(99.66%)
📈 view plot
🚷 view threshold
35.00
(-3.18%)
43.34
(80.76%)
📈 view plot
🚷 view threshold
139.00
(-0.04%)
141.87
(97.98%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
6,331.00
(+0.86%)
6,392.14
(99.04%)
📈 view plot
🚷 view threshold
1,750.00
(-0.03%)
1,768.78
(98.94%)
📈 view plot
🚷 view threshold
2,546.00
(-0.31%)
2,580.35
(98.67%)
📈 view plot
🚷 view threshold
22.00
(+30.07%)
24.51
(89.75%)
📈 view plot
🚷 view threshold
105.00
(+1.01%)
107.15
(97.99%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
14,716.00
(-0.22%)
15,034.87
(97.88%)
📈 view plot
🚷 view threshold
4,694.00
(-0.01%)
4,712.78
(99.60%)
📈 view plot
🚷 view threshold
6,756.00
(-0.02%)
6,784.51
(99.58%)
📈 view plot
🚷 view threshold
45.00
(+2.13%)
54.01
(83.32%)
📈 view plot
🚷 view threshold
221.00
(-0.46%)
229.78
(96.18%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
27,540.00
(+0.07%)
27,840.75
(98.92%)
📈 view plot
🚷 view threshold
10,585.00
(+0.13%)
10,638.99
(99.49%)
📈 view plot
🚷 view threshold
15,400.00
(+0.11%)
15,482.72
(99.47%)
📈 view plot
🚷 view threshold
83.00
(+1.91%)
89.61
(92.62%)
📈 view plot
🚷 view threshold
335.00
(-0.05%)
344.75
(97.17%)
client_sv2_open_channel📈 view plot
🚷 view threshold
4,409.00
(-0.04%)
4,645.86
(94.90%)
📈 view plot
🚷 view threshold
1,461.00
(-0.00%)
1,478.43
(98.82%)
📈 view plot
🚷 view threshold
2,159.00
(+0.02%)
2,187.00
(98.72%)
📈 view plot
🚷 view threshold
9.00
(-4.56%)
18.16
(49.56%)
📈 view plot
🚷 view threshold
63.00
(-0.01%)
69.25
(90.97%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
14,004.00
(-0.65%)
14,521.69
(96.44%)
📈 view plot
🚷 view threshold
5,064.00
(-0.00%)
5,081.43
(99.66%)
📈 view plot
🚷 view threshold
7,329.00
(+0.06%)
7,354.05
(99.66%)
📈 view plot
🚷 view threshold
33.00
(-6.15%)
43.08
(76.60%)
📈 view plot
🚷 view threshold
186.00
(-1.29%)
200.67
(92.69%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
22,711.00
(+0.26%)
23,007.52
(98.71%)
📈 view plot
🚷 view threshold
8,027.00
(+0.17%)
8,079.04
(99.36%)
📈 view plot
🚷 view threshold
11,671.00
(+0.12%)
11,757.60
(99.26%)
📈 view plot
🚷 view threshold
80.00
(+8.58%)
84.80
(94.34%)
📈 view plot
🚷 view threshold
304.00
(+0.13%)
314.43
(96.68%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
4,719.00
(+0.71%)
4,773.24
(98.86%)
📈 view plot
🚷 view threshold
1,502.00
(-0.00%)
1,519.43
(98.85%)
📈 view plot
🚷 view threshold
2,274.00
(-0.19%)
2,303.85
(98.70%)
📈 view plot
🚷 view threshold
13.00
(+44.32%)
15.29
(85.03%)
📈 view plot
🚷 view threshold
68.00
(+0.74%)
69.96
(97.19%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
16,148.00
(-0.30%)
16,502.48
(97.85%)
📈 view plot
🚷 view threshold
5,963.00
(-0.00%)
5,980.43
(99.71%)
📈 view plot
🚷 view threshold
8,663.00
(+0.01%)
8,693.84
(99.65%)
📈 view plot
🚷 view threshold
41.00
(+0.63%)
54.51
(75.22%)
📈 view plot
🚷 view threshold
208.00
(-0.69%)
217.43
(95.66%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
35,526.00
(-0.08%)
35,740.70
(99.40%)
📈 view plot
🚷 view threshold
14,855.00
(+0.10%)
14,908.13
(99.64%)
📈 view plot
🚷 view threshold
21,821.00
(+0.10%)
21,916.51
(99.56%)
📈 view plot
🚷 view threshold
95.00
(+1.06%)
116.13
(81.80%)
📈 view plot
🚷 view threshold
378.00
(-0.42%)
384.64
(98.27%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Sep 12, 2024

🐰 Bencher Report

Branch1111/merge
Testbedsv1
Click to view all benchmark results
BenchmarkEstimated CyclesBenchmark Result
estimated cycles
(Result Δ%)
Upper Boundary
estimated cycles
(Limit %)
InstructionsBenchmark Result
instructions
(Result Δ%)
Upper Boundary
instructions
(Limit %)
L1 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
L2 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
RAM AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
get_authorize📈 view plot
🚷 view threshold
8,587.00
(+1.58%)
8,814.16
(97.42%)
📈 view plot
🚷 view threshold
3,772.00
(+0.60%)
3,884.39
(97.11%)
📈 view plot
🚷 view threshold
5,292.00
(+0.62%)
5,444.56
(97.20%)
📈 view plot
🚷 view threshold
8.00
(+13.65%)
11.80
(67.82%)
📈 view plot
🚷 view threshold
93.00
(+3.04%)
95.80
(97.08%)
get_submit📈 view plot
🚷 view threshold
95,472.00
(+0.01%)
96,183.19
(99.26%)
📈 view plot
🚷 view threshold
59,522.00
(+0.08%)
59,801.20
(99.53%)
📈 view plot
🚷 view threshold
85,507.00
(+0.10%)
85,884.48
(99.56%)
📈 view plot
🚷 view threshold
47.00
(+0.28%)
70.18
(66.97%)
📈 view plot
🚷 view threshold
278.00
(-0.80%)
289.36
(96.08%)
get_subscribe📈 view plot
🚷 view threshold
8,110.00
(+1.14%)
8,372.31
(96.87%)
📈 view plot
🚷 view threshold
2,848.00
(+0.38%)
2,964.98
(96.05%)
📈 view plot
🚷 view threshold
3,980.00
(+0.34%)
4,137.75
(96.19%)
📈 view plot
🚷 view threshold
14.00
(+11.24%)
22.87
(61.22%)
📈 view plot
🚷 view threshold
116.00
(+1.78%)
119.94
(96.72%)
serialize_authorize📈 view plot
🚷 view threshold
12,366.00
(+0.81%)
12,646.18
(97.78%)
📈 view plot
🚷 view threshold
5,343.00
(+0.42%)
5,455.39
(97.94%)
📈 view plot
🚷 view threshold
7,456.00
(+0.47%)
7,607.48
(98.01%)
📈 view plot
🚷 view threshold
9.00
(+0.70%)
14.76
(60.98%)
📈 view plot
🚷 view threshold
139.00
(+1.33%)
143.89
(96.60%)
serialize_deserialize_authorize📈 view plot
🚷 view threshold
24,977.00
(+1.33%)
25,215.49
(99.05%)
📈 view plot
🚷 view threshold
9,920.00
(+0.26%)
10,052.91
(98.68%)
📈 view plot
🚷 view threshold
14,012.00
(+0.32%)
14,201.33
(98.67%)
📈 view plot
🚷 view threshold
37.00
(+6.36%)
44.24
(83.63%)
📈 view plot
🚷 view threshold
308.00
(+2.59%)
315.07
(97.75%)
serialize_deserialize_handle_authorize📈 view plot
🚷 view threshold
30,481.00
(+0.63%)
30,766.00
(99.07%)
📈 view plot
🚷 view threshold
12,097.00
(+0.08%)
12,224.14
(98.96%)
📈 view plot
🚷 view threshold
17,136.00
(+0.12%)
17,307.83
(99.01%)
📈 view plot
🚷 view threshold
58.00
(+3.98%)
68.03
(85.25%)
📈 view plot
🚷 view threshold
373.00
(+1.23%)
381.87
(97.68%)
serialize_deserialize_handle_submit📈 view plot
🚷 view threshold
126,513.00
(+0.03%)
127,186.67
(99.47%)
📈 view plot
🚷 view threshold
73,363.00
(+0.11%)
73,684.47
(99.56%)
📈 view plot
🚷 view threshold
105,193.00
(+0.12%)
105,639.71
(99.58%)
📈 view plot
🚷 view threshold
113.00
(+3.43%)
140.80
(80.25%)
📈 view plot
🚷 view threshold
593.00
(-0.51%)
605.21
(97.98%)
serialize_deserialize_handle_subscribe📈 view plot
🚷 view threshold
28,021.00
(+0.89%)
28,642.80
(97.83%)
📈 view plot
🚷 view threshold
9,666.00
(+0.18%)
9,783.28
(98.80%)
📈 view plot
🚷 view threshold
13,676.00
(+0.21%)
13,836.41
(98.84%)
📈 view plot
🚷 view threshold
62.00
(-2.48%)
75.78
(81.82%)
📈 view plot
🚷 view threshold
401.00
(+1.65%)
417.52
(96.04%)
serialize_deserialize_submit📈 view plot
🚷 view threshold
115,479.00
(+0.23%)
115,942.78
(99.60%)
📈 view plot
🚷 view threshold
68,223.00
(+0.18%)
68,492.27
(99.61%)
📈 view plot
🚷 view threshold
97,934.00
(+0.21%)
98,317.07
(99.61%)
📈 view plot
🚷 view threshold
65.00
(+1.99%)
81.52
(79.73%)
📈 view plot
🚷 view threshold
492.00
(+0.28%)
499.76
(98.45%)
serialize_deserialize_subscribe📈 view plot
🚷 view threshold
23,511.00
(+1.36%)
24,057.70
(97.73%)
📈 view plot
🚷 view threshold
8,225.00
(+0.27%)
8,339.47
(98.63%)
📈 view plot
🚷 view threshold
11,586.00
(+0.26%)
11,744.51
(98.65%)
📈 view plot
🚷 view threshold
40.00
(+6.82%)
44.63
(89.62%)
📈 view plot
🚷 view threshold
335.00
(+2.37%)
349.36
(95.89%)
serialize_submit📈 view plot
🚷 view threshold
99,865.00
(-0.01%)
100,533.44
(99.34%)
📈 view plot
🚷 view threshold
61,566.00
(+0.08%)
61,849.85
(99.54%)
📈 view plot
🚷 view threshold
88,350.00
(+0.10%)
88,736.58
(99.56%)
📈 view plot
🚷 view threshold
49.00
(+1.72%)
69.35
(70.65%)
📈 view plot
🚷 view threshold
322.00
(-0.85%)
333.46
(96.56%)
serialize_subscribe📈 view plot
🚷 view threshold
11,439.00
(+0.37%)
11,762.40
(97.25%)
📈 view plot
🚷 view threshold
4,195.00
(+0.26%)
4,311.98
(97.29%)
📈 view plot
🚷 view threshold
5,839.00
(+0.27%)
5,994.91
(97.40%)
📈 view plot
🚷 view threshold
14.00
(+5.41%)
22.03
(63.55%)
📈 view plot
🚷 view threshold
158.00
(+0.41%)
164.44
(96.09%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Sep 12, 2024

🐰 Bencher Report

Branch1111/merge
Testbedsv2
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
client_sv2_handle_message_common📈 view plot
🚷 view threshold
44.02
(-1.33%)
46.49
(94.70%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
74.60
(-4.63%)
108.96
(68.46%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
14.65
(-0.64%)
15.45
(94.84%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
266.07
(-0.65%)
288.42
(92.25%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
601.41
(+0.40%)
675.05
(89.09%)
client_sv2_open_channel📈 view plot
🚷 view threshold
166.92
(+0.62%)
178.64
(93.44%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
306.01
(+10.62%)
325.63
(93.98%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
379.02
(+0.18%)
426.23
(88.92%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
161.20
(-0.39%)
182.32
(88.42%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
480.84
(+7.33%)
506.02
(95.02%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
984.20
(+0.97%)
1,062.12
(92.66%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

🐰Bencher

ReportThu, September 12, 2024 at 18:41:19 UTC
ProjectStratum V2 (SRI)
Branch1111/merge@4f6bf6e0-7e3d-43a0-8e27-8650fe9b391c
Testbedsv1
Click to view all benchmark results
BenchmarkEstimated CyclesEstimated Cycles Results
estimated cycles | (Δ%)
Estimated Cycles Upper Boundary
estimated cycles | (%)
InstructionsInstructions Results
instructions | (Δ%)
Instructions Upper Boundary
instructions | (%)
L1 AccessesL1 Accesses Results
accesses | (Δ%)
L1 Accesses Upper Boundary
accesses | (%)
L2 AccessesL2 Accesses Results
accesses | (Δ%)
L2 Accesses Upper Boundary
accesses | (%)
RAM AccessesRAM Accesses Results
accesses | (Δ%)
RAM Accesses Upper Boundary
accesses | (%)
get_authorize✅ (view plot)8,507.00 (+0.72%)8,795.73 (96.72%)✅ (view plot)3,772.00 (+0.63%)3,882.56 (97.15%)✅ (view plot)5,297.00 (+0.76%)5,441.67 (97.34%)✅ (view plot)5.00 (-28.81%)11.60 (43.10%)✅ (view plot)91.00 (+0.99%)95.35 (95.44%)
get_submit✅ (view plot)95,460.00 (-0.02%)96,204.46 (99.23%)✅ (view plot)59,522.00 (+0.09%)59,798.47 (99.54%)✅ (view plot)85,510.00 (+0.11%)85,877.93 (99.57%)✅ (view plot)44.00 (-8.20%)71.73 (61.34%)✅ (view plot)278.00 (-0.98%)290.04 (95.85%)
get_subscribe✅ (view plot)8,072.00 (+0.79%)8,361.80 (96.53%)✅ (view plot)2,848.00 (+0.40%)2,964.77 (96.06%)✅ (view plot)3,982.00 (+0.42%)4,136.99 (96.25%)✅ (view plot)13.00 (+0.24%)23.26 (55.88%)✅ (view plot)115.00 (+1.17%)119.63 (96.13%)
serialize_authorize✅ (view plot)12,282.00 (+0.22%)12,636.18 (97.20%)✅ (view plot)5,343.00 (+0.45%)5,453.56 (97.97%)✅ (view plot)7,462.00 (+0.58%)7,604.05 (98.13%)✅ (view plot)5.00 (-45.92%)14.99 (33.35%)✅ (view plot)137.00 (+0.12%)143.66 (95.36%)
serialize_deserialize_authorize✅ (view plot)24,847.00 (+0.97%)25,136.89 (98.85%)✅ (view plot)9,920.00 (+0.24%)10,054.38 (98.66%)✅ (view plot)14,022.00 (+0.39%)14,199.73 (98.75%)✅ (view plot)30.00 (-14.75%)44.49 (67.43%)✅ (view plot)305.00 (+2.02%)312.98 (97.45%)
serialize_deserialize_handle_authorize✅ (view plot)30,393.00 (+0.45%)30,711.64 (98.96%)✅ (view plot)12,097.00 (+0.06%)12,228.16 (98.93%)✅ (view plot)17,143.00 (+0.15%)17,309.81 (99.04%)✅ (view plot)53.00 (-5.73%)68.67 (77.19%)✅ (view plot)371.00 (+0.98%)380.36 (97.54%)
serialize_deserialize_handle_submit✅ (view plot)126,501.00 (+0.04%)127,171.50 (99.47%)✅ (view plot)73,363.00 (+0.12%)73,675.19 (99.58%)✅ (view plot)105,196.00 (+0.15%)105,621.84 (99.60%)✅ (view plot)110.00 (-0.38%)142.49 (77.20%)✅ (view plot)593.00 (-0.51%)604.62 (98.08%)
serialize_deserialize_handle_subscribe✅ (view plot)27,957.00 (+0.91%)28,565.89 (97.87%)✅ (view plot)9,666.00 (+0.21%)9,780.00 (98.83%)✅ (view plot)13,677.00 (+0.24%)13,830.76 (98.89%)✅ (view plot)63.00 (-1.34%)75.84 (83.07%)✅ (view plot)399.00 (+1.63%)415.50 (96.03%)
serialize_deserialize_submit✅ (view plot)115,399.00 (+0.19%)115,893.89 (99.57%)✅ (view plot)68,223.00 (+0.20%)68,476.79 (99.63%)✅ (view plot)97,939.00 (+0.24%)98,290.30 (99.64%)✅ (view plot)62.00 (-3.26%)81.94 (75.66%)✅ (view plot)490.00 (-0.04%)498.93 (98.21%)
serialize_deserialize_subscribe✅ (view plot)23,393.00 (+1.15%)23,979.52 (97.55%)✅ (view plot)8,225.00 (+0.30%)8,335.64 (98.67%)✅ (view plot)11,593.00 (+0.37%)11,737.74 (98.77%)✅ (view plot)36.00 (-4.99%)45.20 (79.64%)✅ (view plot)332.00 (+2.04%)347.33 (95.59%)
serialize_submit✅ (view plot)99,849.00 (-0.03%)100,546.24 (99.31%)✅ (view plot)61,566.00 (+0.09%)61,847.21 (99.55%)✅ (view plot)88,354.00 (+0.11%)88,730.09 (99.58%)✅ (view plot)45.00 (-8.37%)70.78 (63.58%)✅ (view plot)322.00 (-0.91%)333.37 (96.59%)
serialize_subscribe✅ (view plot)11,401.00 (+0.14%)11,760.95 (96.94%)✅ (view plot)4,195.00 (+0.27%)4,311.77 (97.29%)✅ (view plot)5,841.00 (+0.32%)5,993.98 (97.45%)✅ (view plot)13.00 (-5.26%)22.28 (58.36%)✅ (view plot)157.00 (+0.02%)164.51 (95.44%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

@rrybarczyk rrybarczyk force-pushed the doc-noise-sv2 branch 4 times, most recently from 5027e63 to 424f8c8 Compare September 12, 2024 19:08
Copy link
Contributor

🐰Bencher

ReportThu, September 12, 2024 at 20:02:03 UTC
ProjectStratum V2 (SRI)
Branch1111/merge@7ab9dff1-9574-402f-ad6e-26b681474f8e
Testbedsv2
Click to view all benchmark results
BenchmarkEstimated CyclesEstimated Cycles Results
estimated cycles | (Δ%)
Estimated Cycles Upper Boundary
estimated cycles | (%)
InstructionsInstructions Results
instructions | (Δ%)
Instructions Upper Boundary
instructions | (%)
L1 AccessesL1 Accesses Results
accesses | (Δ%)
L1 Accesses Upper Boundary
accesses | (%)
L2 AccessesL2 Accesses Results
accesses | (Δ%)
L2 Accesses Upper Boundary
accesses | (%)
RAM AccessesRAM Accesses Results
accesses | (Δ%)
RAM Accesses Upper Boundary
accesses | (%)
client_sv2_handle_message_common✅ (view plot)2,129.00 (+2.55%)2,206.76 (96.48%)✅ (view plot)473.00 (+0.23%)491.06 (96.32%)✅ (view plot)734.00 (+0.01%)762.27 (96.29%)✅ (view plot)6.00 (+0.96%)14.43 (41.57%)✅ (view plot)39.00 (+4.01%)41.15 (94.77%)
client_sv2_handle_message_mining✅ (view plot)8,158.00 (-0.51%)8,353.18 (97.66%)✅ (view plot)2,137.00 (+0.17%)2,180.60 (98.00%)✅ (view plot)3,163.00 (+0.28%)3,230.38 (97.91%)✅ (view plot)33.00 (-9.96%)45.49 (72.54%)✅ (view plot)138.00 (-0.67%)142.40 (96.91%)
client_sv2_mining_message_submit_standard✅ (view plot)6,285.00 (+0.10%)6,417.79 (97.93%)✅ (view plot)1,750.00 (-0.02%)1,768.45 (98.96%)✅ (view plot)2,550.00 (-0.14%)2,581.32 (98.79%)✅ (view plot)19.00 (+11.44%)24.90 (76.31%)✅ (view plot)104.00 (+0.01%)107.80 (96.47%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)14,628.00 (-0.80%)15,059.45 (97.14%)✅ (view plot)4,694.00 (-0.01%)4,712.45 (99.61%)✅ (view plot)6,763.00 (+0.08%)6,784.47 (99.68%)✅ (view plot)40.00 (-9.92%)55.29 (72.34%)✅ (view plot)219.00 (-1.30%)230.59 (94.97%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)27,468.00 (-0.12%)27,895.83 (98.47%)✅ (view plot)10,585.00 (+0.18%)10,639.06 (99.49%)✅ (view plot)15,403.00 (+0.18%)15,481.57 (99.49%)✅ (view plot)82.00 (+0.28%)90.47 (90.63%)✅ (view plot)333.00 (-0.53%)345.99 (96.25%)
client_sv2_open_channel✅ (view plot)4,413.00 (-0.22%)4,672.19 (94.45%)✅ (view plot)1,461.00 (+0.03%)1,478.29 (98.83%)✅ (view plot)2,158.00 (+0.04%)2,186.27 (98.71%)✅ (view plot)10.00 (+1.91%)18.57 (53.86%)✅ (view plot)63.00 (-0.53%)69.95 (90.07%)
client_sv2_open_channel_serialize✅ (view plot)13,996.00 (-0.80%)14,532.03 (96.31%)✅ (view plot)5,064.00 (+0.01%)5,081.29 (99.66%)✅ (view plot)7,331.00 (+0.11%)7,354.01 (99.69%)✅ (view plot)31.00 (-12.22%)43.87 (70.66%)✅ (view plot)186.00 (-1.51%)200.85 (92.61%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)22,695.00 (+0.26%)23,037.38 (98.51%)✅ (view plot)8,027.00 (+0.24%)8,079.25 (99.35%)✅ (view plot)11,675.00 (+0.22%)11,755.76 (99.31%)✅ (view plot)76.00 (+3.21%)85.17 (89.23%)✅ (view plot)304.00 (+0.20%)314.97 (96.52%)
client_sv2_setup_connection✅ (view plot)4,703.00 (+0.33%)4,784.44 (98.30%)✅ (view plot)1,502.00 (+0.03%)1,519.29 (98.86%)✅ (view plot)2,278.00 (+0.02%)2,305.34 (98.81%)✅ (view plot)9.00 (-1.95%)15.78 (57.02%)✅ (view plot)68.00 (+0.67%)70.28 (96.75%)
client_sv2_setup_connection_serialize✅ (view plot)16,132.00 (-0.41%)16,516.33 (97.67%)✅ (view plot)5,963.00 (+0.01%)5,980.29 (99.71%)✅ (view plot)8,667.00 (+0.08%)8,693.02 (99.70%)✅ (view plot)37.00 (-10.61%)55.03 (67.24%)✅ (view plot)208.00 (-0.69%)217.91 (95.45%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)35,526.00 (-0.06%)35,783.24 (99.28%)✅ (view plot)14,855.00 (+0.14%)14,908.31 (99.64%)✅ (view plot)21,821.00 (+0.14%)21,911.22 (99.59%)✅ (view plot)95.00 (+0.63%)116.19 (81.76%)✅ (view plot)378.00 (-0.41%)385.14 (98.15%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

Copy link
Contributor

🐰Bencher

ReportThu, September 12, 2024 at 20:27:32 UTC
ProjectStratum V2 (SRI)
Branch1111/merge@aeec1a1e-5b98-4aa5-948b-8636c290d3ef
Testbedsv2
Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client_sv2_handle_message_common✅ (view plot)44.00 (-1.56%)46.72 (94.17%)
client_sv2_handle_message_mining✅ (view plot)74.99 (-0.15%)91.60 (81.87%)
client_sv2_mining_message_submit_standard✅ (view plot)14.66 (-0.10%)14.81 (98.97%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)273.57 (+2.00%)291.63 (93.81%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)602.09 (+1.54%)650.74 (92.52%)
client_sv2_open_channel✅ (view plot)163.16 (-1.63%)177.60 (91.87%)
client_sv2_open_channel_serialize✅ (view plot)270.73 (-2.26%)307.36 (88.08%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)374.10 (-0.91%)458.97 (81.51%)
client_sv2_setup_connection✅ (view plot)165.37 (+2.06%)186.03 (88.89%)
client_sv2_setup_connection_serialize✅ (view plot)448.45 (-1.90%)568.35 (78.90%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)966.09 (-3.21%)1,162.03 (83.14%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

@Shourya742 Shourya742 force-pushed the doc-noise-sv2 branch 2 times, most recently from d974208 to 693f638 Compare October 8, 2024 14:41
protocols/v2/noise-sv2/README.md Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/README.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@rrybarczyk rrybarczyk left a comment

Choose a reason for hiding this comment

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

Here is another round of review. I suggested some language in the src/lib.rs that puts this crate into context with the Sv2 protocol, which @jbesraa also was suggesting in another comment in this PR.

One thing I noticed as well:
We switch between the language "Noise protocol" and "Noise NX protocol". "Noise NX" specifies a particular way the keys are exchanged between the two parties (such as NX, XX, or NN).
When should we be using "Noise protocol" vs "Noise NX protocol" in this crate? Are there specific instance when one is appropriate and the other is not? If not, let's standardize on a single term.

I also think the language of the top level initiator.rs, responder.rs, and perhaps the handshake.rs modules could be cleaned up. Again, adding a bit of context in relation to the Sv2 protocol itself. But I did not leave any direct comments regarding this.

Overall, it is really coming together!

protocols/v2/noise-sv2/README.md Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/README.md Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/README.md Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/README.md Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/README.md Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/lib.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/lib.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/lib.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/README.md Show resolved Hide resolved
protocols/v2/noise-sv2/README.md Show resolved Hide resolved
Copy link
Collaborator

@rrybarczyk rrybarczyk left a comment

Choose a reason for hiding this comment

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

Added come suggestions to clarify the top level module comments for various modules.

protocols/v2/noise-sv2/src/handshake.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/initiator.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/responder.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/responder.rs Outdated Show resolved Hide resolved
Comment on lines 89 to 91
/// Manages the state of the initiator during the Noise NX protocol handshake process. It holds the
/// necessary cryptographic keys, handshake state, and intermediate values needed to perform the
/// key exchange and establish a secure connection with the responder.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps rephrase or add context to the Initiator struct comments based on the suggestions for the top level mod comments in this module, given that the top level module doc comments are private and will not render to crates.io, but the Initiator struct doc comments are public and will render.

protocols/v2/noise-sv2/src/aed_cipher.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/aed_cipher.rs Show resolved Hide resolved
protocols/v2/noise-sv2/src/cipher_state.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/cipher_state.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/cipher_state.rs Outdated Show resolved Hide resolved
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Project coverage is 19.36%. Comparing base (4e29548) to head (1b23eb0).
Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
protocols/v2/noise-sv2/src/responder.rs 0.00% 6 Missing ⚠️
protocols/v2/noise-sv2/src/initiator.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1111   +/-   ##
=======================================
  Coverage   19.36%   19.36%           
=======================================
  Files         164      164           
  Lines       10811    10811           
=======================================
  Hits         2094     2094           
  Misses       8717     8717           
Flag Coverage Δ
binary_codec_sv2-coverage 0.00% <ø> (ø)
binary_serde_sv2-coverage 3.65% <ø> (ø)
binary_sv2-coverage 5.46% <ø> (ø)
bip32_derivation-coverage 0.00% <ø> (ø)
buffer_sv2-coverage 25.02% <ø> (ø)
codec_sv2-coverage 0.00% <ø> (ø)
common_messages_sv2-coverage 0.13% <ø> (ø)
const_sv2-coverage 0.00% <ø> (ø)
error_handling-coverage 0.00% <ø> (ø)
framing_sv2-coverage 0.29% <ø> (ø)
jd_client-coverage 0.00% <ø> (ø)
jd_server-coverage 8.13% <ø> (ø)
job_declaration_sv2-coverage 0.00% <ø> (ø)
key-utils-coverage 2.39% <ø> (ø)
mining-coverage 2.51% <ø> (ø)
mining_device-coverage 0.00% <ø> (ø)
mining_proxy_sv2-coverage 0.70% <ø> (ø)
noise_sv2-coverage 4.35% <ø> (ø)
pool_sv2-coverage 1.38% <ø> (ø)
protocols 24.72% <0.00%> (ø)
roles 6.63% <ø> (ø)
roles_logic_sv2-coverage 8.06% <ø> (ø)
sv1-mining-device-coverage 0.00% <ø> (ø)
sv2_ffi-coverage 0.00% <ø> (ø)
template_distribution_sv2-coverage 0.00% <ø> (ø)
translator_sv2-coverage 9.61% <ø> (ø)
utils 25.13% <ø> (ø)
v1-coverage 2.47% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

protocols/v2/noise-sv2/src/responder.rs Show resolved Hide resolved
protocols/v2/noise-sv2/src/initiator.rs Show resolved Hide resolved
protocols/v2/noise-sv2/src/cipher_state.rs Outdated Show resolved Hide resolved
protocols/v2/noise-sv2/src/cipher_state.rs Outdated Show resolved Hide resolved
fn drop(&mut self) {
self.erase_k();
}
}

impl GenericCipher {
// Encrypts the data (`msg`) in place using the underlying cipher.
Copy link
Contributor

Choose a reason for hiding this comment

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

Commented previously on this but didn't get a response. why are we using ( X ) to refer to variables?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rachel suggested these, cc: @rrybarczyk

@rrybarczyk rrybarczyk self-requested a review October 14, 2024 15:04
@rrybarczyk rrybarczyk merged commit 3b4f448 into stratum-mining:main Oct 14, 2024
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need Rust docs on protocols::v2::noise-sv2
7 participants