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

sv1-mining-device lib #1249

Merged

Conversation

jbesraa
Copy link
Contributor

@jbesraa jbesraa commented Nov 14, 2024

Resolves #1245

@jbesraa jbesraa force-pushed the 2024-11-12-sv1-mining-device-lib branch from c33c014 to 9546fe3 Compare November 14, 2024 13:09
@jbesraa jbesraa marked this pull request as ready for review November 14, 2024 13:09
Copy link
Contributor

github-actions bot commented Nov 14, 2024

🐰 Bencher Report

Branch2024-11-12-sv1-mining-device-lib
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.26
(-0.73%)
46.93
(94.31%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
105.62
(+35.92%)
124.39
(84.91%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
14.66
(-0.09%)
14.82
(98.92%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
265.55
(-0.47%)
312.65
(84.94%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
605.42
(+0.10%)
728.82
(83.07%)
client_sv2_open_channel📈 view plot
🚷 view threshold
167.31
(+11.06%)
189.25
(88.41%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
304.69
(+6.43%)
327.09
(93.15%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
377.94
(+0.13%)
403.36
(93.70%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
162.58
(+1.05%)
174.38
(93.23%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
466.21
(+0.34%)
545.35
(85.49%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
1,046.90
(+6.86%)
1,113.67
(94.00%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Nov 14, 2024

🐰 Bencher Report

Branch2024-11-12-sv1-mining-device-lib
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,777.60
(+0.76%)
7,088.45
(95.61%)
client-submit-serialize-deserialize📈 view plot
🚷 view threshold
7,688.50
(+0.47%)
7,949.25
(96.72%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle📈 view plot
🚷 view threshold
8,261.60
(+0.61%)
8,565.71
(96.45%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle📈 view plot
🚷 view threshold
857.81
(-1.77%)
937.36
(91.51%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize📈 view plot
🚷 view threshold
682.67
(+1.40%)
715.35
(95.43%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize📈 view plot
🚷 view threshold
261.30
(+4.77%)
272.23
(95.99%)
client-sv1-get-authorize/client-sv1-get-authorize📈 view plot
🚷 view threshold
166.14
(+5.10%)
172.65
(96.23%)
client-sv1-get-submit📈 view plot
🚷 view threshold
6,581.20
(+0.93%)
7,174.76
(91.73%)
client-sv1-get-subscribe/client-sv1-get-subscribe📈 view plot
🚷 view threshold
284.37
(+1.65%)
308.71
(92.12%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle📈 view plot
🚷 view threshold
747.97
(+1.46%)
807.43
(92.64%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize📈 view plot
🚷 view threshold
589.57
(-1.47%)
641.28
(91.94%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize📈 view plot
🚷 view threshold
204.51
(-0.91%)
222.64
(91.86%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Nov 14, 2024

🐰 Bencher Report

Branch2024-11-12-sv1-mining-device-lib
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,039.00
(-2.62%)
2,207.56
(92.36%)
📈 view plot
🚷 view threshold
473.00
(-0.07%)
488.51
(96.82%)
📈 view plot
🚷 view threshold
734.00
(-0.26%)
757.27
(96.93%)
📈 view plot
🚷 view threshold
9.00
(+66.23%)
14.02
(64.17%)
📈 view plot
🚷 view threshold
36.00
(-5.32%)
41.21
(87.35%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
8,178.00
(-0.31%)
8,283.97
(98.72%)
📈 view plot
🚷 view threshold
2,137.00
(-0.03%)
2,143.08
(99.72%)
📈 view plot
🚷 view threshold
3,158.00
(-0.09%)
3,170.62
(99.60%)
📈 view plot
🚷 view threshold
38.00
(+6.90%)
42.15
(90.16%)
📈 view plot
🚷 view threshold
138.00
(-0.72%)
140.85
(97.98%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
6,199.00
(-1.27%)
6,394.91
(96.94%)
📈 view plot
🚷 view threshold
1,750.00
(-0.05%)
1,766.87
(99.05%)
📈 view plot
🚷 view threshold
2,549.00
(-0.19%)
2,575.61
(98.97%)
📈 view plot
🚷 view threshold
23.00
(+35.79%)
24.53
(93.75%)
📈 view plot
🚷 view threshold
101.00
(-2.90%)
107.27
(94.16%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
14,702.00
(-0.18%)
14,957.13
(98.29%)
📈 view plot
🚷 view threshold
4,694.00
(-0.02%)
4,710.87
(99.64%)
📈 view plot
🚷 view threshold
6,752.00
(-0.10%)
6,781.89
(99.56%)
📈 view plot
🚷 view threshold
50.00
(+14.98%)
53.30
(93.81%)
📈 view plot
🚷 view threshold
220.00
(-0.68%)
227.52
(96.69%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
27,742.00
(+0.75%)
27,802.73
(99.78%)
📈 view plot
🚷 view threshold
10,645.00
(+0.59%)
10,652.27
(99.93%)
📈 view plot
🚷 view threshold
15,507.00
(+0.70%)
15,511.78
(99.97%)
📈 view plot
🚷 view threshold
88.00
(+8.16%)
89.84
(97.95%)
📈 view plot
🚷 view threshold
337.00
(+0.57%)
341.65
(98.64%)
client_sv2_open_channel📈 view plot
🚷 view threshold
4,353.00
(-0.93%)
4,598.21
(94.67%)
📈 view plot
🚷 view threshold
1,461.00
(-0.02%)
1,476.51
(98.95%)
📈 view plot
🚷 view threshold
2,158.00
(-0.09%)
2,184.23
(98.80%)
📈 view plot
🚷 view threshold
12.00
(+35.33%)
17.24
(69.61%)
📈 view plot
🚷 view threshold
61.00
(-2.50%)
68.04
(89.65%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
14,006.00
(-0.33%)
14,411.35
(97.19%)
📈 view plot
🚷 view threshold
5,064.00
(-0.01%)
5,079.51
(99.69%)
📈 view plot
🚷 view threshold
7,321.00
(-0.07%)
7,351.77
(99.58%)
📈 view plot
🚷 view threshold
42.00
(+19.65%)
43.43
(96.71%)
📈 view plot
🚷 view threshold
185.00
(-1.16%)
197.50
(93.67%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
22,854.00
(+0.84%)
22,907.11
(99.77%)
📈 view plot
🚷 view threshold
8,040.00
(+0.23%)
8,073.49
(99.59%)
📈 view plot
🚷 view threshold
11,689.00
(+0.17%)
11,751.70
(99.47%)
📈 view plot
🚷 view threshold
84.00
(+12.89%)
85.42
(98.34%)
📈 view plot
🚷 view threshold
307.00
(+1.16%)
311.24
(98.64%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
4,663.00
(-0.45%)
4,773.62
(97.68%)
📈 view plot
🚷 view threshold
1,502.00
(-0.02%)
1,517.51
(98.98%)
📈 view plot
🚷 view threshold
2,273.00
(-0.24%)
2,299.19
(98.86%)
📈 view plot
🚷 view threshold
16.00
(+68.01%)
16.59
(96.44%)
📈 view plot
🚷 view threshold
66.00
(-2.04%)
69.81
(94.55%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
16,096.00
(-0.45%)
16,448.33
(97.86%)
📈 view plot
🚷 view threshold
5,963.00
(-0.01%)
5,978.51
(99.74%)
📈 view plot
🚷 view threshold
8,661.00
(-0.03%)
8,691.48
(99.65%)
📈 view plot
🚷 view threshold
45.00
(+12.85%)
53.11
(84.74%)
📈 view plot
🚷 view threshold
206.00
(-1.30%)
216.03
(95.36%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
35,644.00
(+0.26%)
35,756.18
(99.69%)
📈 view plot
🚷 view threshold
14,888.00
(+0.25%)
14,909.01
(99.86%)
📈 view plot
🚷 view threshold
21,879.00
(+0.29%)
21,922.16
(99.80%)
📈 view plot
🚷 view threshold
100.00
(+8.25%)
112.26
(89.08%)
📈 view plot
🚷 view threshold
379.00
(-0.07%)
384.62
(98.54%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Nov 14, 2024

🐰 Bencher Report

Branch2024-11-12-sv1-mining-device-lib
Testbedsv1

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
serialize_deserialize_subscribeL2 Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
45.00
(+20.83%)
44.41
(101.34%)
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,206.00
(-3.07%)
8,734.53
(93.95%)
📈 view plot
🚷 view threshold
3,663.00
(-2.33%)
3,853.10
(95.07%)
📈 view plot
🚷 view threshold
5,116.00
(-2.71%)
5,418.59
(94.42%)
📈 view plot
🚷 view threshold
9.00
(+24.54%)
13.09
(68.74%)
📈 view plot
🚷 view threshold
87.00
(-3.98%)
95.24
(91.35%)
get_submit📈 view plot
🚷 view threshold
95,048.00
(-0.41%)
95,896.08
(99.12%)
📈 view plot
🚷 view threshold
59,263.00
(-0.33%)
59,674.14
(99.31%)
📈 view plot
🚷 view threshold
85,083.00
(-0.38%)
85,744.07
(99.23%)
📈 view plot
🚷 view threshold
47.00
(+4.54%)
63.99
(73.45%)
📈 view plot
🚷 view threshold
278.00
(-0.76%)
289.20
(96.13%)
get_subscribe📈 view plot
🚷 view threshold
7,769.00
(-3.17%)
8,278.04
(93.85%)
📈 view plot
🚷 view threshold
2,758.00
(-2.76%)
2,934.44
(93.99%)
📈 view plot
🚷 view threshold
3,834.00
(-3.27%)
4,113.98
(93.19%)
📈 view plot
🚷 view threshold
17.00
(+41.67%)
20.82
(81.65%)
📈 view plot
🚷 view threshold
110.00
(-3.74%)
118.68
(92.69%)
serialize_authorize📈 view plot
🚷 view threshold
11,965.00
(-2.59%)
12,569.06
(95.19%)
📈 view plot
🚷 view threshold
5,240.00
(-1.54%)
5,420.93
(96.66%)
📈 view plot
🚷 view threshold
7,285.00
(-1.84%)
7,577.44
(96.14%)
📈 view plot
🚷 view threshold
12.00
(+30.95%)
16.37
(73.30%)
📈 view plot
🚷 view threshold
132.00
(-4.06%)
142.84
(92.41%)
serialize_deserialize_authorize📈 view plot
🚷 view threshold
24,406.00
(-1.15%)
25,234.88
(96.72%)
📈 view plot
🚷 view threshold
9,786.00
(-1.08%)
10,029.19
(97.58%)
📈 view plot
🚷 view threshold
13,791.00
(-1.26%)
14,177.30
(97.28%)
📈 view plot
🚷 view threshold
37.00
(+6.79%)
43.58
(84.90%)
📈 view plot
🚷 view threshold
298.00
(-1.13%)
315.33
(94.51%)
serialize_deserialize_handle_authorize📈 view plot
🚷 view threshold
30,205.00
(-0.39%)
30,757.06
(98.21%)
📈 view plot
🚷 view threshold
11,989.00
(-0.78%)
12,199.16
(98.28%)
📈 view plot
🚷 view threshold
16,950.00
(-0.94%)
17,284.49
(98.06%)
📈 view plot
🚷 view threshold
61.00
(+9.83%)
67.37
(90.55%)
📈 view plot
🚷 view threshold
370.00
(+0.12%)
381.72
(96.93%)
serialize_deserialize_handle_submit📈 view plot
🚷 view threshold
126,226.00
(-0.20%)
126,894.71
(99.47%)
📈 view plot
🚷 view threshold
73,117.00
(-0.23%)
73,503.77
(99.47%)
📈 view plot
🚷 view threshold
104,766.00
(-0.29%)
105,424.25
(99.38%)
📈 view plot
🚷 view threshold
113.00
(+5.51%)
133.41
(84.70%)
📈 view plot
🚷 view threshold
597.00
(+0.11%)
605.10
(98.66%)
serialize_deserialize_handle_subscribe📈 view plot
🚷 view threshold
27,781.00
(-0.20%)
28,611.51
(97.10%)
📈 view plot
🚷 view threshold
9,577.00
(-0.76%)
9,748.60
(98.24%)
📈 view plot
🚷 view threshold
13,516.00
(-0.98%)
13,800.26
(97.94%)
📈 view plot
🚷 view threshold
74.00
(+16.58%)
76.15
(97.17%)
📈 view plot
🚷 view threshold
397.00
(+0.19%)
416.98
(95.21%)
serialize_deserialize_submit📈 view plot
🚷 view threshold
114,851.00
(-0.34%)
115,800.33
(99.18%)
📈 view plot
🚷 view threshold
67,894.00
(-0.31%)
68,388.92
(99.28%)
📈 view plot
🚷 view threshold
97,371.00
(-0.37%)
98,211.36
(99.14%)
📈 view plot
🚷 view threshold
66.00
(+5.21%)
78.27
(84.32%)
📈 view plot
🚷 view threshold
490.00
(-0.25%)
498.43
(98.31%)
serialize_deserialize_subscribe📈 view plot
🚷 view threshold
23,026.00
(-0.99%)
24,000.21
(95.94%)
📈 view plot
🚷 view threshold
8,129.00
(-0.93%)
8,303.96
(97.89%)
📈 view plot
🚷 view threshold
11,426.00
(-1.14%)
11,705.70
(97.61%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
45.00
(+20.83%)
44.41
(101.34%)
📈 view plot
🚷 view threshold
325.00
(-1.20%)
348.07
(93.37%)
serialize_submit📈 view plot
🚷 view threshold
99,395.00
(-0.45%)
100,300.65
(99.10%)
📈 view plot
🚷 view threshold
61,325.00
(-0.30%)
61,708.51
(99.38%)
📈 view plot
🚷 view threshold
87,945.00
(-0.35%)
88,579.14
(99.28%)
📈 view plot
🚷 view threshold
50.00
(+6.70%)
64.74
(77.24%)
📈 view plot
🚷 view threshold
320.00
(-1.45%)
333.76
(95.88%)
serialize_subscribe📈 view plot
🚷 view threshold
11,138.00
(-2.33%)
11,680.69
(95.35%)
📈 view plot
🚷 view threshold
4,111.00
(-1.74%)
4,277.99
(96.10%)
📈 view plot
🚷 view threshold
5,698.00
(-2.11%)
5,967.22
(95.49%)
📈 view plot
🚷 view threshold
17.00
(+31.80%)
20.91
(81.29%)
📈 view plot
🚷 view threshold
153.00
(-2.97%)
163.37
(93.65%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

@Shourya742 Shourya742 left a comment

Choose a reason for hiding this comment

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

Minor nits and a few follow-ups. Everything else looks good.

roles/test-utils/sv1-mining-device/Cargo.toml Outdated Show resolved Hide resolved
roles/test-utils/sv1-mining-device/Cargo.toml Outdated Show resolved Hide resolved
roles/test-utils/sv1-mining-device/src/client.rs Outdated Show resolved Hide resolved
roles/test-utils/sv1-mining-device/src/main.rs Outdated Show resolved Hide resolved
roles/Cargo.lock Outdated Show resolved Hide resolved
@jbesraa jbesraa force-pushed the 2024-11-12-sv1-mining-device-lib branch from 9546fe3 to 5dabd1a Compare November 17, 2024 16:30
version = "0.1.0"
authors = ["The Stratum V2 Developers"]
edition = "2021"
edition = "2018"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed this to keep it consistent with all of the other roles, we should upgrade all of them to 2021 at some point

Copy link

codecov bot commented Nov 17, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 19.30%. Comparing base (40c93c8) to head (747ac05).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
roles/test-utils/mining-device-sv1/src/client.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1249   +/-   ##
=======================================
  Coverage   19.30%   19.30%           
=======================================
  Files         164      164           
  Lines       10849    10849           
=======================================
  Hits         2094     2094           
  Misses       8755     8755           
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.01% <ø> (ø)
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 7.79% <ø> (ø)
job_declaration_sv2-coverage 0.00% <ø> (ø)
key-utils-coverage 2.39% <ø> (ø)
mining-coverage 2.49% <ø> (ø)
mining_device-coverage 0.00% <ø> (ø)
mining_proxy_sv2-coverage 0.70% <ø> (ø)
noise_sv2-coverage 4.35% <ø> (ø)
pool_sv2-coverage 1.38% <ø> (ø)
protocols 24.72% <ø> (ø)
roles 6.55% <0.00%> (ø)
roles_logic_sv2-coverage 8.06% <ø> (ø)
sv1-mining-device-coverage ?
sv2_ffi-coverage 0.00% <ø> (ø)
template_distribution_sv2-coverage 0.00% <ø> (ø)
translator_sv2-coverage 9.60% <ø> (ø)
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.


🚨 Try these New Features:

@jbesraa jbesraa force-pushed the 2024-11-12-sv1-mining-device-lib branch 3 times, most recently from 9794605 to 19be06f Compare November 19, 2024 16:05
@plebhash
Copy link
Collaborator

overall LGTM

let's fix MSRV and move forward for merging

@jbesraa jbesraa force-pushed the 2024-11-12-sv1-mining-device-lib branch 2 times, most recently from 49ce24c to 3d4dc4b Compare November 20, 2024 08:17
@jbesraa
Copy link
Contributor Author

jbesraa commented Nov 20, 2024

Addressed comments and fixed MSRV

@plebhash plebhash force-pushed the 2024-11-12-sv1-mining-device-lib branch 2 times, most recently from 57fc96a to f229265 Compare November 20, 2024 20:24
@plebhash plebhash force-pushed the 2024-11-12-sv1-mining-device-lib branch from f229265 to 747ac05 Compare November 20, 2024 21:35
@plebhash plebhash merged commit e650561 into stratum-mining:main Nov 20, 2024
37 of 38 checks passed
@jbesraa
Copy link
Contributor Author

jbesraa commented Nov 21, 2024

Thanks @plebhash

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.

Create library for mining-device-sv1
3 participants