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

refactor framing_sv2 example #1468

Merged
merged 2 commits into from
Mar 31, 2025

Conversation

plebhash
Copy link
Collaborator

@plebhash plebhash commented Feb 9, 2025

close #1467

Copy link

codecov bot commented Feb 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 21.92%. Comparing base (719dee1) to head (a999706).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1468   +/-   ##
=======================================
  Coverage   21.92%   21.92%           
=======================================
  Files         135      135           
  Lines        9573     9573           
=======================================
  Hits         2099     2099           
  Misses       7474     7474           
Flag Coverage Δ
binary_codec_sv2-coverage 0.00% <ø> (ø)
binary_sv2-coverage 10.12% <ø> (ø)
bip32_derivation-coverage 0.00% <ø> (ø)
buffer_sv2-coverage 37.68% <ø> (ø)
codec_sv2-coverage 0.03% <ø> (ø)
common_messages_sv2-coverage 0.25% <ø> (ø)
const_sv2-coverage 0.00% <ø> (ø)
error_handling-coverage 0.00% <ø> (ø)
framing_sv2-coverage 0.54% <ø> (ø)
jd_client-coverage 0.39% <ø> (ø)
jd_server-coverage 12.42% <ø> (ø)
job_declaration_sv2-coverage 0.00% <ø> (ø)
key-utils-coverage 3.61% <ø> (ø)
mining-coverage 5.02% <ø> (ø)
mining_device-coverage 0.00% <ø> (ø)
mining_proxy_sv2-coverage 1.18% <ø> (ø)
noise_sv2-coverage 8.63% <ø> (ø)
pool_sv2-coverage 7.21% <ø> (ø)
protocols 30.61% <ø> (ø)
roles 12.19% <ø> (ø)
roles_logic_sv2-coverage 15.22% <ø> (ø)
sv2_ffi-coverage 0.00% <ø> (ø)
template_distribution_sv2-coverage 0.00% <ø> (ø)
translator_sv2-coverage 9.11% <ø> (ø)
utils 36.39% <ø> (ø)
v1-coverage 4.36% <ø> (ø)

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@plebhash plebhash force-pushed the refactor-framing-sv2-example branch 5 times, most recently from 7d24f3f to 52e824f Compare February 10, 2025 17:13
@plebhash plebhash marked this pull request as ready for review February 10, 2025 17:13
@plebhash plebhash changed the title [WIP] refactor framing_sv2 example refactor framing_sv2 example Feb 10, 2025
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.

Looks good. do we actually run this in the ci?

@plebhash
Copy link
Collaborator Author

Looks good. do we actually run this in the ci?

nice catch, we didn't but I just added a commit that runs it from test.yml

@Shourya742
Copy link
Contributor

Looks good. do we actually run this in the ci?

nice catch, we didn't but I just added a commit that runs it from test.yml

Should we also add other examples that we recently included during our documentation efforts, since not all of them have been added to CI?


// Example message type (e.g., SetupConnection)
const MSG_TYPE: u8 = 1;
// Example extension type (e.g., a standard Sv2 message)
const EXT_TYPE: u16 = 0x0001;

#[derive(Serialize, Debug)]
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct CustomMessage {
Copy link
Contributor

Choose a reason for hiding this comment

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

thinking out loud here, wouldn't it be more beneficial to actually have an SV2 message here? for the MSG_TYPE, SETUP_CONNECTION is used, maybe here as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

rationale here is to limit this example to the scope of framing_sv2 while highlighting the assumption that the crate is agnostic to which messages actually exist in the Sv2 protocol

it's meant to showcase that as long as a message is defined this way, framing_sv2 will be able to transmit it over the wire (without any kind of assertion of whether this message is part of the spec or not)

@Shourya742
Copy link
Contributor

This should be good to go now? cc: @plebhash

@GitGab19
Copy link
Collaborator

I think this PR is ready to go since it received 2 approvals.

Could you try to rebase it @plebhash ?

@plebhash plebhash force-pushed the refactor-framing-sv2-example branch from cb2b67b to 5de3953 Compare March 31, 2025 12:19
@plebhash plebhash added the ready-to-be-merged triggers auto rebase bot label Mar 31, 2025
we need to assert that the deserialized message has the same content from the original
@pavlenex pavlenex force-pushed the refactor-framing-sv2-example branch from 5de3953 to a999706 Compare March 31, 2025 12:49
@plebhash
Copy link
Collaborator Author

I think this PR is ready to go since it received 2 approvals.

Could you try to rebase it @plebhash ?

pav bot called to action (which btw reminds me of #1488)

@GitGab19 GitGab19 merged commit 40c3f06 into stratum-mining:main Mar 31, 2025
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-be-merged triggers auto rebase bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

framing_sv2 example is incomplete
4 participants