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

add ActionResult::SustainConnection to MG #1024

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

plebhash
Copy link
Collaborator

@plebhash plebhash commented Jul 1, 2024

close #1023 and unblock #1025

this allows for MG to verify that a connection was not closed

it also refactors some parts of Executor::execute by moving some logic to the arms of match result, which improves code readability

@plebhash plebhash changed the title add ActionResult::SustainConnection add ActionResult::SustainConnection to MG Jul 1, 2024
@plebhash plebhash requested a review from lorbax July 1, 2024 20:28
Copy link
Contributor

github-actions bot commented Jul 1, 2024

🐰Bencher

ReportTue, July 9, 2024 at 14:04:50 UTC
ProjectStratum v2 (SRI)
Branch1023-mg-sustain-connection
Testbedsv2

🚨 1 ALERT: Threshold Boundary Limit exceeded!
BenchmarkMeasure (units)ViewValueLower BoundaryUpper Boundary
client_sv2_handle_message_commonLatency (nanoseconds (ns))🚨 (view plot | view alert)45.36 (+1.77%)45.29 (100.17%)

Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client_sv2_handle_message_common🚨 (view plot | view alert)45.36 (+1.77%)45.29 (100.17%)
client_sv2_handle_message_mining✅ (view plot)74.41 (+2.08%)80.38 (92.58%)
client_sv2_mining_message_submit_standard✅ (view plot)14.67 (+0.10%)14.69 (99.83%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)258.01 (-2.40%)283.99 (90.85%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)594.04 (-0.11%)628.35 (94.54%)
client_sv2_open_channel✅ (view plot)163.83 (-1.29%)173.44 (94.46%)
client_sv2_open_channel_serialize✅ (view plot)275.07 (-2.71%)293.77 (93.64%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)373.48 (-1.26%)423.37 (88.22%)
client_sv2_setup_connection✅ (view plot)161.71 (-1.47%)174.79 (92.52%)
client_sv2_setup_connection_serialize✅ (view plot)445.66 (-5.84%)507.12 (87.88%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)991.69 (+2.03%)1,039.59 (95.39%)

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

Copy link
Contributor

github-actions bot commented Jul 1, 2024

🐰Bencher

ReportTue, July 9, 2024 at 14:04:56 UTC
ProjectStratum v2 (SRI)
Branch1023-mg-sustain-connection
Testbedsv1

🚨 1 ALERT: Threshold Boundary Limit exceeded!
BenchmarkMeasure (units)ViewValueLower BoundaryUpper Boundary
serialize_deserialize_handle_authorizeRAM Accesses (accesses)🚨 (view plot | view alert)368.00 (+1.11%)367.43 (100.16%)

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,504.00 (+0.79%)8,724.64 (97.47%)✅ (view plot)3,746.00 (+0.15%)3,854.74 (97.18%)✅ (view plot)5,249.00 (+0.08%)5,400.71 (97.19%)✅ (view plot)7.00 (-11.71%)10.37 (67.47%)✅ (view plot)92.00 (+2.14%)94.06 (97.81%)
get_submit✅ (view plot)95,475.00 (-0.08%)96,137.00 (99.31%)✅ (view plot)59,439.00 (-0.05%)59,776.31 (99.44%)✅ (view plot)85,360.00 (-0.05%)85,833.32 (99.45%)✅ (view plot)49.00 (-10.91%)62.60 (78.28%)✅ (view plot)282.00 (-0.03%)287.66 (98.03%)
get_subscribe✅ (view plot)7,957.00 (-0.25%)8,268.26 (96.24%)✅ (view plot)2,841.00 (+0.39%)2,939.32 (96.65%)✅ (view plot)3,972.00 (+0.45%)4,099.02 (96.90%)✅ (view plot)13.00 (-19.38%)19.83 (65.54%)✅ (view plot)112.00 (-0.55%)116.90 (95.81%)
serialize_authorize✅ (view plot)12,257.00 (+0.41%)12,502.37 (98.04%)✅ (view plot)5,317.00 (+0.10%)5,425.74 (98.00%)✅ (view plot)7,412.00 (+0.06%)7,564.06 (97.99%)✅ (view plot)10.00 (-7.28%)13.35 (74.89%)✅ (view plot)137.00 (+1.04%)140.24 (97.69%)
serialize_deserialize_authorize✅ (view plot)24,554.00 (+0.34%)24,709.87 (99.37%)✅ (view plot)9,898.00 (-0.02%)10,025.45 (98.73%)✅ (view plot)13,959.00 (-0.05%)14,149.90 (98.65%)✅ (view plot)33.00 (-9.63%)41.61 (79.31%)✅ (view plot)298.00 (+1.04%)298.00 (100.00%)
serialize_deserialize_handle_authorize✅ (view plot)30,293.00 (+0.47%)30,350.23 (99.81%)✅ (view plot)12,101.00 (+0.05%)12,209.74 (99.11%)✅ (view plot)17,118.00 (+0.00%)17,279.06 (99.07%)✅ (view plot)59.00 (+0.36%)64.65 (91.26%)🚨 (view plot | view alert)368.00 (+1.11%)367.43 (100.16%)
serialize_deserialize_handle_submit✅ (view plot)126,372.00 (-0.03%)127,026.75 (99.48%)✅ (view plot)73,224.00 (-0.04%)73,617.68 (99.47%)✅ (view plot)104,947.00 (-0.04%)105,508.32 (99.47%)✅ (view plot)120.00 (-0.41%)131.20 (91.46%)✅ (view plot)595.00 (+0.03%)599.17 (99.30%)
serialize_deserialize_handle_subscribe✅ (view plot)27,457.00 (+0.01%)27,600.33 (99.48%)✅ (view plot)9,643.00 (+0.11%)9,741.32 (98.99%)✅ (view plot)13,642.00 (+0.14%)13,774.98 (99.03%)✅ (view plot)61.00 (-7.27%)73.80 (82.65%)✅ (view plot)386.00 (+0.06%)388.53 (99.35%)
serialize_deserialize_submit✅ (view plot)114,999.00 (-0.07%)115,648.79 (99.44%)✅ (view plot)68,001.00 (-0.08%)68,400.22 (99.42%)✅ (view plot)97,559.00 (-0.09%)98,146.90 (99.40%)✅ (view plot)65.00 (-6.28%)75.30 (86.32%)✅ (view plot)489.00 (+0.18%)492.37 (99.32%)
serialize_deserialize_subscribe✅ (view plot)22,888.00 (+0.06%)23,110.03 (99.04%)✅ (view plot)8,195.00 (+0.11%)8,297.00 (98.77%)✅ (view plot)11,543.00 (+0.12%)11,682.16 (98.81%)✅ (view plot)36.00 (-8.49%)44.08 (81.67%)✅ (view plot)319.00 (+0.15%)321.48 (99.23%)
serialize_submit✅ (view plot)99,792.00 (-0.10%)100,465.23 (99.33%)✅ (view plot)61,483.00 (-0.05%)61,825.66 (99.45%)✅ (view plot)88,207.00 (-0.05%)88,686.81 (99.46%)✅ (view plot)49.00 (-11.85%)62.38 (78.55%)✅ (view plot)324.00 (-0.20%)329.15 (98.44%)
serialize_subscribe✅ (view plot)11,294.00 (-0.28%)11,604.16 (97.33%)✅ (view plot)4,188.00 (+0.26%)4,286.32 (97.71%)✅ (view plot)5,829.00 (+0.29%)5,958.20 (97.83%)✅ (view plot)15.00 (-8.20%)18.95 (79.14%)✅ (view plot)154.00 (-0.77%)159.72 (96.42%)

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

Copy link
Contributor

github-actions bot commented Jul 1, 2024

🐰Bencher

ReportTue, July 9, 2024 at 14:04:50 UTC
ProjectStratum v2 (SRI)
Branch1024/merge
Testbedsv1
Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client-submit-serialize✅ (view plot)6,585.90 (-4.81%)7,353.37 (89.56%)
client-submit-serialize-deserialize✅ (view plot)7,493.00 (-4.41%)8,331.41 (89.94%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle✅ (view plot)8,067.70 (-4.03%)8,843.22 (91.23%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle✅ (view plot)902.45 (+0.44%)926.32 (97.42%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize✅ (view plot)702.28 (+0.75%)717.76 (97.84%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize✅ (view plot)246.16 (-0.74%)255.07 (96.51%)
client-sv1-get-authorize/client-sv1-get-authorize✅ (view plot)157.63 (+0.32%)162.38 (97.08%)
client-sv1-get-submit✅ (view plot)6,336.30 (-5.19%)7,144.54 (88.69%)
client-sv1-get-subscribe/client-sv1-get-subscribe✅ (view plot)278.26 (-0.14%)291.11 (95.58%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle✅ (view plot)765.15 (+2.34%)777.08 (98.46%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize✅ (view plot)625.11 (+1.73%)637.85 (98.00%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize✅ (view plot)201.65 (-2.36%)219.77 (91.76%)

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

Copy link
Contributor

github-actions bot commented Jul 1, 2024

🐰Bencher

ReportTue, July 9, 2024 at 14:04:53 UTC
ProjectStratum v2 (SRI)
Branch1023-mg-sustain-connection
Testbedsv2

🚨 10 ALERTS: Threshold Boundary Limits exceeded!
BenchmarkMeasure (units)ViewValueLower BoundaryUpper Boundary
client_sv2_mining_message_submit_standardL2 Accesses (accesses)🚨 (view plot | view alert)26.00 (+45.92%)24.01 (108.29%)
client_sv2_mining_message_submit_standard_serializeL2 Accesses (accesses)🚨 (view plot | view alert)55.00 (+15.63%)53.28 (103.23%)
client_sv2_mining_message_submit_standard_serialize_deserializeInstructions (instructions)🚨 (view plot | view alert)10,585.00 (+0.39%)10,570.57 (100.14%)
client_sv2_mining_message_submit_standard_serialize_deserializeL1 Accesses (accesses)🚨 (view plot | view alert)15,400.00 (+0.38%)15,378.49 (100.14%)
client_sv2_open_channel_serialize_deserializeInstructions (instructions)🚨 (view plot | view alert)8,027.00 (+0.52%)8,012.93 (100.18%)
client_sv2_open_channel_serialize_deserializeL1 Accesses (accesses)🚨 (view plot | view alert)11,673.00 (+0.49%)11,652.92 (100.17%)
client_sv2_open_channel_serialize_deserializeL2 Accesses (accesses)🚨 (view plot | view alert)84.00 (+13.96%)83.25 (100.90%)
client_sv2_setup_connectionL2 Accesses (accesses)🚨 (view plot | view alert)15.00 (+61.45%)14.30 (104.91%)
client_sv2_setup_connection_serialize_deserializeInstructions (instructions)🚨 (view plot | view alert)14,855.00 (+0.29%)14,840.35 (100.10%)
client_sv2_setup_connection_serialize_deserializeL1 Accesses (accesses)🚨 (view plot | view alert)21,812.00 (+0.27%)21,790.18 (100.10%)

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,077.00 (+1.30%)2,127.60 (97.62%)✅ (view plot)473.00 (+0.48%)486.30 (97.27%)✅ (view plot)732.00 (-0.02%)754.99 (96.95%)✅ (view plot)10.00 (+41.39%)11.08 (90.23%)✅ (view plot)37.00 (+0.94%)38.55 (95.99%)
client_sv2_handle_message_mining✅ (view plot)8,219.00 (+0.26%)8,335.97 (98.60%)✅ (view plot)2,137.00 (+0.45%)2,171.21 (98.42%)✅ (view plot)3,159.00 (+0.45%)3,215.79 (98.23%)✅ (view plot)39.00 (+1.13%)43.60 (89.44%)✅ (view plot)139.00 (+0.10%)141.95 (97.92%)
client_sv2_mining_message_submit_standard✅ (view plot)6,282.00 (+0.10%)6,387.60 (98.35%)✅ (view plot)1,750.00 (+0.03%)1,763.06 (99.26%)✅ (view plot)2,547.00 (-0.26%)2,575.66 (98.89%)🚨 (view plot | view alert)26.00 (+45.92%)24.01 (108.29%)✅ (view plot)103.00 (-0.77%)106.87 (96.38%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)14,623.00 (-1.00%)15,032.32 (97.28%)✅ (view plot)4,694.00 (+0.01%)4,707.06 (99.72%)✅ (view plot)6,753.00 (-0.02%)6,775.04 (99.67%)🚨 (view plot | view alert)55.00 (+15.63%)53.28 (103.23%)✅ (view plot)217.00 (-2.36%)229.98 (94.36%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)27,435.00 (-0.15%)27,839.99 (98.55%)🚨 (view plot | view alert)10,585.00 (+0.39%)10,570.57 (100.14%)🚨 (view plot | view alert)15,400.00 (+0.38%)15,378.49 (100.14%)✅ (view plot)90.00 (+7.21%)90.04 (99.96%)✅ (view plot)331.00 (-1.11%)345.19 (95.89%)
client_sv2_open_channel✅ (view plot)4,417.00 (-1.61%)4,610.64 (95.80%)✅ (view plot)1,461.00 (+0.05%)1,474.33 (99.10%)✅ (view plot)2,157.00 (+0.19%)2,172.95 (99.27%)✅ (view plot)11.00 (-7.91%)15.19 (72.41%)✅ (view plot)63.00 (-3.16%)68.17 (92.41%)
client_sv2_open_channel_serialize✅ (view plot)14,006.00 (-1.43%)14,465.07 (96.83%)✅ (view plot)5,064.00 (+0.02%)5,077.33 (99.74%)✅ (view plot)7,321.00 (+0.04%)7,339.19 (99.75%)✅ (view plot)42.00 (+12.14%)42.58 (98.65%)✅ (view plot)185.00 (-3.43%)199.08 (92.93%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)22,523.00 (-0.50%)23,019.30 (97.84%)🚨 (view plot | view alert)8,027.00 (+0.52%)8,012.93 (100.18%)🚨 (view plot | view alert)11,673.00 (+0.49%)11,652.92 (100.17%)🚨 (view plot | view alert)84.00 (+13.96%)83.25 (100.90%)✅ (view plot)298.00 (-2.08%)314.96 (94.62%)
client_sv2_setup_connection✅ (view plot)4,659.00 (-0.81%)4,764.55 (97.78%)✅ (view plot)1,502.00 (+0.05%)1,515.33 (99.12%)✅ (view plot)2,274.00 (-0.12%)2,299.44 (98.89%)🚨 (view plot | view alert)15.00 (+61.45%)14.30 (104.91%)✅ (view plot)66.00 (-2.68%)69.70 (94.69%)
client_sv2_setup_connection_serialize✅ (view plot)15,942.00 (-1.92%)16,511.34 (96.55%)✅ (view plot)5,963.00 (+0.01%)5,976.33 (99.78%)✅ (view plot)8,662.00 (+0.08%)8,677.75 (99.82%)✅ (view plot)49.00 (+9.38%)49.50 (98.98%)✅ (view plot)201.00 (-4.60%)218.24 (92.10%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)35,382.00 (-0.42%)35,747.32 (98.98%)🚨 (view plot | view alert)14,855.00 (+0.29%)14,840.35 (100.10%)🚨 (view plot | view alert)21,812.00 (+0.27%)21,790.18 (100.10%)✅ (view plot)110.00 (+10.00%)113.57 (96.85%)✅ (view plot)372.00 (-1.93%)385.03 (96.62%)

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

@Fi3
Copy link
Collaborator

Fi3 commented Jul 2, 2024

Can you add something about this new check in the readme? How and when to use it?

@plebhash
Copy link
Collaborator Author

plebhash commented Jul 2, 2024

Can you add something about this new check in the readme? How and when to use it?

I'm looking around but I cannot find any place where the other Action Results are described. Should we create a new section on utils/message-generator/README.md?

@Fi3
Copy link
Collaborator

Fi3 commented Jul 2, 2024

Can you add something about this new check in the readme? How and when to use it?

I'm looking around but I cannot find any place where the other Action Results are described. Should we create a new section on utils/message-generator/README.md?

yep I would add it in the action section

@plebhash
Copy link
Collaborator Author

plebhash commented Jul 2, 2024

Can you add something about this new check in the readme? How and when to use it?

I'm looking around but I cannot find any place where the other Action Results are described. Should we create a new section on utils/message-generator/README.md?

yep I would add it in the action section

great, I added a new issue #1027 for this, since I don't think it makes sense to document all possible Action Results under this PR.

I also wrote a comment about rationale and usage of SustainConnection there for future reference.

For now, @Fi3 would you mind carrying on with the review on this PR without those docs? It would be good to get it merged in order to unblock #1025

@Fi3
Copy link
Collaborator

Fi3 commented Jul 2, 2024

Can you add something about this new check in the readme? How and when to use it?

I'm looking around but I cannot find any place where the other Action Results are described. Should we create a new section on utils/message-generator/README.md?

yep I would add it in the action section

great, I added a new issue #1027 for this, since I don't think it makes sense to document all possible Action Results under this PR.

I also wrote a comment about rationale and usage of SustainConnection there for future reference.

For now, @Fi3 would you mind carrying on with the review on this PR without those docs? It would be good to get it merged in order to unblock #1025

My only concern was adding something in readme about why we need it and how to use. Is ok with me to add it later. Everything else LGTM.

jbesraa

This comment was marked as outdated.

@plebhash plebhash force-pushed the 1023-mg-sustain-connection branch 3 times, most recently from 69c58a6 to d8cd5e6 Compare July 3, 2024 19:45
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.

Ah nice, this looks great. Added few small comments

utils/message-generator/src/executor.rs Show resolved Hide resolved
utils/message-generator/src/executor.rs Show resolved Hide resolved
utils/message-generator/src/executor.rs Outdated Show resolved Hide resolved
utils/message-generator/src/executor.rs Show resolved Hide resolved
utils/message-generator/src/executor.rs Show resolved Hide resolved
utils/message-generator/src/executor.rs Show resolved Hide resolved
utils/message-generator/src/executor.rs Show resolved Hide resolved
@plebhash plebhash force-pushed the 1023-mg-sustain-connection branch from d8cd5e6 to 43512cc Compare July 4, 2024 22:41
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.

Lgtm. Definitely more readable.

@plebhash plebhash requested a review from jbesraa July 5, 2024 21:41
@plebhash plebhash force-pushed the 1023-mg-sustain-connection branch from 43512cc to 43edba3 Compare July 8, 2024 20:34
@plebhash plebhash force-pushed the 1023-mg-sustain-connection branch from 43edba3 to 6fcdc1c Compare July 9, 2024 14:00
@plebhash plebhash merged commit 92a6fbf into stratum-mining:dev Jul 9, 2024
14 checks passed
@plebhash plebhash deleted the 1023-mg-sustain-connection branch July 9, 2024 14:24
@plebhash plebhash mentioned this pull request Aug 18, 2024
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.

MG action result that asserts connection was not dropped
4 participants