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

codec_sv2 with optional no_std #1346

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Georges760
Copy link

same technique as for noise_sv2 on which it is depending : adding a #![no_std] compliant intermediary API using the x_with_now_rng() so use can provide a no_std system time and randome number generator is the embedded system have them.

Copy link

codecov bot commented Jan 13, 2025

Codecov Report

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

Project coverage is 19.09%. Comparing base (4ad657a) to head (7a816ad).

Files with missing lines Patch % Lines
protocols/v2/codec-sv2/src/lib.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1346      +/-   ##
==========================================
+ Coverage   16.90%   19.09%   +2.18%     
==========================================
  Files         164      166       +2     
  Lines       10956    11062     +106     
==========================================
+ Hits         1852     2112     +260     
+ Misses       9104     8950     -154     
Flag Coverage Δ
binary_codec_sv2-coverage 0.00% <0.00%> (ø)
binary_serde_sv2-coverage 3.55% <0.00%> (-0.02%) ⬇️
binary_sv2-coverage 5.34% <0.00%> (-0.02%) ⬇️
bip32_derivation-coverage 0.00% <ø> (?)
buffer_sv2-coverage 25.02% <ø> (?)
codec_sv2-coverage 0.01% <0.00%> (-0.01%) ⬇️
common_messages_sv2-coverage 0.13% <0.00%> (-0.01%) ⬇️
const_sv2-coverage 0.00% <0.00%> (ø)
error_handling-coverage 0.00% <ø> (?)
framing_sv2-coverage 0.28% <0.00%> (-0.01%) ⬇️
jd_client-coverage 0.00% <ø> (ø)
jd_server-coverage 7.79% <ø> (ø)
job_declaration_sv2-coverage 0.00% <0.00%> (ø)
key-utils-coverage 2.39% <ø> (ø)
mining-coverage 2.44% <0.00%> (-0.01%) ⬇️
mining_device-coverage 0.00% <ø> (ø)
mining_proxy_sv2-coverage 0.70% <ø> (ø)
noise_sv2-coverage 4.44% <0.00%> (-0.02%) ⬇️
pool_sv2-coverage 2.05% <ø> (ø)
protocols 24.57% <0.00%> (-0.06%) ⬇️
roles 6.55% <ø> (ø)
roles_logic_sv2-coverage 7.93% <0.00%> (-0.03%) ⬇️
sv2_ffi-coverage 0.00% <0.00%> (ø)
template_distribution_sv2-coverage 0.00% <0.00%> (ø)
translator_sv2-coverage 9.60% <ø> (ø)
utils 25.13% <ø> (?)
v1-coverage 2.41% <0.00%> (-0.01%) ⬇️

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.

Copy link
Contributor

github-actions bot commented Jan 13, 2025

🐰 Bencher Report

Branchcodec_sv2_no_std
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,480.10
(-1.11%)
6,964.13
(93.05%)
client-submit-serialize-deserialize📈 view plot
🚷 view threshold
7,517.80
(+1.43%)
7,858.19
(95.67%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle📈 view plot
🚷 view threshold
8,102.90
(+0.09%)
9,458.40
(85.67%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle📈 view plot
🚷 view threshold
927.80
(+6.31%)
966.13
(96.03%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize📈 view plot
🚷 view threshold
679.95
(+0.27%)
725.58
(93.71%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize📈 view plot
🚷 view threshold
244.97
(-2.46%)
280.03
(87.48%)
client-sv1-get-authorize/client-sv1-get-authorize📈 view plot
🚷 view threshold
157.79
(-0.17%)
169.38
(93.16%)
client-sv1-get-submit📈 view plot
🚷 view threshold
6,280.00
(-0.79%)
6,736.32
(93.23%)
client-sv1-get-subscribe/client-sv1-get-subscribe📈 view plot
🚷 view threshold
280.70
(-2.56%)
375.74
(74.71%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle📈 view plot
🚷 view threshold
751.51
(+2.99%)
784.50
(95.79%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize📈 view plot
🚷 view threshold
600.20
(+1.26%)
640.43
(93.72%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize📈 view plot
🚷 view threshold
203.77
(-1.38%)
227.89
(89.41%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Jan 13, 2025

🐰 Bencher Report

Branchcodec_sv2_no_std
Testbedsv2

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
client_sv2_handle_message_miningL2 Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
42.00
(+17.79%)
41.81
(100.45%)
Click to view all benchmark results
BenchmarkEstimated CyclesBenchmark Result
1e3 x estimated cycles
(Result Δ%)
Upper Boundary
1e3 x 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.14
(+1.01%)
2.24
(95.44%)
📈 view plot
🚷 view threshold
473.00
(-0.14%)
490.49
(96.43%)
📈 view plot
🚷 view threshold
732.00
(-0.54%)
758.92
(96.45%)
📈 view plot
🚷 view threshold
8.00
(+55.15%)
11.67
(68.57%)
📈 view plot
🚷 view threshold
39.00
(+0.83%)
41.76
(93.39%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
8.33
(+1.24%)
8.40
(99.13%)
📈 view plot
🚷 view threshold
2,137.00📈 view plot
🚷 view threshold
3,150.00
(-0.27%)
3,167.57
(99.45%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
42.00
(+17.79%)
41.81
(100.45%)
📈 view plot
🚷 view threshold
142.00
(+1.62%)
144.63
(98.18%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
6.37
(+0.98%)
6.45
(98.67%)
📈 view plot
🚷 view threshold
1,750.00
(-0.04%)
1,767.49
(99.01%)
📈 view plot
🚷 view threshold
2,545.00
(-0.27%)
2,575.37
(98.82%)
📈 view plot
🚷 view threshold
22.00
(+27.94%)
24.17
(91.00%)
📈 view plot
🚷 view threshold
106.00
(+1.22%)
108.82
(97.41%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
14.82
(+0.60%)
14.94
(99.18%)
📈 view plot
🚷 view threshold
4,694.00
(-0.01%)
4,711.49
(99.63%)
📈 view plot
🚷 view threshold
6,746.00
(-0.14%)
6,786.73
(99.40%)
📈 view plot
🚷 view threshold
53.00
(+15.39%)
63.46
(83.52%)
📈 view plot
🚷 view threshold
223.00
(+0.82%)
226.16
(98.60%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
27.79
(+0.65%)
28.07
(99.00%)
📈 view plot
🚷 view threshold
10,645.00
(+0.35%)
10,700.14
(99.48%)
📈 view plot
🚷 view threshold
15,503.00
(+0.39%)
15,596.66
(99.40%)
📈 view plot
🚷 view threshold
91.00
(+8.43%)
99.35
(91.59%)
📈 view plot
🚷 view threshold
338.00
(+0.72%)
343.27
(98.47%)
client_sv2_open_channel📈 view plot
🚷 view threshold
4.46
(+1.14%)
4.59
(97.12%)
📈 view plot
🚷 view threshold
1,461.00
(-0.05%)
1,478.49
(98.82%)
📈 view plot
🚷 view threshold
2,155.00
(-0.26%)
2,184.67
(98.64%)
📈 view plot
🚷 view threshold
12.00
(+45.45%)
14.09
(85.18%)
📈 view plot
🚷 view threshold
64.00
(+1.68%)
67.89
(94.27%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
14.04
(+0.14%)
14.20
(98.85%)
📈 view plot
🚷 view threshold
5,064.00
(-0.01%)
5,081.49
(99.66%)
📈 view plot
🚷 view threshold
7,320.00
(-0.08%)
7,352.73
(99.55%)
📈 view plot
🚷 view threshold
42.00
(+14.19%)
48.44
(86.70%)
📈 view plot
🚷 view threshold
186.00
(-0.00%)
190.86
(97.45%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
22.83
(+0.51%)
23.08
(98.92%)
📈 view plot
🚷 view threshold
8,040.00
(+0.09%)
8,057.61
(99.78%)
📈 view plot
🚷 view threshold
11,688.00
(+0.03%)
11,713.51
(99.78%)
📈 view plot
🚷 view threshold
86.00
(+13.23%)
90.14
(95.41%)
📈 view plot
🚷 view threshold
306.00
(+0.59%)
312.90
(97.79%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
4.72
(+0.56%)
4.79
(98.45%)
📈 view plot
🚷 view threshold
1,502.00
(-0.04%)
1,519.49
(98.85%)
📈 view plot
🚷 view threshold
2,274.00
(-0.21%)
2,300.86
(98.83%)
📈 view plot
🚷 view threshold
13.00
(+37.29%)
15.35
(84.72%)
📈 view plot
🚷 view threshold
68.00
(+0.57%)
70.18
(96.90%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
16.22
(+0.37%)
16.33
(99.31%)
📈 view plot
🚷 view threshold
5,963.00
(-0.01%)
5,980.49
(99.71%)
📈 view plot
🚷 view threshold
8,653.00
(-0.12%)
8,692.69
(99.54%)
📈 view plot
🚷 view threshold
50.00
(+22.39%)
56.55
(88.42%)
📈 view plot
🚷 view threshold
209.00
(+0.35%)
212.20
(98.49%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
35.76
(+0.43%)
35.96
(99.44%)
📈 view plot
🚷 view threshold
14,888.00
(+0.13%)
14,920.01
(99.79%)
📈 view plot
🚷 view threshold
21,865.00
(+0.09%)
21,919.47
(99.75%)
📈 view plot
🚷 view threshold
112.00
(+18.09%)
120.47
(92.97%)
📈 view plot
🚷 view threshold
381.00
(+0.35%)
385.77
(98.76%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Jan 13, 2025

🐰 Bencher Report

Branchcodec_sv2_no_std
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.83
(-1.06%)
60.46
(74.16%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
72.49
(-5.33%)
103.90
(69.77%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
14.65
(-0.09%)
14.73
(99.50%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
270.73
(+2.72%)
286.20
(94.59%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
611.84
(-0.97%)
683.02
(89.58%)
client_sv2_open_channel📈 view plot
🚷 view threshold
165.49
(-0.24%)
178.55
(92.68%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
281.74
(-1.61%)
315.93
(89.18%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
394.61
(+3.13%)
403.03
(97.91%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
159.03
(-0.45%)
170.66
(93.19%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
466.93
(-0.94%)
565.35
(82.59%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
1,024.70
(+1.47%)
1,232.83
(83.12%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Jan 13, 2025

🐰 Bencher Report

Branchcodec_sv2_no_std
Testbedsv1
Click to view all benchmark results
BenchmarkEstimated CyclesBenchmark Result
1e3 x estimated cycles
(Result Δ%)
Upper Boundary
1e3 x estimated cycles
(Limit %)
InstructionsBenchmark Result
1e3 x instructions
(Result Δ%)
Upper Boundary
1e3 x instructions
(Limit %)
L1 AccessesBenchmark Result
1e3 x accesses
(Result Δ%)
Upper Boundary
1e3 x 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.39
(-0.70%)
8.67
(96.80%)
📈 view plot
🚷 view threshold
3.69
(-0.92%)
3.86
(95.54%)
📈 view plot
🚷 view threshold
5.16
(-1.08%)
5.45
(94.65%)
📈 view plot
🚷 view threshold
11.00
(+28.70%)
16.47
(66.77%)
📈 view plot
🚷 view threshold
91.00
(-0.48%)
96.80
(94.01%)
get_submit📈 view plot
🚷 view threshold
95.19
(-0.18%)
95.62
(99.55%)
📈 view plot
🚷 view threshold
59.35
(-0.09%)
59.71
(99.39%)
📈 view plot
🚷 view threshold
85.22
(-0.09%)
85.82
(99.31%)
📈 view plot
🚷 view threshold
46.00
(+2.44%)
60.45
(76.10%)
📈 view plot
🚷 view threshold
278.00
(-0.98%)
291.88
(95.24%)
get_subscribe📈 view plot
🚷 view threshold
7.88
(-1.45%)
8.23
(95.70%)
📈 view plot
🚷 view threshold
2.77
(-1.63%)
2.94
(93.98%)
📈 view plot
🚷 view threshold
3.85
(-1.90%)
4.14
(92.86%)
📈 view plot
🚷 view threshold
15.00
(+18.89%)
20.91
(71.73%)
📈 view plot
🚷 view threshold
113.00
(-1.33%)
117.94
(95.81%)
serialize_authorize📈 view plot
🚷 view threshold
12.12
(-1.14%)
12.51
(96.88%)
📈 view plot
🚷 view threshold
5.27
(-0.58%)
5.43
(97.05%)
📈 view plot
🚷 view threshold
7.33
(-0.68%)
7.60
(96.37%)
📈 view plot
🚷 view threshold
13.00
(+25.97%)
18.98
(68.49%)
📈 view plot
🚷 view threshold
135.00
(-2.14%)
143.36
(94.17%)
serialize_deserialize_authorize📈 view plot
🚷 view threshold
24.64
(-0.31%)
25.19
(97.82%)
📈 view plot
🚷 view threshold
9.84
(-0.18%)
10.01
(98.28%)
📈 view plot
🚷 view threshold
13.88
(-0.22%)
14.17
(97.89%)
📈 view plot
🚷 view threshold
38.00
(+5.60%)
45.99
(82.62%)
📈 view plot
🚷 view threshold
302.00
(-0.54%)
313.67
(96.28%)
serialize_deserialize_handle_authorize📈 view plot
🚷 view threshold
30.16
(-0.54%)
30.73
(98.14%)
📈 view plot
🚷 view threshold
12.02
(-0.28%)
12.19
(98.60%)
📈 view plot
🚷 view threshold
17.00
(-0.35%)
17.30
(98.27%)
📈 view plot
🚷 view threshold
63.00
(+12.69%)
67.66
(93.11%)
📈 view plot
🚷 view threshold
367.00
(-1.07%)
379.52
(96.70%)
serialize_deserialize_handle_submit📈 view plot
🚷 view threshold
126.30
(-0.12%)
126.79
(99.61%)
📈 view plot
🚷 view threshold
73.20
(-0.06%)
73.53
(99.55%)
📈 view plot
🚷 view threshold
104.91
(-0.08%)
105.51
(99.43%)
📈 view plot
🚷 view threshold
112.00
(+4.80%)
125.92
(88.95%)
📈 view plot
🚷 view threshold
595.00
(-0.46%)
610.67
(97.43%)
serialize_deserialize_handle_subscribe📈 view plot
🚷 view threshold
27.76
(-0.53%)
28.38
(97.80%)
📈 view plot
🚷 view threshold
9.58
(-0.47%)
9.76
(98.21%)
📈 view plot
🚷 view threshold
13.53
(-0.60%)
13.84
(97.78%)
📈 view plot
🚷 view threshold
74.00
(+14.41%)
78.37
(94.43%)
📈 view plot
🚷 view threshold
396.00
(-0.81%)
409.80
(96.63%)
serialize_deserialize_submit📈 view plot
🚷 view threshold
115.17
(-0.06%)
115.71
(99.53%)
📈 view plot
🚷 view threshold
68.06
(+0.01%)
68.42
(99.47%)
📈 view plot
🚷 view threshold
97.65
(+0.01%)
98.29
(99.35%)
📈 view plot
🚷 view threshold
67.00
(+1.91%)
87.80
(76.31%)
📈 view plot
🚷 view threshold
491.00
(-0.50%)
505.35
(97.16%)
serialize_deserialize_subscribe📈 view plot
🚷 view threshold
23.18
(-0.61%)
23.82
(97.32%)
📈 view plot
🚷 view threshold
8.14
(-0.50%)
8.32
(97.93%)
📈 view plot
🚷 view threshold
11.45
(-0.60%)
11.75
(97.48%)
📈 view plot
🚷 view threshold
43.00
(+9.90%)
51.32
(83.79%)
📈 view plot
🚷 view threshold
329.00
(-0.80%)
342.46
(96.07%)
serialize_submit📈 view plot
🚷 view threshold
99.57
(-0.22%)
100.09
(99.48%)
📈 view plot
🚷 view threshold
61.41
(-0.07%)
61.73
(99.47%)
📈 view plot
🚷 view threshold
88.08
(-0.08%)
88.65
(99.37%)
📈 view plot
🚷 view threshold
50.00
(+3.51%)
67.15
(74.46%)
📈 view plot
🚷 view threshold
321.00
(-1.35%)
337.65
(95.07%)
serialize_subscribe📈 view plot
🚷 view threshold
11.32
(-0.71%)
11.60
(97.58%)
📈 view plot
🚷 view threshold
4.12
(-1.01%)
4.28
(96.16%)
📈 view plot
🚷 view threshold
5.71
(-1.23%)
6.00
(95.17%)
📈 view plot
🚷 view threshold
16.00
(+13.90%)
24.42
(65.51%)
📈 view plot
🚷 view threshold
158.00
(-0.35%)
164.64
(95.97%)
🐰 View full continuous benchmarking report in Bencher

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.

1 participant