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

fix GetSize for SubmitSolutionJd #1019

Merged

Conversation

plebhash
Copy link
Collaborator

fix #1018

the GetSize implementation is not accounting for self.version.get_size()!

that is causing NoiseEncoder to allocate a buffer that's smaller than what is actually needed, which eventually triggers FramingSv2Error(BinarySv2Error(WriteError)) during encoding
@plebhash plebhash linked an issue Jun 28, 2024 that may be closed by this pull request
Copy link
Contributor

🐰Bencher

ReportFri, June 28, 2024 at 00:52:59 UTC
ProjectStratum v2 (SRI)
Branch1018-fix-getsize-submitsolutionjd
Testbedsv2
Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client_sv2_handle_message_common✅ (view plot)44.09 (-1.04%)45.25 (97.43%)
client_sv2_handle_message_mining✅ (view plot)74.45 (+2.16%)80.48 (92.51%)
client_sv2_mining_message_submit_standard✅ (view plot)14.64 (-0.06%)14.69 (99.67%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)264.54 (+0.08%)284.03 (93.14%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)591.73 (-0.41%)628.02 (94.22%)
client_sv2_open_channel✅ (view plot)165.45 (-0.11%)171.30 (96.59%)
client_sv2_open_channel_serialize✅ (view plot)282.47 (-0.30%)293.09 (96.38%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)376.90 (-0.40%)424.40 (88.81%)
client_sv2_setup_connection✅ (view plot)161.30 (-1.73%)175.00 (92.17%)
client_sv2_setup_connection_serialize✅ (view plot)455.28 (-4.10%)505.54 (90.06%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)975.40 (+0.49%)1,038.38 (93.93%)

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

Copy link
Contributor

🐰Bencher

ReportFri, June 28, 2024 at 00:52:59 UTC
ProjectStratum v2 (SRI)
Branch1018-fix-getsize-submitsolutionjd
Testbedsv2

🚨 14 ALERTS: Threshold Boundary Limits exceeded!
BenchmarkMeasure (units)ViewValueLower BoundaryUpper Boundary
client_sv2_handle_message_commonL2 Accesses (accesses)🚨 (view plot | view alert)11.00 (+58.86%)10.65 (103.29%)
client_sv2_mining_message_submit_standardL2 Accesses (accesses)🚨 (view plot | view alert)27.00 (+53.87%)23.09 (116.93%)
client_sv2_mining_message_submit_standard_serializeL2 Accesses (accesses)🚨 (view plot | view alert)56.00 (+18.34%)52.51 (106.65%)
client_sv2_mining_message_submit_standard_serialize_deserializeInstructions (instructions)🚨 (view plot | view alert)10,585.00 (+0.41%)10,563.46 (100.20%)
client_sv2_mining_message_submit_standard_serialize_deserializeL1 Accesses (accesses)🚨 (view plot | view alert)15,398.00 (+0.38%)15,367.91 (100.20%)
client_sv2_mining_message_submit_standard_serialize_deserializeL2 Accesses (accesses)🚨 (view plot | view alert)90.00 (+7.48%)89.50 (100.56%)
client_sv2_open_channel_serializeL2 Accesses (accesses)🚨 (view plot | view alert)43.00 (+15.45%)41.91 (102.60%)
client_sv2_open_channel_serialize_deserializeInstructions (instructions)🚨 (view plot | view alert)8,027.00 (+0.54%)8,005.91 (100.26%)
client_sv2_open_channel_serialize_deserializeL1 Accesses (accesses)🚨 (view plot | view alert)11,671.00 (+0.49%)11,643.07 (100.24%)
client_sv2_open_channel_serialize_deserializeL2 Accesses (accesses)🚨 (view plot | view alert)85.00 (+15.90%)82.17 (103.44%)
client_sv2_setup_connectionL2 Accesses (accesses)🚨 (view plot | view alert)15.00 (+65.28%)13.59 (110.35%)
client_sv2_setup_connection_serializeL2 Accesses (accesses)🚨 (view plot | view alert)50.00 (+12.00%)49.11 (101.82%)
client_sv2_setup_connection_serialize_deserializeInstructions (instructions)🚨 (view plot | view alert)14,855.00 (+0.30%)14,833.10 (100.15%)
client_sv2_setup_connection_serialize_deserializeL1 Accesses (accesses)🚨 (view plot | view alert)21,811.00 (+0.28%)21,779.64 (100.14%)

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,081.00 (+1.55%)2,126.91 (97.84%)✅ (view plot)473.00 (+0.50%)486.49 (97.23%)✅ (view plot)731.00 (-0.16%)755.48 (96.76%)🚨 (view plot | view alert)11.00 (+58.86%)10.65 (103.29%)✅ (view plot)37.00 (+0.98%)38.57 (95.94%)
client_sv2_handle_message_mining✅ (view plot)8,257.00 (+0.73%)8,339.11 (99.02%)✅ (view plot)2,137.00 (+0.47%)2,171.53 (98.41%)✅ (view plot)3,157.00 (+0.40%)3,216.37 (98.15%)✅ (view plot)40.00 (+3.77%)43.68 (91.57%)✅ (view plot)140.00 (+0.82%)142.04 (98.56%)
client_sv2_mining_message_submit_standard✅ (view plot)6,320.00 (+0.70%)6,391.01 (98.89%)✅ (view plot)1,750.00 (+0.03%)1,763.31 (99.25%)✅ (view plot)2,545.00 (-0.34%)2,576.20 (98.79%)🚨 (view plot | view alert)27.00 (+53.87%)23.09 (116.93%)✅ (view plot)104.00 (+0.15%)106.95 (97.24%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)14,695.00 (-0.55%)15,036.12 (97.73%)✅ (view plot)4,694.00 (+0.01%)4,707.31 (99.72%)✅ (view plot)6,750.00 (-0.06%)6,775.48 (99.62%)🚨 (view plot | view alert)56.00 (+18.34%)52.51 (106.65%)✅ (view plot)219.00 (-1.54%)230.03 (95.21%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)27,503.00 (+0.09%)27,848.62 (98.76%)🚨 (view plot | view alert)10,585.00 (+0.41%)10,563.46 (100.20%)🚨 (view plot | view alert)15,398.00 (+0.38%)15,367.91 (100.20%)🚨 (view plot | view alert)90.00 (+7.48%)89.50 (100.56%)✅ (view plot)333.00 (-0.55%)345.43 (96.40%)
client_sv2_open_channel✅ (view plot)4,417.00 (-1.67%)4,612.01 (95.77%)✅ (view plot)1,461.00 (+0.06%)1,474.58 (99.08%)✅ (view plot)2,157.00 (+0.20%)2,173.12 (99.26%)✅ (view plot)11.00 (-8.19%)15.27 (72.05%)✅ (view plot)63.00 (-3.27%)68.20 (92.38%)
client_sv2_open_channel_serialize✅ (view plot)14,010.00 (-1.46%)14,463.93 (96.86%)✅ (view plot)5,064.00 (+0.02%)5,077.58 (99.73%)✅ (view plot)7,320.00 (+0.03%)7,339.50 (99.73%)🚨 (view plot | view alert)43.00 (+15.45%)41.91 (102.60%)✅ (view plot)185.00 (-3.55%)198.97 (92.98%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)22,561.00 (-0.35%)23,028.31 (97.97%)🚨 (view plot | view alert)8,027.00 (+0.54%)8,005.91 (100.26%)🚨 (view plot | view alert)11,671.00 (+0.49%)11,643.07 (100.24%)🚨 (view plot | view alert)85.00 (+15.90%)82.17 (103.44%)✅ (view plot)299.00 (-1.83%)315.11 (94.89%)
client_sv2_setup_connection✅ (view plot)4,659.00 (-0.84%)4,765.49 (97.77%)✅ (view plot)1,502.00 (+0.06%)1,515.58 (99.10%)✅ (view plot)2,274.00 (-0.12%)2,299.96 (98.87%)🚨 (view plot | view alert)15.00 (+65.28%)13.59 (110.35%)✅ (view plot)66.00 (-2.78%)69.65 (94.75%)
client_sv2_setup_connection_serialize✅ (view plot)15,946.00 (-1.96%)16,493.85 (96.68%)✅ (view plot)5,963.00 (+0.01%)5,976.58 (99.77%)✅ (view plot)8,661.00 (+0.07%)8,677.77 (99.81%)🚨 (view plot | view alert)50.00 (+12.00%)49.11 (101.82%)✅ (view plot)201.00 (-4.76%)217.61 (92.37%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)35,416.00 (-0.33%)35,749.53 (99.07%)🚨 (view plot | view alert)14,855.00 (+0.30%)14,833.10 (100.15%)🚨 (view plot | view alert)21,811.00 (+0.28%)21,779.64 (100.14%)✅ (view plot)110.00 (+10.40%)112.90 (97.43%)✅ (view plot)373.00 (-1.73%)384.65 (96.97%)

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

Copy link
Contributor

🐰Bencher

ReportFri, June 28, 2024 at 00:53:01 UTC
ProjectStratum v2 (SRI)
Branch1019/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)780.48 (+4.36%)779.21 (100.16%)

Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client-submit-serialize✅ (view plot)6,556.80 (-5.39%)7,344.05 (89.28%)
client-submit-serialize-deserialize✅ (view plot)7,387.90 (-5.86%)8,335.56 (88.63%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle✅ (view plot)8,068.30 (-4.15%)8,838.80 (91.28%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle✅ (view plot)908.31 (+1.06%)927.16 (97.97%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize✅ (view plot)703.42 (+0.89%)718.19 (97.94%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize✅ (view plot)244.70 (-1.35%)255.20 (95.88%)
client-sv1-get-authorize/client-sv1-get-authorize✅ (view plot)157.49 (+0.21%)162.46 (96.94%)
client-sv1-get-submit✅ (view plot)6,272.00 (-6.29%)7,143.50 (87.80%)
client-sv1-get-subscribe/client-sv1-get-subscribe✅ (view plot)282.90 (+1.50%)291.46 (97.06%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle🚨 (view plot | view alert)780.48 (+4.36%)779.21 (100.16%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize✅ (view plot)604.05 (-1.63%)637.65 (94.73%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize✅ (view plot)201.29 (-2.56%)220.01 (91.49%)

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

Copy link
Contributor

🐰Bencher

ReportFri, June 28, 2024 at 00:53:02 UTC
ProjectStratum v2 (SRI)
Branch1018-fix-getsize-submitsolutionjd
Testbedsv1

🚨 2 ALERTS: Threshold Boundary Limits exceeded!
BenchmarkMeasure (units)ViewValueLower BoundaryUpper Boundary
serialize_deserialize_authorizeRAM Accesses (accesses)🚨 (view plot | view alert)298.00 (+1.08%)297.68 (100.11%)
serialize_deserialize_handle_authorizeRAM Accesses (accesses)🚨 (view plot | view alert)368.00 (+1.15%)366.93 (100.29%)

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.82%)8,726.41 (97.45%)✅ (view plot)3,746.00 (+0.15%)3,856.71 (97.13%)✅ (view plot)5,249.00 (+0.08%)5,403.56 (97.14%)✅ (view plot)7.00 (-12.09%)10.43 (67.14%)✅ (view plot)92.00 (+2.22%)93.99 (97.88%)
get_submit✅ (view plot)95,475.00 (-0.08%)96,150.28 (99.30%)✅ (view plot)59,439.00 (-0.05%)59,783.10 (99.42%)✅ (view plot)85,360.00 (-0.05%)85,842.85 (99.44%)✅ (view plot)49.00 (-11.27%)62.56 (78.33%)✅ (view plot)282.00 (-0.03%)287.77 (98.00%)
get_subscribe✅ (view plot)7,957.00 (-0.25%)8,274.50 (96.16%)✅ (view plot)2,841.00 (+0.40%)2,940.93 (96.60%)✅ (view plot)3,972.00 (+0.47%)4,100.96 (96.86%)✅ (view plot)13.00 (-19.95%)19.79 (65.67%)✅ (view plot)112.00 (-0.58%)117.00 (95.73%)
serialize_authorize✅ (view plot)12,257.00 (+0.42%)12,505.51 (98.01%)✅ (view plot)5,317.00 (+0.11%)5,427.71 (97.96%)✅ (view plot)7,412.00 (+0.06%)7,566.90 (97.95%)✅ (view plot)10.00 (-7.53%)13.41 (74.56%)✅ (view plot)137.00 (+1.08%)140.24 (97.69%)
serialize_deserialize_authorize✅ (view plot)24,554.00 (+0.35%)24,709.02 (99.37%)✅ (view plot)9,898.00 (-0.02%)10,027.94 (98.70%)✅ (view plot)13,959.00 (-0.06%)14,153.69 (98.62%)✅ (view plot)33.00 (-9.95%)41.63 (79.27%)🚨 (view plot | view alert)298.00 (+1.08%)297.68 (100.11%)
serialize_deserialize_handle_authorize✅ (view plot)30,297.00 (+0.51%)30,340.07 (99.86%)✅ (view plot)12,101.00 (+0.05%)12,211.71 (99.09%)✅ (view plot)17,117.00 (-0.00%)17,282.15 (99.04%)✅ (view plot)60.00 (+2.08%)64.76 (92.66%)🚨 (view plot | view alert)368.00 (+1.15%)366.93 (100.29%)
serialize_deserialize_handle_submit✅ (view plot)126,406.00 (-0.00%)127,039.86 (99.50%)✅ (view plot)73,224.00 (-0.04%)73,625.57 (99.45%)✅ (view plot)104,946.00 (-0.04%)105,519.60 (99.46%)✅ (view plot)120.00 (-0.43%)131.43 (91.31%)✅ (view plot)596.00 (+0.20%)599.25 (99.46%)
serialize_deserialize_handle_subscribe✅ (view plot)27,495.00 (+0.15%)27,603.05 (99.61%)✅ (view plot)9,643.00 (+0.12%)9,742.93 (98.97%)✅ (view plot)13,640.00 (+0.13%)13,777.01 (99.01%)✅ (view plot)62.00 (-6.01%)73.89 (83.91%)✅ (view plot)387.00 (+0.32%)388.58 (99.59%)
serialize_deserialize_submit✅ (view plot)114,999.00 (-0.07%)115,661.80 (99.43%)✅ (view plot)68,001.00 (-0.08%)68,408.16 (99.40%)✅ (view plot)97,559.00 (-0.09%)98,158.49 (99.39%)✅ (view plot)65.00 (-6.50%)75.30 (86.32%)✅ (view plot)489.00 (+0.19%)492.41 (99.31%)
serialize_deserialize_subscribe✅ (view plot)22,888.00 (+0.06%)23,114.02 (99.02%)✅ (view plot)8,195.00 (+0.11%)8,298.75 (98.75%)✅ (view plot)11,543.00 (+0.12%)11,684.51 (98.79%)✅ (view plot)36.00 (-8.78%)44.10 (81.64%)✅ (view plot)319.00 (+0.15%)321.52 (99.22%)
serialize_submit✅ (view plot)99,792.00 (-0.10%)100,478.53 (99.32%)✅ (view plot)61,483.00 (-0.05%)61,832.56 (99.43%)✅ (view plot)88,207.00 (-0.05%)88,696.48 (99.45%)✅ (view plot)49.00 (-12.24%)62.20 (78.78%)✅ (view plot)324.00 (-0.21%)329.25 (98.41%)
serialize_subscribe✅ (view plot)11,294.00 (-0.29%)11,610.40 (97.27%)✅ (view plot)4,188.00 (+0.27%)4,287.93 (97.67%)✅ (view plot)5,829.00 (+0.30%)5,960.23 (97.80%)✅ (view plot)15.00 (-8.47%)19.00 (78.96%)✅ (view plot)154.00 (-0.80%)159.82 (96.36%)

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

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.

ACK d5592c3

@GitGab19 GitGab19 merged commit 29c9acc into stratum-mining:dev Jun 28, 2024
13 checks passed
@plebhash plebhash deleted the 1018-fix-getsize-submitsolutionjd branch June 28, 2024 12:21
@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.

GetSize implementation for SubmitSolutionJd is incomplete
3 participants