Skip to content

Conversation

@plebhash
Copy link
Member

@plebhash plebhash commented Dec 24, 2025

close #2014

companion stratum-mining/sv2-apps#156


important note: this PR is introducing a BREAKING SPEC CHANGE on OpenExtendedMiningChannel.Success message, which now has an extra field group_channel_id.

@plebhash plebhash changed the title add Group Channel adaptations on channels_sv2 add Group Channel adaptations on channels_sv2 🎅 Dec 24, 2025
@plebhash plebhash marked this pull request as ready for review December 24, 2025 21:19
@plebhash plebhash force-pushed the 2025-12-17-adapt-group-channel branch from e31addc to 52834bc Compare December 27, 2025 23:46
@plebhash plebhash changed the title add Group Channel adaptations on channels_sv2 🎅 add Group Channel adaptations on channels_sv2 Dec 28, 2025
@plebhash plebhash force-pushed the 2025-12-17-adapt-group-channel branch 2 times, most recently from 8194a36 to 414fd73 Compare December 28, 2025 19:40
@plebhash plebhash force-pushed the 2025-12-17-adapt-group-channel branch from 414fd73 to 6d14a7d Compare January 4, 2026 18:39
pub fn add_standard_channel_id(&mut self, standard_channel_id: u32) {
self.standard_channel_ids.insert(standard_channel_id);
pub fn add_channel_id(&mut self, channel_id: u32) {
self.channel_ids.insert(channel_id);
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we make some kind of check on the full extranonce size before adding the channel to the group here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +505 to +511
JobOrigin::SetCustomMiningJob(_) => {
return Err(ExtendedChannelError::InvalidJobOrigin);
}
Copy link
Member

Choose a reason for hiding this comment

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

Does it mean we are not going to allow clients to set custom jobs to a single group channel instead of many individual ones?

Maybe it's not related to that at all, but I wanted to clarify it.

Copy link
Member Author

@plebhash plebhash Jan 5, 2026

Choose a reason for hiding this comment

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

we can (and should) allow clients to set custom jobs to a single group channel... tbh I didn't consider this on stratum-mining/sv2-apps#156, but it's actually a good idea, so I'll add a new commit there changing handle_set_custom_mining_job

this is a really good idea because now we unlock the use-case of a non-aggregating JDC that only sends one single pair of DeclareMiningJob + SetCustomMiningJob


but coming back to the original question, on_group_channel_job remains reserved for non-JD uses only... I'm adding the following comment to on_new_template and on_group_channel_job to make this idea explicitly clear:

/// Only meant to be used if REQUIRES_CUSTOM_WORK is not set on the connection this channel exists on.

if a SetCustomMiningJob arrives, and it's directed to a Group Channel ID, then the Pool application layer must iterate over all Extended Channels and call on_set_custom_mining_job on each one of them


to be clear: a non-aggregating JDC is not going to be implemented on stratum-mining/sv2-apps#156

only an adaptation to handle_set_custom_mining_job on Pool

self.standard_channel_ids.insert(standard_channel_id);
/// Adds a channel ID to this group channel.
pub fn add_channel_id(&mut self, channel_id: u32) {
self.channel_ids.insert(channel_id);
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we make some kind of check on the full extranonce size before adding the channel to the group here?

Copy link
Member Author

Choose a reason for hiding this comment

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

@plebhash plebhash force-pushed the 2025-12-17-adapt-group-channel branch from 6d14a7d to 6f0ed14 Compare January 5, 2026 21:09
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.

Group Channel adaptations on channels_sv2

2 participants