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

Framing crate refactor: cleanup framing.rs #982

Merged
merged 4 commits into from
Jul 5, 2024

Conversation

jbesraa
Copy link
Contributor

@jbesraa jbesraa commented Jun 19, 2024

framing-sv2 Crate refactor p2, first part here #976

Partially resolves #903

This is part two of the refactor of framing-sv2 crate.

Code changes:

  • Rename framing2.rs to framing.rs
  • Reorder framing.rs file
  • Remove unused functions from HandShakeFrame
  • Rename framing::EitherFrame to framing::Frame

@jbesraa jbesraa changed the title Framing crate refactor: cleanup frames.rs Framing crate refactor: cleanup framing.rs Jun 19, 2024
Copy link
Contributor

github-actions bot commented Jun 19, 2024

🐰Bencher

ReportThu, July 4, 2024 at 06:09:49 UTC
ProjectStratum v2 (SRI)
Branch2024-06-19-framing-refactor-p2
Testbedsv2
Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client_sv2_handle_message_common✅ (view plot)44.82 (+0.57%)45.24 (99.06%)
client_sv2_handle_message_mining✅ (view plot)72.63 (-0.33%)80.34 (90.40%)
client_sv2_mining_message_submit_standard✅ (view plot)14.65 (-0.07%)14.71 (99.55%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)261.91 (-0.86%)283.54 (92.37%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)601.35 (+1.13%)628.00 (95.76%)
client_sv2_open_channel✅ (view plot)166.98 (+0.77%)171.35 (97.45%)
client_sv2_open_channel_serialize✅ (view plot)271.48 (-4.02%)293.44 (92.52%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)376.36 (-0.51%)423.42 (88.89%)
client_sv2_setup_connection✅ (view plot)155.34 (-5.27%)174.99 (88.77%)
client_sv2_setup_connection_serialize✅ (view plot)442.62 (-6.46%)507.44 (87.23%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)972.75 (+0.37%)1,037.33 (93.77%)

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

Copy link
Contributor

github-actions bot commented Jun 19, 2024

🐰Bencher

ReportThu, July 4, 2024 at 06:09:44 UTC
ProjectStratum v2 (SRI)
Branch982/merge
Testbedsv1

🚨 1 ALERT: Threshold Boundary Limit exceeded!
BenchmarkMeasure (units)ViewValueLower BoundaryUpper Boundary
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handleLatency (nanoseconds (ns))🚨 (view plot | view alert)798.73 (+6.69%)781.94 (102.15%)

Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client-submit-serialize✅ (view plot)6,547.80 (-5.17%)7,369.66 (88.85%)
client-submit-serialize-deserialize✅ (view plot)7,392.80 (-5.53%)8,339.96 (88.64%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle✅ (view plot)8,030.90 (-4.28%)8,868.13 (90.56%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle✅ (view plot)905.45 (+0.76%)926.41 (97.74%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize✅ (view plot)706.16 (+1.26%)718.33 (98.31%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize✅ (view plot)247.07 (-0.44%)255.16 (96.83%)
client-sv1-get-authorize/client-sv1-get-authorize✅ (view plot)157.91 (+0.45%)162.35 (97.26%)
client-sv1-get-submit✅ (view plot)6,230.10 (-6.59%)7,156.54 (87.05%)
client-sv1-get-subscribe/client-sv1-get-subscribe✅ (view plot)279.48 (+0.34%)290.88 (96.08%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle🚨 (view plot | view alert)798.73 (+6.69%)781.94 (102.15%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize✅ (view plot)617.36 (+0.55%)637.01 (96.91%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize✅ (view plot)202.03 (-2.20%)219.60 (92.00%)

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

Copy link
Contributor

github-actions bot commented Jun 19, 2024

🐰Bencher

ReportThu, July 4, 2024 at 06:09:52 UTC
ProjectStratum v2 (SRI)
Branch2024-06-19-framing-refactor-p2
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.62%)24.23 (107.30%)
client_sv2_mining_message_submit_standard_serializeL2 Accesses (accesses)🚨 (view plot | view alert)55.00 (+15.59%)53.39 (103.01%)
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.93%)83.35 (100.77%)
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.20 (97.64%)✅ (view plot)473.00 (+0.48%)486.30 (97.27%)✅ (view plot)732.00 (-0.02%)755.02 (96.95%)✅ (view plot)10.00 (+42.12%)10.88 (91.87%)✅ (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.76 (98.34%)✅ (view plot)1,750.00 (+0.03%)1,763.06 (99.26%)✅ (view plot)2,547.00 (-0.25%)2,575.67 (98.89%)🚨 (view plot | view alert)26.00 (+45.62%)24.23 (107.30%)✅ (view plot)103.00 (-0.77%)106.87 (96.38%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)14,623.00 (-0.99%)15,032.99 (97.27%)✅ (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.59%)53.39 (103.01%)✅ (view plot)217.00 (-2.35%)230.01 (94.34%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)27,435.00 (-0.15%)27,839.62 (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.19%)90.13 (99.86%)✅ (view plot)331.00 (-1.10%)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.42 (96.82%)✅ (view plot)5,064.00 (+0.02%)5,077.33 (99.74%)✅ (view plot)7,321.00 (+0.04%)7,339.24 (99.75%)✅ (view plot)42.00 (+12.24%)42.36 (99.15%)✅ (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.38 (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.93%)83.35 (100.77%)✅ (view plot)298.00 (-2.08%)314.98 (94.61%)
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.41%)35,748.24 (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 (+9.98%)113.65 (96.79%)✅ (view plot)372.00 (-1.93%)385.11 (96.60%)

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

Copy link
Contributor

github-actions bot commented Jun 19, 2024

🐰Bencher

ReportThu, July 4, 2024 at 06:09:44 UTC
ProjectStratum v2 (SRI)
Branch2024-06-19-framing-refactor-p2
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,725.76 (97.46%)✅ (view plot)3,746.00 (+0.13%)3,855.61 (97.16%)✅ (view plot)5,249.00 (+0.06%)5,402.03 (97.17%)✅ (view plot)7.00 (-11.11%)10.54 (66.39%)✅ (view plot)92.00 (+2.14%)94.06 (97.81%)
get_submit✅ (view plot)95,475.00 (-0.08%)96,137.25 (99.31%)✅ (view plot)59,439.00 (-0.05%)59,776.69 (99.44%)✅ (view plot)85,360.00 (-0.05%)85,833.90 (99.45%)✅ (view plot)49.00 (-10.82%)62.77 (78.06%)✅ (view plot)282.00 (-0.03%)287.66 (98.03%)
get_subscribe✅ (view plot)7,957.00 (-0.25%)8,268.72 (96.23%)✅ (view plot)2,841.00 (+0.37%)2,940.32 (96.62%)✅ (view plot)3,972.00 (+0.43%)4,100.70 (96.86%)✅ (view plot)13.00 (-19.11%)20.06 (64.79%)✅ (view plot)112.00 (-0.55%)116.90 (95.81%)
serialize_authorize✅ (view plot)12,257.00 (+0.40%)12,503.35 (98.03%)✅ (view plot)5,317.00 (+0.09%)5,426.61 (97.98%)✅ (view plot)7,412.00 (+0.05%)7,565.38 (97.97%)✅ (view plot)10.00 (-6.82%)13.50 (74.07%)✅ (view plot)137.00 (+1.04%)140.24 (97.69%)
serialize_deserialize_authorize✅ (view plot)24,554.00 (+0.34%)24,711.27 (99.36%)✅ (view plot)9,898.00 (-0.02%)10,026.16 (98.72%)✅ (view plot)13,959.00 (-0.06%)14,150.92 (98.64%)✅ (view plot)33.00 (-9.50%)41.78 (78.98%)✅ (view plot)298.00 (+1.04%)298.00 (100.00%)
serialize_deserialize_handle_authorize✅ (view plot)30,293.00 (+0.47%)30,352.50 (99.80%)✅ (view plot)12,101.00 (+0.04%)12,210.61 (99.10%)✅ (view plot)17,118.00 (-0.00%)17,280.26 (99.06%)✅ (view plot)59.00 (+0.46%)64.61 (91.32%)🚨 (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,601.65 (99.48%)✅ (view plot)9,643.00 (+0.11%)9,742.32 (98.98%)✅ (view plot)13,642.00 (+0.13%)13,776.59 (99.02%)✅ (view plot)61.00 (-7.20%)73.90 (82.54%)✅ (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.05%)23,110.78 (99.04%)✅ (view plot)8,195.00 (+0.10%)8,297.95 (98.76%)✅ (view plot)11,543.00 (+0.11%)11,683.69 (98.80%)✅ (view plot)36.00 (-8.36%)44.26 (81.33%)✅ (view plot)319.00 (+0.15%)321.48 (99.23%)
serialize_submit✅ (view plot)99,792.00 (-0.10%)100,465.40 (99.33%)✅ (view plot)61,483.00 (-0.05%)61,826.04 (99.45%)✅ (view plot)88,207.00 (-0.05%)88,687.40 (99.46%)✅ (view plot)49.00 (-11.77%)62.60 (78.27%)✅ (view plot)324.00 (-0.20%)329.15 (98.44%)
serialize_subscribe✅ (view plot)11,294.00 (-0.29%)11,604.52 (97.32%)✅ (view plot)4,188.00 (+0.25%)4,287.32 (97.68%)✅ (view plot)5,829.00 (+0.27%)5,959.85 (97.80%)✅ (view plot)15.00 (-7.89%)19.14 (78.35%)✅ (view plot)154.00 (-0.77%)159.72 (96.42%)

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

@jbesraa jbesraa mentioned this pull request Jun 23, 2024
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.

Looks great. Very happy to see the renaming. Looks like you need to update this branch with main, then we can merge.

@rrybarczyk rrybarczyk added protocols Lowest level protocol logic refactor Implies refactoring code labels Jul 1, 2024
@jbesraa
Copy link
Contributor Author

jbesraa commented Jul 1, 2024

Looks great. Very happy to see the renaming. Looks like you need to update this branch with main, then we can merge.

Thank you!

This PR is part two of the refactor, #976 (part one) should reviewed and merged first, so I would appreciate your review there as well. thanks!

@plebhash
Copy link
Collaborator

plebhash commented Jul 1, 2024

Looks great. Very happy to see the renaming. Looks like you need to update this branch with main, then we can merge.

do you mean dev?

@jbesraa jbesraa force-pushed the 2024-06-19-framing-refactor-p2 branch from c778bd3 to 811c93d Compare July 3, 2024 15:40
@jbesraa
Copy link
Contributor Author

jbesraa commented Jul 3, 2024

rebased without further changes

@jbesraa jbesraa force-pushed the 2024-06-19-framing-refactor-p2 branch from 811c93d to e307172 Compare July 4, 2024 06:05
@rrybarczyk rrybarczyk self-requested a review July 5, 2024 19:42
@plebhash plebhash merged commit 5a2b01b into stratum-mining:dev Jul 5, 2024
13 checks passed
@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
protocols Lowest level protocol logic refactor Implies refactoring code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants