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

Sniffer::wait_for_message_count #1283

Closed

Conversation

plebhash
Copy link
Collaborator

@plebhash plebhash commented Dec 10, 2024

close #1282

this PR adds a new method Sniffer::wait_for_message_count which takes two parameters:

  • message_direction: MessageDirection
  • count: usize

the function will return execution as soon as there's some expected number of messages stored on some Sniffer FIFO (ToUpstream or ToDownstream)

this can be used to hold the execution of the tokio runtime of some Integration Test

it's useful when we don't know beforehand how long it could take to e.g.: find a share

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 19.30%. Comparing base (04caafb) to head (e0a52b0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1283   +/-   ##
=======================================
  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.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.49% <ø> (-0.02%) ⬇️
mining_device-coverage 0.00% <ø> (ø)
mining_proxy_sv2-coverage 0.70% <ø> (ø)
noise_sv2-coverage 4.34% <ø> (-0.02%) ⬇️
pool_sv2-coverage 1.38% <ø> (ø)
protocols 24.72% <ø> (ø)
roles 6.55% <ø> (ø)
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

github-actions bot commented Dec 10, 2024

🐰 Bencher Report

Branchsniffer_wait_for_message_count
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.45
(-0.42%)
46.94
(94.70%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
81.92
(+7.73%)
91.57
(89.46%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
14.65
(-0.08%)
14.77
(99.20%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
271.24
(+2.74%)
296.98
(91.33%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
598.95
(-2.32%)
684.00
(87.57%)
client_sv2_open_channel📈 view plot
🚷 view threshold
174.50
(+10.24%)
197.89
(88.18%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
278.55
(-2.29%)
312.01
(89.28%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
389.75
(+1.56%)
416.81
(93.51%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
160.56
(+0.28%)
168.54
(95.27%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
465.89
(-1.13%)
554.37
(84.04%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
1,006.80
(+1.96%)
1,091.68
(92.22%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Dec 10, 2024

🐰 Bencher Report

Branchsniffer_wait_for_message_count
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,542.00
(-1.76%)
7,192.88
(90.95%)
client-submit-serialize-deserialize📈 view plot
🚷 view threshold
7,336.80
(-2.86%)
8,176.05
(89.74%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle📈 view plot
🚷 view threshold
8,042.10
(-1.06%)
8,664.91
(92.81%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle📈 view plot
🚷 view threshold
868.58
(+0.60%)
919.47
(94.46%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize📈 view plot
🚷 view threshold
661.17
(-1.59%)
711.39
(92.94%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize📈 view plot
🚷 view threshold
248.38
(-0.19%)
270.87
(91.70%)
client-sv1-get-authorize/client-sv1-get-authorize📈 view plot
🚷 view threshold
157.04
(+0.03%)
162.13
(96.86%)
client-sv1-get-submit📈 view plot
🚷 view threshold
6,265.50
(-2.95%)
7,198.03
(87.04%)
client-sv1-get-subscribe/client-sv1-get-subscribe📈 view plot
🚷 view threshold
276.24
(-0.95%)
302.41
(91.35%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle📈 view plot
🚷 view threshold
719.74
(-1.08%)
780.71
(92.19%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize📈 view plot
🚷 view threshold
579.41
(-1.95%)
637.57
(90.88%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize📈 view plot
🚷 view threshold
206.00
(+0.15%)
215.06
(95.79%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Dec 10, 2024

🐰 Bencher Report

Branchsniffer_wait_for_message_count
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,376.00
(-1.01%)
8,730.81
(95.94%)
📈 view plot
🚷 view threshold
3,663.00
(-2.16%)
3,870.16
(94.65%)
📈 view plot
🚷 view threshold
5,111.00
(-2.60%)
5,451.99
(93.75%)
📈 view plot
🚷 view threshold
9.00
(+21.26%)
14.27
(63.06%)
📈 view plot
🚷 view threshold
92.00
(+1.34%)
95.64
(96.19%)
get_submit📈 view plot
🚷 view threshold
95,294.00
(-0.13%)
95,867.82
(99.40%)
📈 view plot
🚷 view threshold
59,263.00
(-0.31%)
59,717.68
(99.24%)
📈 view plot
🚷 view threshold
85,074.00
(-0.36%)
85,822.93
(99.13%)
📈 view plot
🚷 view threshold
49.00
(+10.09%)
61.74
(79.36%)
📈 view plot
🚷 view threshold
285.00
(+1.67%)
290.16
(98.22%)
get_subscribe📈 view plot
🚷 view threshold
7,893.00
(-1.53%)
8,279.59
(95.33%)
📈 view plot
🚷 view threshold
2,758.00
(-2.53%)
2,947.77
(93.56%)
📈 view plot
🚷 view threshold
3,833.00
(-3.03%)
4,140.98
(92.56%)
📈 view plot
🚷 view threshold
14.00
(+17.28%)
20.47
(68.40%)
📈 view plot
🚷 view threshold
114.00
(-0.33%)
118.62
(96.11%)
serialize_authorize📈 view plot
🚷 view threshold
12,165.00
(-0.94%)
12,566.22
(96.81%)
📈 view plot
🚷 view threshold
5,240.00
(-1.42%)
5,436.49
(96.39%)
📈 view plot
🚷 view threshold
7,280.00
(-1.76%)
7,608.54
(95.68%)
📈 view plot
🚷 view threshold
11.00
(+18.72%)
16.97
(64.82%)
📈 view plot
🚷 view threshold
138.00
(+0.12%)
142.57
(96.80%)
serialize_deserialize_authorize📈 view plot
🚷 view threshold
24,598.00
(-0.42%)
25,209.41
(97.57%)
📈 view plot
🚷 view threshold
9,786.00
(-0.99%)
10,046.01
(97.41%)
📈 view plot
🚷 view threshold
13,788.00
(-1.18%)
14,212.83
(97.01%)
📈 view plot
🚷 view threshold
34.00
(-1.96%)
43.75
(77.71%)
📈 view plot
🚷 view threshold
304.00
(+0.61%)
314.72
(96.59%)
serialize_deserialize_handle_authorize📈 view plot
🚷 view threshold
30,189.00
(-0.45%)
30,747.38
(98.18%)
📈 view plot
🚷 view threshold
11,989.00
(-0.71%)
12,212.74
(98.17%)
📈 view plot
🚷 view threshold
16,954.00
(-0.84%)
17,315.87
(97.91%)
📈 view plot
🚷 view threshold
57.00
(+2.67%)
67.03
(85.04%)
📈 view plot
🚷 view threshold
370.00
(-0.02%)
381.28
(97.04%)
serialize_deserialize_handle_submit📈 view plot
🚷 view threshold
126,464.00
(-0.01%)
126,893.71
(99.66%)
📈 view plot
🚷 view threshold
73,117.00
(-0.22%)
73,534.62
(99.43%)
📈 view plot
🚷 view threshold
104,759.00
(-0.28%)
105,485.83
(99.31%)
📈 view plot
🚷 view threshold
113.00
(+6.15%)
129.33
(87.37%)
📈 view plot
🚷 view threshold
604.00
(+1.18%)
607.24
(99.47%)
serialize_deserialize_handle_subscribe📈 view plot
🚷 view threshold
27,829.00
(-0.12%)
28,569.01
(97.41%)
📈 view plot
🚷 view threshold
9,577.00
(-0.70%)
9,761.33
(98.11%)
📈 view plot
🚷 view threshold
13,519.00
(-0.89%)
13,826.92
(97.77%)
📈 view plot
🚷 view threshold
69.00
(+8.53%)
76.07
(90.70%)
📈 view plot
🚷 view threshold
399.00
(+0.44%)
415.86
(95.95%)
serialize_deserialize_submit📈 view plot
🚷 view threshold
115,181.00
(-0.06%)
115,782.05
(99.48%)
📈 view plot
🚷 view threshold
67,894.00
(-0.30%)
68,421.72
(99.23%)
📈 view plot
🚷 view threshold
97,356.00
(-0.37%)
98,277.44
(99.06%)
📈 view plot
🚷 view threshold
72.00
(+14.20%)
80.59
(89.34%)
📈 view plot
🚷 view threshold
499.00
(+1.43%)
501.03
(99.60%)
serialize_deserialize_subscribe📈 view plot
🚷 view threshold
23,202.00
(-0.35%)
23,947.21
(96.89%)
📈 view plot
🚷 view threshold
8,129.00
(-0.87%)
8,318.12
(97.73%)
📈 view plot
🚷 view threshold
11,427.00
(-1.06%)
11,735.51
(97.37%)
📈 view plot
🚷 view threshold
38.00
(+1.65%)
45.05
(84.34%)
📈 view plot
🚷 view threshold
331.00
(+0.33%)
346.58
(95.51%)
serialize_submit📈 view plot
🚷 view threshold
99,751.00
(-0.09%)
100,292.63
(99.46%)
📈 view plot
🚷 view threshold
61,325.00
(-0.28%)
61,747.23
(99.32%)
📈 view plot
🚷 view threshold
87,931.00
(-0.34%)
88,653.84
(99.18%)
📈 view plot
🚷 view threshold
54.00
(+15.41%)
64.78
(83.36%)
📈 view plot
🚷 view threshold
330.00
(+1.51%)
335.33
(98.41%)
serialize_subscribe📈 view plot
🚷 view threshold
11,372.00
(-0.31%)
11,676.33
(97.39%)
📈 view plot
🚷 view threshold
4,111.00
(-1.60%)
4,289.95
(95.83%)
📈 view plot
🚷 view threshold
5,692.00
(-2.03%)
5,993.86
(94.96%)
📈 view plot
🚷 view threshold
16.00
(+23.15%)
21.60
(74.06%)
📈 view plot
🚷 view threshold
160.00
(+1.22%)
163.71
(97.74%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Dec 10, 2024

🐰 Bencher Report

Branchsniffer_wait_for_message_count
Testbedsv2

🚨 3 Alerts

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
client_sv2_mining_message_submit_standard_serialize_deserializeL2 Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
95.00
(+15.90%)
93.08
(102.06%)
client_sv2_open_channel_serializeL2 Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
46.00
(+30.06%)
45.08
(102.05%)
client_sv2_open_channel_serialize_deserializeL2 Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
88.00
(+17.69%)
86.49
(101.75%)
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,065.00
(-1.63%)
2,214.93
(93.23%)
📈 view plot
🚷 view threshold
473.00
(-0.09%)
488.63
(96.80%)
📈 view plot
🚷 view threshold
735.00
(-0.14%)
757.33
(97.05%)
📈 view plot
🚷 view threshold
7.00
(+33.73%)
13.31
(52.58%)
📈 view plot
🚷 view threshold
37.00
(-3.15%)
41.37
(89.44%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
8,314.00
(+1.30%)
8,317.42
(99.96%)
📈 view plot
🚷 view threshold
2,137.00
(-0.03%)
2,143.08
(99.72%)
📈 view plot
🚷 view threshold
3,154.00
(-0.21%)
3,170.89
(99.47%)
📈 view plot
🚷 view threshold
38.00
(+7.47%)
41.27
(92.07%)
📈 view plot
🚷 view threshold
142.00
(+2.06%)
142.11
(99.92%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
6,267.00
(-0.29%)
6,411.75
(97.74%)
📈 view plot
🚷 view threshold
1,750.00
(-0.06%)
1,766.96
(99.04%)
📈 view plot
🚷 view threshold
2,547.00
(-0.25%)
2,575.71
(98.89%)
📈 view plot
🚷 view threshold
23.00
(+35.42%)
24.45
(94.08%)
📈 view plot
🚷 view threshold
103.00
(-1.15%)
107.72
(95.61%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
14,722.00
(-0.01%)
14,937.01
(98.56%)
📈 view plot
🚷 view threshold
4,694.00
(-0.02%)
4,710.96
(99.64%)
📈 view plot
🚷 view threshold
6,747.00
(-0.17%)
6,783.10
(99.47%)
📈 view plot
🚷 view threshold
55.00
(+25.47%)
55.79
(98.58%)
📈 view plot
🚷 view threshold
220.00
(-0.60%)
226.88
(96.97%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
27,702.00
(+0.56%)
27,878.94
(99.37%)
📈 view plot
🚷 view threshold
10,645.00
(+0.51%)
10,668.75
(99.78%)
📈 view plot
🚷 view threshold
15,502.00
(+0.58%)
15,541.54
(99.75%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
95.00
(+15.90%)
93.08
(102.06%)
📈 view plot
🚷 view threshold
335.00
(-0.00%)
341.45
(98.11%)
client_sv2_open_channel📈 view plot
🚷 view threshold
4,387.00
(-0.05%)
4,569.55
(96.01%)
📈 view plot
🚷 view threshold
1,461.00
(-0.03%)
1,476.63
(98.94%)
📈 view plot
🚷 view threshold
2,157.00
(-0.16%)
2,183.62
(98.78%)
📈 view plot
🚷 view threshold
12.00
(+39.26%)
16.22
(74.00%)
📈 view plot
🚷 view threshold
62.00
(-0.71%)
67.35
(92.05%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
13,954.00
(-0.56%)
14,303.81
(97.55%)
📈 view plot
🚷 view threshold
5,064.00
(-0.01%)
5,079.63
(99.69%)
📈 view plot
🚷 view threshold
7,319.00
(-0.10%)
7,350.90
(99.57%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
46.00
(+30.06%)
45.08
(102.05%)
📈 view plot
🚷 view threshold
183.00
(-1.89%)
194.41
(94.13%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
22,734.00
(+0.30%)
22,924.45
(99.17%)
📈 view plot
🚷 view threshold
8,040.00
(+0.18%)
8,068.48
(99.65%)
📈 view plot
🚷 view threshold
11,689.00
(+0.11%)
11,740.92
(99.56%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
88.00
(+17.69%)
86.49
(101.75%)
📈 view plot
🚷 view threshold
303.00
(-0.10%)
310.19
(97.68%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
4,681.00
(-0.09%)
4,779.00
(97.95%)
📈 view plot
🚷 view threshold
1,502.00
(-0.03%)
1,517.63
(98.97%)
📈 view plot
🚷 view threshold
2,276.00
(-0.11%)
2,299.21
(98.99%)
📈 view plot
🚷 view threshold
12.00
(+24.37%)
16.54
(72.53%)
📈 view plot
🚷 view threshold
67.00
(-0.58%)
69.89
(95.86%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
16,120.00
(-0.24%)
16,400.81
(98.29%)
📈 view plot
🚷 view threshold
5,963.00
(-0.01%)
5,978.63
(99.74%)
📈 view plot
🚷 view threshold
8,655.00
(-0.11%)
8,690.99
(99.59%)
📈 view plot
🚷 view threshold
51.00
(+27.75%)
53.58
(95.19%)
📈 view plot
🚷 view threshold
206.00
(-1.16%)
214.73
(95.93%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
35,658.00
(+0.27%)
35,815.48
(99.56%)
📈 view plot
🚷 view threshold
14,888.00
(+0.21%)
14,912.13
(99.84%)
📈 view plot
🚷 view threshold
21,868.00
(+0.19%)
21,921.93
(99.75%)
📈 view plot
🚷 view threshold
112.00
(+21.33%)
112.33
(99.71%)
📈 view plot
🚷 view threshold
378.00
(-0.33%)
384.86
(98.22%)
🐰 View full continuous benchmarking report in Bencher

@plebhash plebhash force-pushed the sniffer_wait_for_message_count branch 2 times, most recently from d1c03d9 to ffbf3b7 Compare December 10, 2024 07:25
@plebhash plebhash force-pushed the sniffer_wait_for_message_count branch from ffbf3b7 to e0a52b0 Compare December 10, 2024 07:27
@plebhash
Copy link
Collaborator Author

closing in favor of #1284

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integration Test execution cannot finish before shares are found
1 participant