Skip to content

make mining_device into submodule of integration_tests_sv2 crate#355

Merged
plebhash merged 1 commit intostratum-mining:mainfrom
plebhash:2026-03-21-mining-device-itf
Mar 24, 2026
Merged

make mining_device into submodule of integration_tests_sv2 crate#355
plebhash merged 1 commit intostratum-mining:mainfrom
plebhash:2026-03-21-mining-device-itf

Conversation

@plebhash
Copy link
Copy Markdown
Member

@plebhash plebhash commented Mar 21, 2026

this is one potential (and opinionated) approach to close #354

one alternative is to start publishing mining_device to crates.io

@plebhash plebhash force-pushed the 2026-03-21-mining-device-itf branch 2 times, most recently from 4ceaf22 to 1c2b77a Compare March 21, 2026 19:16
Copy link
Copy Markdown
Collaborator

@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.

Concept ACK.

Copy link
Copy Markdown
Collaborator

@xyephy xyephy left a comment

Choose a reason for hiding this comment

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

cargo publish --dry-run still fails after this change:

error: all dependencies must have a version specified when publishing.
dependency `key-utils` does not specify a version

These git deps need version specifiers:

key-utils = { version = "1.2.0", git = "https://github.com/stratum-mining/stratum", rev = "v1.5.0" }
stratum-common = { version = "4.0.1", git = "https://github.com/stratum-mining/stratum", rev = "v1.5.0", features = ["with_network_helpers"] }

Both versions match the v1.5.0 tag and exist on crates.io.

Copy link
Copy Markdown
Member

@GitGab19 GitGab19 left a comment

Choose a reason for hiding this comment

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

After @xyephy's suggestions are tackled, this PR is good to go.

Comment on lines +34 to +35
key-utils = { git = "https://github.com/stratum-mining/stratum", rev = "v1.5.0" }
stratum-common = { git = "https://github.com/stratum-mining/stratum", rev = "v1.5.0", features = ["with_network_helpers"] }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why can't we get these two from the (already imported) stratum-apps crate?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah, this aligns with @xyephy comment above

I was able to remove key-utils and use stratum-apps for that piece

unfortunately though, stratum-common is the part that is still not covered by stratum-apps today.... the newly embedded mining_device module still relies on stratum_common::network_helpers_sv2::noise_connection::Connection plus a fair amount of stratum_common::roles_logic_sv2::{...} surface, and stratum-apps does not currently re-export that.

I think the paths ahead are:

  1. keep stratum-common as an explicit dependency for now (current state of this PR);
  2. extend stratum-apps to re-export stratum-common / the relevant facade, which would let us avoid declaring it explicitly here;
  3. refactor the migrated mining_device module so it no longer depends on stratum-common at all.

this PR is currently following 1 because it is the lowest hanging fruit, but happy to pivot towards 2 or 3 (although scope is a bit bigger)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

wait, just found some compilation errors

maybe the analysis above is incomplete

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ok ended up pivoting

keeping stratum-common as an explicit dep was not enough, because it still pulled the older published stack and cargo publish --dry-run failed while verifying it (framing_sv2 v5.0.1).

so I went with the stronger version of your suggestion:

  • key-utils now comes from stratum-apps
  • mining_device was refactored to stop depending on stratum-common entirely
  • it now uses the stratum-apps / stratum_core stack directly

with that change, cargo publish --dry-run passes

@plebhash plebhash force-pushed the 2026-03-21-mining-device-itf branch 2 times, most recently from ec10697 to 7b6ea98 Compare March 24, 2026 19:13
@plebhash
Copy link
Copy Markdown
Member Author

cargo publish --dry-run still fails after this change:

error: all dependencies must have a version specified when publishing.
dependency `key-utils` does not specify a version

These git deps need version specifiers:

key-utils = { version = "1.2.0", git = "https://github.com/stratum-mining/stratum", rev = "v1.5.0" }
stratum-common = { version = "4.0.1", git = "https://github.com/stratum-mining/stratum", rev = "v1.5.0", features = ["with_network_helpers"] }

Both versions match the v1.5.0 tag and exist on crates.io.

thanks, should be addressed

@plebhash plebhash force-pushed the 2026-03-21-mining-device-itf branch from 7b6ea98 to 0365d72 Compare March 24, 2026 20:23
@plebhash plebhash requested review from GitGab19 and xyephy March 24, 2026 20:41
@plebhash plebhash force-pushed the 2026-03-21-mining-device-itf branch from 0365d72 to 52f5265 Compare March 24, 2026 20:57
@plebhash plebhash force-pushed the 2026-03-21-mining-device-itf branch 2 times, most recently from 7b6ea98 to d56ac1a Compare March 24, 2026 21:36
@plebhash plebhash force-pushed the 2026-03-21-mining-device-itf branch from d56ac1a to 7f3af6d Compare March 24, 2026 21:41
@plebhash plebhash merged commit 06543e0 into stratum-mining:main Mar 24, 2026
11 checks passed
@plebhash plebhash deleted the 2026-03-21-mining-device-itf branch March 24, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mining_device is blocking the publish of integration_tests_sv2 to crates.io

4 participants