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

Enhance SetupConnection Handling and Implement Protocol-Specific Flag Checks #918

Closed
wants to merge 13 commits into from

Conversation

xyephy
Copy link
Contributor

@xyephy xyephy commented May 20, 2024

This PR works on addressing the discussions in issue #853

Copy link
Contributor

github-actions bot commented May 20, 2024

🐰Bencher

ReportFri, May 31, 2024 at 16:52:34 UTC
ProjectStratum v2 (SRI)
Branchdev
Testbedsv2
Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client_sv2_handle_message_common✅ (view plot)44.59 (+0.08%)45.25 (98.54%)
client_sv2_handle_message_mining✅ (view plot)74.90 (+2.82%)80.51 (93.03%)
client_sv2_mining_message_submit_standard✅ (view plot)14.63 (-0.17%)14.69 (99.56%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)270.49 (+2.33%)284.22 (95.17%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)592.57 (-0.28%)628.40 (94.30%)
client_sv2_open_channel✅ (view plot)167.01 (+0.83%)171.36 (97.46%)
client_sv2_open_channel_serialize✅ (view plot)279.73 (-1.28%)293.20 (95.40%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)374.26 (-1.11%)424.89 (88.08%)
client_sv2_setup_connection✅ (view plot)158.68 (-3.36%)175.13 (90.61%)
client_sv2_setup_connection_serialize✅ (view plot)459.10 (-3.37%)505.69 (90.79%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)929.58 (-4.22%)1,038.96 (89.47%)

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

Copy link
Contributor

github-actions bot commented May 20, 2024

🐰Bencher

ReportFri, May 31, 2024 at 16:52:34 UTC
ProjectStratum v2 (SRI)
Branch918/merge
Testbedsv1
Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client-submit-serialize✅ (view plot)7,075.10 (+1.87%)7,338.66 (96.41%)
client-submit-serialize-deserialize✅ (view plot)8,011.30 (+1.86%)8,326.92 (96.21%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle✅ (view plot)8,611.90 (+2.13%)8,839.84 (97.42%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle✅ (view plot)900.77 (+0.24%)926.75 (97.20%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize✅ (view plot)693.21 (-0.53%)717.83 (96.57%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize✅ (view plot)248.46 (+0.13%)255.21 (97.36%)
client-sv1-get-authorize/client-sv1-get-authorize✅ (view plot)160.14 (+1.84%)162.64 (98.46%)
client-sv1-get-submit✅ (view plot)6,897.90 (+2.79%)7,139.83 (96.61%)
client-sv1-get-subscribe/client-sv1-get-subscribe✅ (view plot)282.18 (+1.25%)291.41 (96.83%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle✅ (view plot)754.57 (+0.99%)776.32 (97.20%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize✅ (view plot)618.03 (+0.58%)637.80 (96.90%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize✅ (view plot)208.56 (+0.86%)220.10 (94.76%)

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

Copy link
Contributor

github-actions bot commented May 20, 2024

🐰Bencher

ReportFri, May 31, 2024 at 16:52:33 UTC
ProjectStratum v2 (SRI)
Branchdev
Testbedsv1
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,515.00 (+0.97%)8,727.29 (97.57%)✅ (view plot)3,772.00 (+0.85%)3,857.74 (97.78%)✅ (view plot)5,295.00 (+0.96%)5,405.05 (97.96%)✅ (view plot)7.00 (-12.29%)10.45 (66.97%)✅ (view plot)91.00 (+1.15%)93.95 (96.86%)
get_submit✅ (view plot)95,622.00 (+0.07%)96,157.21 (99.44%)✅ (view plot)59,522.00 (+0.09%)59,786.65 (99.56%)✅ (view plot)85,492.00 (+0.10%)85,847.83 (99.59%)✅ (view plot)59.00 (+6.61%)62.52 (94.37%)✅ (view plot)281.00 (-0.39%)287.83 (97.63%)
get_subscribe✅ (view plot)8,028.00 (+0.63%)8,277.76 (96.98%)✅ (view plot)2,848.00 (+0.66%)2,941.77 (96.81%)✅ (view plot)3,978.00 (+0.63%)4,101.97 (96.98%)✅ (view plot)19.00 (+16.55%)19.76 (96.13%)✅ (view plot)113.00 (+0.30%)117.05 (96.54%)
serialize_authorize✅ (view plot)12,336.00 (+1.08%)12,507.13 (98.63%)✅ (view plot)5,343.00 (+0.60%)5,428.74 (98.42%)✅ (view plot)7,456.00 (+0.66%)7,568.38 (98.52%)✅ (view plot)10.00 (-7.67%)13.44 (74.39%)✅ (view plot)138.00 (+1.84%)140.24 (98.40%)
serialize_deserialize_authorize✅ (view plot)24,550.00 (+0.34%)24,708.49 (99.36%)✅ (view plot)9,950.00 (+0.50%)10,029.24 (99.21%)✅ (view plot)14,050.00 (+0.60%)14,155.67 (99.25%)✅ (view plot)35.00 (-4.68%)41.63 (84.07%)✅ (view plot)295.00 (+0.08%)297.50 (99.16%)
serialize_deserialize_handle_authorize✅ (view plot)30,188.00 (+0.15%)30,334.04 (99.52%)✅ (view plot)12,127.00 (+0.26%)12,212.74 (99.30%)✅ (view plot)17,163.00 (+0.27%)17,283.78 (99.30%)✅ (view plot)64.00 (+8.93%)64.78 (98.79%)✅ (view plot)363.00 (-0.20%)366.63 (99.01%)
serialize_deserialize_handle_submit✅ (view plot)126,469.00 (+0.05%)127,046.18 (99.55%)✅ (view plot)73,307.00 (+0.08%)73,629.70 (99.56%)✅ (view plot)105,084.00 (+0.09%)105,525.51 (99.58%)✅ (view plot)126.00 (+4.54%)131.54 (95.79%)✅ (view plot)593.00 (-0.30%)599.26 (98.96%)
serialize_deserialize_handle_subscribe✅ (view plot)27,450.00 (-0.01%)27,603.29 (99.44%)✅ (view plot)9,650.00 (+0.19%)9,743.77 (99.04%)✅ (view plot)13,645.00 (+0.17%)13,778.13 (99.03%)✅ (view plot)73.00 (+10.54%)73.96 (98.70%)✅ (view plot)384.00 (-0.45%)388.56 (98.83%)
serialize_deserialize_submit✅ (view plot)115,249.00 (+0.14%)115,668.59 (99.64%)✅ (view plot)68,167.00 (+0.16%)68,412.30 (99.64%)✅ (view plot)97,834.00 (+0.18%)98,164.53 (99.66%)✅ (view plot)74.00 (+6.32%)75.29 (98.28%)✅ (view plot)487.00 (-0.22%)492.42 (98.90%)
serialize_deserialize_subscribe✅ (view plot)22,934.00 (+0.26%)23,116.10 (99.21%)✅ (view plot)8,209.00 (+0.29%)8,299.66 (98.91%)✅ (view plot)11,564.00 (+0.30%)11,685.73 (98.96%)✅ (view plot)41.00 (+3.72%)44.10 (92.98%)✅ (view plot)319.00 (+0.15%)321.53 (99.21%)
serialize_submit✅ (view plot)100,015.00 (+0.12%)100,485.46 (99.53%)✅ (view plot)61,566.00 (+0.08%)61,836.17 (99.56%)✅ (view plot)88,335.00 (+0.09%)88,701.52 (99.59%)✅ (view plot)61.00 (+9.00%)62.07 (98.27%)✅ (view plot)325.00 (+0.09%)329.30 (98.69%)
serialize_subscribe✅ (view plot)11,425.00 (+0.86%)11,613.66 (98.38%)✅ (view plot)4,195.00 (+0.44%)4,288.77 (97.81%)✅ (view plot)5,835.00 (+0.41%)5,961.29 (97.88%)✅ (view plot)19.00 (+15.75%)19.02 (99.91%)✅ (view plot)157.00 (+1.12%)159.88 (98.20%)

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

Copy link
Contributor

github-actions bot commented May 20, 2024

🐰Bencher

ReportFri, May 31, 2024 at 10:15:24 UTC
ProjectStratum v2 (SRI)
Branchdev
Testbedsv2
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,061.00 (+0.60%)2,126.52 (96.92%)✅ (view plot)473.00 (+0.51%)486.59 (97.21%)✅ (view plot)736.00 (+0.52%)755.73 (97.39%)✅ (view plot)6.00 (-12.36%)10.41 (57.63%)✅ (view plot)37.00 (+1.00%)38.57 (95.92%)
client_sv2_handle_message_mining✅ (view plot)8,203.00 (+0.08%)8,338.31 (98.38%)✅ (view plot)2,137.00 (+0.48%)2,171.69 (98.40%)✅ (view plot)3,163.00 (+0.60%)3,216.76 (98.33%)✅ (view plot)35.00 (-9.14%)43.69 (80.11%)✅ (view plot)139.00 (+0.11%)142.03 (97.87%)
client_sv2_mining_message_submit_standard✅ (view plot)6,246.00 (-0.47%)6,390.60 (97.74%)✅ (view plot)1,750.00 (+0.03%)1,763.44 (99.24%)✅ (view plot)2,556.00 (+0.08%)2,576.45 (99.21%)✅ (view plot)17.00 (-2.10%)22.22 (76.50%)✅ (view plot)103.00 (-0.81%)106.98 (96.28%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)14,833.00 (+0.37%)15,039.21 (98.63%)✅ (view plot)4,694.00 (+0.01%)4,707.44 (99.71%)✅ (view plot)6,753.00 (-0.02%)6,775.74 (99.66%)✅ (view plot)48.00 (+1.79%)51.73 (92.80%)✅ (view plot)224.00 (+0.67%)230.10 (97.35%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)27,526.00 (+0.18%)27,851.81 (98.83%)✅ (view plot)10,545.00 (+0.03%)10,558.74 (99.87%)✅ (view plot)15,341.00 (+0.01%)15,361.29 (99.87%)✅ (view plot)85.00 (+1.66%)89.13 (95.36%)✅ (view plot)336.00 (+0.33%)345.56 (97.23%)
client_sv2_open_channel✅ (view plot)4,527.00 (+0.74%)4,612.61 (98.14%)✅ (view plot)1,461.00 (+0.06%)1,474.71 (99.07%)✅ (view plot)2,152.00 (-0.03%)2,173.20 (99.02%)✅ (view plot)13.00 (+8.33%)15.31 (84.93%)✅ (view plot)66.00 (+1.27%)68.20 (96.77%)
client_sv2_open_channel_serialize✅ (view plot)14,258.00 (+0.26%)14,462.77 (98.58%)✅ (view plot)5,064.00 (+0.02%)5,077.71 (99.73%)✅ (view plot)7,318.00 (+0.00%)7,339.67 (99.70%)✅ (view plot)37.00 (-0.36%)41.53 (89.09%)✅ (view plot)193.00 (+0.55%)198.89 (97.04%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)22,704.00 (+0.27%)23,033.05 (98.57%)✅ (view plot)7,987.00 (+0.05%)8,001.31 (99.82%)✅ (view plot)11,614.00 (+0.01%)11,636.97 (99.80%)✅ (view plot)76.00 (+3.95%)81.35 (93.43%)✅ (view plot)306.00 (+0.44%)315.19 (97.08%)
client_sv2_setup_connection✅ (view plot)4,699.00 (0.00%)4,765.93 (98.60%)✅ (view plot)1,502.00 (+0.06%)1,515.71 (99.10%)✅ (view plot)2,279.00 (+0.09%)2,300.24 (99.08%)✅ (view plot)8.00 (-10.73%)13.18 (60.72%)✅ (view plot)68.00 (+0.11%)69.62 (97.67%)
client_sv2_setup_connection_serialize✅ (view plot)16,376.00 (+0.64%)16,482.20 (99.36%)✅ (view plot)5,963.00 (+0.01%)5,976.71 (99.77%)✅ (view plot)8,651.00 (-0.05%)8,677.82 (99.69%)✅ (view plot)47.00 (+5.53%)48.76 (96.38%)✅ (view plot)214.00 (+1.30%)217.17 (98.54%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)35,616.00 (+0.22%)35,751.13 (99.62%)✅ (view plot)14,814.00 (+0.03%)14,828.31 (99.90%)✅ (view plot)21,746.00 (-0.02%)21,772.72 (99.88%)✅ (view plot)107.00 (+7.60%)112.48 (95.13%)✅ (view plot)381.00 (+0.34%)384.45 (99.10%)

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

let flag_avaiable = 0b_0000_0000_0000_0000_0000_0000_0000_0000;
fn test_check_flags() {
let protocol = Protocol::MiningProtocol;
let flag_available = 0b_0000_0000_0000_0000_0000_0000_0000_0001;
Copy link
Collaborator

Choose a reason for hiding this comment

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

why you changed this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thought of it as a way ensuring that check_flags works when both available and required flags are the same for MiningProtocol and JobDeclarationProtocol.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Fi3 when I did the revert I keep getting this error:

test setup_connection::test::test_check_flag ... FAILED
test setup_connection::test::test_has_work_selection ... ok
test setup_connection::test::test_set_requires_std_job ... ok

failures:

---- setup_connection::test::test_check_flag stdout ----
thread 'setup_connection::test::test_check_flag' panicked at v2/subprotocols/common-messages/src/setup_connection.rs:408:9:
assertion failed: SetupConnection::check_flags(protocol, flag_avaiable, flag_required)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    setup_connection::test::test_check_flag
    
    ```
    
    any idea on how I can go about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Fi3 I managed to fix the error, I think you can review again and give feedback

@plebhash
Copy link
Collaborator

@xyephy looks like Rustfmt CI is broken, can you do cargo +nightly fmt on all crate workspaces, commit and push the changes, please?

@plebhash
Copy link
Collaborator

plebhash commented May 31, 2024

@xyephy did you explore the MG tests? I'm wondering if this behavior is already covered in our MG suite, or should we add a new one?

@xyephy
Copy link
Contributor Author

xyephy commented May 31, 2024

@xyephy looks like Rustfmt CI is broken, can you do cargo +nightly fmt on all crate workspaces, commit and push the changes, please?

Thanks @plebhash, let me work on that.

@xyephy
Copy link
Contributor Author

xyephy commented May 31, 2024

@xyephy did you explore the MG tests? I'm wondering if this behavior is already covered in our MG suite, or should we add a new one?

for this issue I hadn't done that, let me explore/review then give you feedback.

@plebhash
Copy link
Collaborator

plebhash commented May 31, 2024

@xyephy FYI I merged #945 but apparently that introduced conflics to this PR

@xyephy
Copy link
Contributor Author

xyephy commented May 31, 2024

@xyephy FYI I merged #945 but apparently that introduced conflics to this PR

@plebhash I will do the cleanups to solve the conflicts. Thanks for the heads up.

@plebhash
Copy link
Collaborator

@xyephy any progress on writing the MG tests for this one?

@xyephy
Copy link
Contributor Author

xyephy commented Jun 18, 2024

@xyephy any progress on writing the MG tests for this one?

I'm 80% done on this

@plebhash
Copy link
Collaborator

closing in favor of #1035

@plebhash plebhash closed this Jul 29, 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.

Issue with flags checking and related roles behaviour
3 participants