-
Notifications
You must be signed in to change notification settings - Fork 177
add Group Channel adaptations on channels_sv2
#2044
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
base: main
Are you sure you want to change the base?
add Group Channel adaptations on channels_sv2
#2044
Conversation
channels_sv2channels_sv2 🎅
e31addc to
52834bc
Compare
channels_sv2 🎅channels_sv2
8194a36 to
414fd73
Compare
414fd73 to
6d14a7d
Compare
| 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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| JobOrigin::SetCustomMiningJob(_) => { | ||
| return Err(ExtendedChannelError::InvalidJobOrigin); | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6d14a7d to
6f0ed14
Compare
close #2014
companion stratum-mining/sv2-apps#156
important note: this PR is introducing a BREAKING SPEC CHANGE on
OpenExtendedMiningChannel.Successmessage, which now has an extra fieldgroup_channel_id.