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

simplify [package.metadata.docs.rs] on protocols crates #1318

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

Conversation

plebhash
Copy link
Collaborator

@plebhash plebhash commented Dec 23, 2024

currently we are making sure all published protocols crates cover all of the crates features on Rust Docs

we enforce that by having the following on Cargo.toml of each crate:

[package.metadata.docs.rs]
all-features = true

this strategy was suggested on #1210 and implemented via #1211

during some discussions in #1311 @jbesraa pointed out that this strategy is a bit overengineered

I agree all-features is more generalistic than necessary, and it is causing trouble (e.g.: trying to build cargo b --all-features on template_distribution_sv2 breaks due to with_serde and prop_test being built together)

also, features like no_std and with_serde are being deprecated, so there's no point in wasting engineering effort on them


this PR is simplifying the [package.metadata.docs.rs] parameters

now, for each crate, we only enable publishing Rust Docs with features that are relevant for API usage, namely:

  • binary_sv2: features = ["core", "with_buffer_pool"]
  • binary_codec_sv2: features = ["with_buffer_pool"]
  • codec_sv2: features = ["with_buffer_pool", "noise_sv2"]
  • framing_sv2: features = ["with_buffer_pool"]

the following crates have no features that are relevant for API usage, and therefore we don't enforce anything on their Cargo.toml:

  • derive_codec_sv2
  • serde_sv2
  • const_sv2
  • noise_sv2
  • roles_logic_sv2
  • common_messages_sv2
  • job_declaration_sv2
  • mining_sv2
  • template_distribution_sv2
  • sv2_ffi
  • buffer_sv2

publishing with all-features is overengineering:
- no_std is being deprecated via stratum-mining#1315
- with_serde will be deprecated soon
- no point in publishing docs for code under prop_test
publishing with all-features is overengineering:
- no_std is being deprecated via stratum-mining#1315
- with_serde will be deprecated soon
publishing with all-features is overengineering:
- no_std is being deprecated via stratum-mining#1315
- with_serde will be deprecated soon
publishing with all-features is overengineering:
- no_std is being deprecated via stratum-mining#1315
- with_serde will be deprecated soon
- no point in publishing docs for code under prop_test
publishing with all-features is overengineering:
- no_std is being deprecated via stratum-mining#1315
- with_serde will be deprecated soon
- no point in publishing docs for code under prop_test or disable_nopanic
publishing with all-features is overengineering:
- with_serde will be deprecated soon
- no point in publishing docs for code under prop_test
this crate doesn't have any features
publishing with all-features is overengineering:
- with_serde will be deprecated soon
- it is sufficient to publish the docs with with_buffer_pool feature flag
this crate doesn't have any features
publishing with all-features is overengineering:
- no_std is being deprecated via stratum-mining#1315
- with_serde will be deprecated soon
- it is sufficient to publish the docs with noise_sv2 and with_buffer_pool feature flags
this crate doesn't have any features
publishing with all-features is overengineering:
- with_serde will be deprecated soon
- no point in publishing docs for code under prop_test feature
- it is sufficient to publish the docs with core and with_buffer_pool feature flags
publishing with all-features is overengineering:
- no_std is being deprecated
- with_serde will be deprecated soon
- it is sufficient to publish the docs with with_buffer_pool feature flag
this crate doesn't have any features
publishing with all-features is overengineering:
- with_serde will be deprecated soon
- no point in publishing docs for debug or fuzz features
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 19.29%. Comparing base (e8d76d6) to head (e7f7c93).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1318   +/-   ##
=======================================
  Coverage   19.29%   19.29%           
=======================================
  Files         164      164           
  Lines       10852    10852           
=======================================
  Hits         2094     2094           
  Misses       8758     8758           
Flag Coverage Δ
binary_codec_sv2-coverage 0.00% <ø> (ø)
binary_serde_sv2-coverage 3.65% <ø> (ø)
binary_sv2-coverage 5.48% <ø> (ø)
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.51% <ø> (+0.01%) ⬆️
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.54% <ø> (ø)
roles_logic_sv2-coverage 8.08% <ø> (ø)
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.

Copy link
Contributor

🐰 Bencher Report

Branchsimplify-doc-features
Testbedsv1
Click to view all benchmark results
BenchmarkEstimated CyclesBenchmark Result
estimated cycles
(Result Δ%)
Upper Boundary
1e3 x estimated cycles
(Limit %)
InstructionsBenchmark Result
instructions
(Result Δ%)
Upper Boundary
1e3 x instructions
(Limit %)
L1 AccessesBenchmark Result
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.41
(-0.47%)
8.67
(97.00%)
📈 view plot
🚷 view threshold
3.66
(-1.84%)
3.86
(94.85%)
📈 view plot
🚷 view threshold
5.11
(-2.23%)
5.45
(93.80%)
📈 view plot
🚷 view threshold
10.00
(+23.31%)
15.60
(64.12%)
📈 view plot
🚷 view threshold
93.00
(+2.10%)
96.03
(96.85%)
get_submit📈 view plot
🚷 view threshold
95.34
(-0.04%)
95.68
(99.65%)
📈 view plot
🚷 view threshold
59.26
(-0.26%)
59.71
(99.26%)
📈 view plot
🚷 view threshold
85.07
(-0.31%)
85.82
(99.13%)
📈 view plot
🚷 view threshold
51.00
(+14.93%)
59.91
(85.12%)
📈 view plot
🚷 view threshold
286.00
(+2.01%)
290.31
(98.51%)
get_subscribe📈 view plot
🚷 view threshold
7.92
(-0.99%)
8.24
(96.21%)
📈 view plot
🚷 view threshold
2.76
(-2.16%)
2.94
(93.70%)
📈 view plot
🚷 view threshold
3.83
(-2.57%)
4.14
(92.51%)
📈 view plot
🚷 view threshold
13.00
(+6.67%)
20.22
(64.29%)
📈 view plot
🚷 view threshold
115.00
(+0.45%)
117.78
(97.64%)
serialize_authorize📈 view plot
🚷 view threshold
12.20
(-0.54%)
12.51
(97.49%)
📈 view plot
🚷 view threshold
5.24
(-1.21%)
5.43
(96.56%)
📈 view plot
🚷 view threshold
7.28
(-1.49%)
7.60
(95.77%)
📈 view plot
🚷 view threshold
10.00
(+1.19%)
18.40
(54.34%)
📈 view plot
🚷 view threshold
139.00
(+0.90%)
142.27
(97.70%)
serialize_deserialize_authorize📈 view plot
🚷 view threshold
24.62
(-0.35%)
25.18
(97.79%)
📈 view plot
🚷 view threshold
9.79
(-0.80%)
10.02
(97.70%)
📈 view plot
🚷 view threshold
13.79
(-0.96%)
14.18
(97.25%)
📈 view plot
🚷 view threshold
32.00
(-10.08%)
45.59
(70.19%)
📈 view plot
🚷 view threshold
305.00
(+0.61%)
313.11
(97.41%)
serialize_deserialize_handle_authorize📈 view plot
🚷 view threshold
30.25
(-0.26%)
30.72
(98.44%)
📈 view plot
🚷 view threshold
11.99
(-0.57%)
12.19
(98.34%)
📈 view plot
🚷 view threshold
16.95
(-0.68%)
17.30
(98.01%)
📈 view plot
🚷 view threshold
54.00
(-2.85%)
66.95
(80.65%)
📈 view plot
🚷 view threshold
372.00
(+0.34%)
379.25
(98.09%)
serialize_deserialize_handle_submit📈 view plot
🚷 view threshold
126.46
(+0.00%)
126.78
(99.74%)
📈 view plot
🚷 view threshold
73.12
(-0.19%)
73.53
(99.44%)
📈 view plot
🚷 view threshold
104.75
(-0.25%)
105.49
(99.30%)
📈 view plot
🚷 view threshold
120.00
(+13.06%)
125.47
(95.64%)
📈 view plot
🚷 view threshold
603.00
(+0.95%)
608.10
(99.16%)
serialize_deserialize_handle_subscribe📈 view plot
🚷 view threshold
27.87
(-0.13%)
28.42
(98.08%)
📈 view plot
🚷 view threshold
9.58
(-0.62%)
9.76
(98.14%)
📈 view plot
🚷 view threshold
13.52
(-0.80%)
13.83
(97.70%)
📈 view plot
🚷 view threshold
71.00
(+10.56%)
77.46
(91.66%)
📈 view plot
🚷 view threshold
400.00
(+0.28%)
410.65
(97.41%)
serialize_deserialize_submit📈 view plot
🚷 view threshold
115.19
(-0.05%)
115.71
(99.54%)
📈 view plot
🚷 view threshold
67.89
(-0.26%)
68.41
(99.24%)
📈 view plot
🚷 view threshold
97.36
(-0.33%)
98.28
(99.06%)
📈 view plot
🚷 view threshold
73.00
(+13.30%)
85.72
(85.16%)
📈 view plot
🚷 view threshold
499.00
(+1.27%)
501.78
(99.45%)
serialize_deserialize_subscribe📈 view plot
🚷 view threshold
23.23
(-0.38%)
23.83
(97.47%)
📈 view plot
🚷 view threshold
8.13
(-0.76%)
8.31
(97.77%)
📈 view plot
🚷 view threshold
11.43
(-0.91%)
11.74
(97.31%)
📈 view plot
🚷 view threshold
37.00
(-3.88%)
50.23
(73.67%)
📈 view plot
🚷 view threshold
332.00
(+0.21%)
342.83
(96.84%)
serialize_submit📈 view plot
🚷 view threshold
99.79
(-0.00%)
100.13
(99.66%)
📈 view plot
🚷 view threshold
61.33
(-0.23%)
61.73
(99.34%)
📈 view plot
🚷 view threshold
87.93
(-0.29%)
88.64
(99.19%)
📈 view plot
🚷 view threshold
56.00
(+17.89%)
66.00
(84.85%)
📈 view plot
🚷 view threshold
331.00
(+1.83%)
335.60
(98.63%)
serialize_subscribe📈 view plot
🚷 view threshold
11.40
(+0.01%)
11.60
(98.29%)
📈 view plot
🚷 view threshold
4.11
(-1.36%)
4.28
(95.97%)
📈 view plot
🚷 view threshold
5.69
(-1.72%)
6.00
(94.92%)
📈 view plot
🚷 view threshold
15.00
(+11.37%)
23.08
(64.99%)
📈 view plot
🚷 view threshold
161.00
(+1.69%)
163.52
(98.46%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

🐰 Bencher Report

Branchsimplify-doc-features
Testbedsv2

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
client_sv2_open_channel_serialize_deserializeL2 Accesses
accesses
📈 plot
🚨 alert (🔕)
🚷 threshold
89.00
(+18.17%)
88.82
(100.20%)
Click to view all benchmark results
BenchmarkEstimated CyclesBenchmark Result
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.17
(+2.73%)
2.23
(97.29%)
📈 view plot
🚷 view threshold
473.00
(-0.05%)
488.92
(96.74%)
📈 view plot
🚷 view threshold
732.00
(-0.49%)
757.93
(96.58%)
📈 view plot
🚷 view threshold
7.00
(+40.44%)
11.97
(58.46%)
📈 view plot
🚷 view threshold
40.00
(+3.79%)
41.57
(96.23%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
8.28
(+0.72%)
8.38
(98.77%)
📈 view plot
🚷 view threshold
2,137.00
(-0.01%)
2,140.48
(99.84%)
📈 view plot
🚷 view threshold
3,155.00
(-0.13%)
3,169.17
(99.55%)
📈 view plot
🚷 view threshold
38.00
(+6.97%)
41.68
(91.16%)
📈 view plot
🚷 view threshold
141.00
(+1.05%)
144.04
(97.89%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
6.36
(+0.94%)
6.44
(98.68%)
📈 view plot
🚷 view threshold
1,750.00
(-0.02%)
1,766.19
(99.08%)
📈 view plot
🚷 view threshold
2,547.00
(-0.19%)
2,574.60
(98.93%)
📈 view plot
🚷 view threshold
20.00
(+17.11%)
24.26
(82.44%)
📈 view plot
🚷 view threshold
106.00
(+1.34%)
108.61
(97.60%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
14.79
(+0.43%)
14.93
(99.02%)
📈 view plot
🚷 view threshold
4,694.00
(-0.01%)
4,710.19
(99.66%)
📈 view plot
🚷 view threshold
6,746.00
(-0.15%)
6,785.75
(99.41%)
📈 view plot
🚷 view threshold
54.00
(+20.27%)
60.92
(88.64%)
📈 view plot
🚷 view threshold
222.00
(+0.36%)
226.37
(98.07%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
27.80
(+0.79%)
28.00
(99.27%)
📈 view plot
🚷 view threshold
10,645.00
(+0.40%)
10,686.96
(99.61%)
📈 view plot
🚷 view threshold
15,500.00
(+0.44%)
15,574.62
(99.52%)
📈 view plot
🚷 view threshold
94.00
(+13.06%)
97.96
(95.96%)
📈 view plot
🚷 view threshold
338.00
(+0.81%)
342.45
(98.70%)
client_sv2_open_channel📈 view plot
🚷 view threshold
4.49
(+2.18%)
4.56
(98.53%)
📈 view plot
🚷 view threshold
1,461.00
(-0.02%)
1,476.92
(98.92%)
📈 view plot
🚷 view threshold
2,154.00
(-0.30%)
2,183.67
(98.64%)
📈 view plot
🚷 view threshold
12.00
(+48.12%)
13.64
(88.00%)
📈 view plot
🚷 view threshold
65.00
(+3.78%)
67.15
(96.80%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
14.06
(+0.28%)
14.19
(99.04%)
📈 view plot
🚷 view threshold
5,064.00
(-0.00%)
5,079.92
(99.69%)
📈 view plot
🚷 view threshold
7,316.00
(-0.14%)
7,351.45
(99.52%)
📈 view plot
🚷 view threshold
46.00
(+27.69%)
47.34
(97.16%)
📈 view plot
🚷 view threshold
186.00
(-0.02%)
190.97
(97.40%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
22.94
(+1.12%)
23.01
(99.71%)
📈 view plot
🚷 view threshold
8,040.00
(+0.11%)
8,053.90
(99.83%)
📈 view plot
🚷 view threshold
11,682.00
(-0.01%)
11,711.07
(99.75%)
📈 view plot
🚨 view alert (🔕)
🚷 view threshold
89.00
(+18.17%)
88.82
(100.20%)
📈 view plot
🚷 view threshold
309.00
(+1.75%)
311.27
(99.27%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
4.75
(+1.39%)
4.79
(99.29%)
📈 view plot
🚷 view threshold
1,502.00
(-0.02%)
1,517.92
(98.95%)
📈 view plot
🚷 view threshold
2,273.00
(-0.23%)
2,299.55
(98.85%)
📈 view plot
🚷 view threshold
13.00
(+37.41%)
15.61
(83.29%)
📈 view plot
🚷 view threshold
69.00
(+2.22%)
70.06
(98.49%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
16.26
(+0.66%)
16.31
(99.67%)
📈 view plot
🚷 view threshold
5,963.00
(-0.00%)
5,978.92
(99.73%)
📈 view plot
🚷 view threshold
8,651.00
(-0.15%)
8,691.68
(99.53%)
📈 view plot
🚷 view threshold
51.00
(+27.43%)
54.35
(93.84%)
📈 view plot
🚷 view threshold
210.00
(+0.88%)
211.94
(99.08%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
35.80
(+0.60%)
35.90
(99.71%)
📈 view plot
🚷 view threshold
14,888.00
(+0.16%)
14,912.40
(99.84%)
📈 view plot
🚷 view threshold
21,863.00
(+0.11%)
21,910.69
(99.78%)
📈 view plot
🚷 view threshold
113.00
(+21.20%)
116.77
(96.77%)
📈 view plot
🚷 view threshold
382.00
(+0.68%)
385.11
(99.19%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

🐰 Bencher Report

Branchsimplify-doc-features
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,484.20
(-1.56%)
6,909.34
(93.85%)
client-submit-serialize-deserialize📈 view plot
🚷 view threshold
7,366.20
(-0.91%)
7,832.64
(94.04%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle📈 view plot
🚷 view threshold
7,896.20
(-2.56%)
9,279.54
(85.09%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle📈 view plot
🚷 view threshold
872.72
(+0.69%)
939.32
(92.91%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize📈 view plot
🚷 view threshold
667.68
(-0.93%)
715.41
(93.33%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize📈 view plot
🚷 view threshold
247.61
(-0.58%)
269.94
(91.73%)
client-sv1-get-authorize/client-sv1-get-authorize📈 view plot
🚷 view threshold
157.57
(+0.07%)
166.27
(94.77%)
client-sv1-get-submit📈 view plot
🚷 view threshold
6,249.70
(-1.80%)
6,750.28
(92.58%)
client-sv1-get-subscribe/client-sv1-get-subscribe📈 view plot
🚷 view threshold
281.15
(-0.33%)
323.66
(86.87%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle📈 view plot
🚷 view threshold
718.19
(-1.14%)
773.92
(92.80%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize📈 view plot
🚷 view threshold
583.40
(-0.98%)
625.42
(93.28%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize📈 view plot
🚷 view threshold
210.44
(+1.88%)
224.23
(93.85%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

🐰 Bencher Report

Branchsimplify-doc-features
Testbedsv2

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
client_sv2_setup_connectionLatency
nanoseconds (ns)
📈 plot
🚨 alert (🔔)
🚷 threshold
189.98
(+18.05%)
187.26
(101.45%)
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.36
(-1.78%)
58.56
(75.76%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
72.62
(-6.72%)
104.36
(69.59%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
14.67
(+0.08%)
14.71
(99.73%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
268.46
(+0.71%)
288.86
(92.94%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
615.92
(+0.51%)
645.95
(95.35%)
client_sv2_open_channel📈 view plot
🚷 view threshold
163.24
(-0.97%)
175.85
(92.83%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
286.45
(+0.36%)
308.88
(92.74%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
391.91
(+2.06%)
409.34
(95.74%)
client_sv2_setup_connection📈 view plot
🚨 view alert (🔔)
🚷 view threshold
189.98
(+18.05%)
187.26
(101.45%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
543.83
(+14.75%)
572.47
(95.00%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
982.27
(-1.71%)
1,142.44
(85.98%)
🐰 View full continuous benchmarking report in Bencher

@plebhash plebhash added the ci/cd CI/CD label Dec 23, 2024
@plebhash plebhash added this to the 1.2.0 milestone Dec 23, 2024
@plebhash plebhash requested a review from jbesraa December 23, 2024 08:11
Copy link
Contributor

@jbesraa jbesraa left a comment

Choose a reason for hiding this comment

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

Please make this a single commit. This makes ALOT of noise in the main branch.

@plebhash plebhash modified the milestones: 1.2.0, 1.3.0 Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd CI/CD
Projects
Status: Todo 📝
Development

Successfully merging this pull request may close these issues.

2 participants