Replies: 6 comments 26 replies
-
Non-breaking changesHere, by non-breaking, I mean that we're not adding or removing fields from any message. It's merely changing conceptual definitions. Implementations that pre-date to this change would remain spec-compliant, only missing new functionality. This is akin to a soft-fork in bitcoin consensus. Definition of Group ChannelThis would change how the definition of how Group Channel is formally established in the spec. ### 5.2.3 Group Channel
-Standard channels opened within one particular connection can be grouped together to be addressable by a common communication group channel.
+Standard and Extended channels opened within one particular connection can be grouped together to be addressable by a common communication group channel.
-Whenever a Standard Channel is created, it is always put into some Group Channel identified by its `group_channel_id`.
-Group Channel ID namespace is the same as Standard Channel ID namespace on a particular connection.
+Whenever a Standard or Extended Channel is created, it is always put into some Group Channel identified by its `group_channel_id`.
+Group Channel ID namespace is the same as Standard and Extended Channel ID namespace on a particular connection. Definition of Extended JobThis would rephrase how we're defining Extended Job with regards to Group Channel. ### 5.3.16 `NewExtendedMiningJob` (Server -> Client)
(Extended and group channels only)
For an **extended channel**:
The whole search space of the job is owned by the specified channel.
If the `min_ntime` field is set to some nTime, the client MUST start to mine on the new job as soon as possible after receiving this message.
For a **group channel**:
-This is a broadcast variant of `NewMiningJob` message with the `merkle_root` field replaced by `merkle_path` and coinbase transaction prefix and suffix, for further traffic optimization.
-The Merkle root is then defined deterministically for each channel by the common `merkle_path` and unique `extranonce_prefix` serialized into the coinbase.
-The full coinbase is then constructed as follows: `coinbase_tx_prefix + extranonce_prefix + coinbase_tx_suffix`.
+This acts as a broadcast message that distributes work to all channels under the same group.
The proxy MAY transform this multicast variant for downstream standard channels into `NewMiningJob` messages by computing the derived Merkle root for them.
-A proxy MUST translate the message for all downstream standard channels belonging to the group which don’t signal that they accept extended mining jobs in the `SetupConnection` message (intended and expected behavior for end mining devices).
+A proxy MUST translate the message into `NewMiningJob` for all downstream standard channels belonging to the group in case the `SetupConnection` message had the `REQUIRES_STANDARD_JOB` flag set (intended and expected behavior for end mining devices).
+
+For conversion into different `NewMiningJob` messages, the Merkle root is then defined deterministically for each standard channel by the common `merkle_path` and unique `extranonce_prefix` serialized into the coinbase.
+The full coinbase is then constructed as follows: `coinbase_tx_prefix + extranonce_prefix + coinbase_tx_suffix`.
| Field Name | Data Type | Description
|
| ----------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-| channel_id | U32 | For a group channel, the message is broadcasted to all standard channels belonging to the group. Otherwise, it is addressed to the specified extended channel.
|
+| channel_id | U32 | For a group channel, the message is broadcasted to all standard and extended channels belonging to the group. Otherwise, it is addressed to the specified extended channel. Definition of
|
Beta Was this translation helpful? Give feedback.
-
Breaking changesThis is an optional part of the proposal. It could face a bit more resistance, since it would break existing implementations. Right now, If we are allowing Extended Channels to belong to a Group Channel, ideally ### 5.3.5 `OpenExtendedMiningChannel.Success` (Server -> Client)
Sent as a response for opening an extended channel.
| Field Name | Data Type | Description |
| ----------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| request_id | U32 | Client-specified request ID from OpenExtendedMiningChannel message, so that the client can pair responses with open channel requests |
| channel_id | U32 | Newly assigned identifier of the channel, stable for the whole lifetime of the connection, e.g. it is used for broadcasting new jobs by NewExtendedMiningJob |
| target | U256 | Initial target for the mining channel |
| extranonce_size | U16 | Extranonce size (in bytes) set for the channel |
| extranonce_prefix | B0_32 | Bytes used as implicit first part of extranonce |
+| group_channel_id | U32 | Group channel into which the new channel belongs. See SetGroupChannel for details. | Otherwise, it's hard to say which Group Channel some specific Extended Channel belongs to once it's open, and could lead to undefined states. If this breaking change is rejected, but we still move forward with the non-breaking proposal, then Proxies could still assume some value for |
Beta Was this translation helpful? Give feedback.
-
Can you please specify to what data or metrics are you referring here? A general note here is that any data that cannot be collected by the pool, can always be collected by the proxy. If the pool does not need this data to operate, I don't think it should know about. |
Beta Was this translation helpful? Give feedback.
-
Considering the original specification specifically includes GroupChannels, and the proposal is to allow for extended group channels, i think all pros and cons of GroupChannels have to be applied to the proposed extended group channel. Considering the pros outweighed the cons in the original spec definition, I think it's fair to keep those comparisons in mind when evaluating the proposal. In addition, given the benchmarks here stratum-mining/stratum#1841, it's likely extended channels are more performant in most cases, especially on a local network with sufficient bandwidth. Forcing the proxy (TProxy or Sv2Proxy) to calculate merkle roots sequentially is much less efficient than letting individual devices calculate their own merkle roots in parallel and both ExtendedJobs and StandardJobs both easily fall within a standard Tcp Packet, so there should be little to no networking hit. Sure there is more data to copy over Tcp but copying a buffer is much more efficient than caculating a merkle root. Given these points, i believe it's in Firmwares best interest to support connecting with extended jobs directly, and therefore this proposal may not ONLY affect the TProxy Cons for ExtendedGroupChannels:
Pros for ExtendedGroupChannels:
|
Beta Was this translation helpful? Give feedback.
-
I've done some digging on this topic. One thing we often face at SRI when engaging with early adopters is that most of them always asks if there's a way to get individual workers share data. Originally, I really didn't understand the reasons for this, and like @Fi3 I was against adding this into specs/protocol for this, because why would we settle for anything that is not the most efficient outcome. However, over time, it became obvious that there are users who want to have granularity in shares. I will talk about WHY users want this, a bit later, but this lead us to develop two modes in tProxy:
Now the users who want to have this data for individual level at the Pool, can have it. However this option is pretty inefficient. My understanding of this spec change is that it would alloExw non-aggregating proxy users to have a more efficient setup by allowing them to not aggregate shares, but do aggregate job dispatched which is a significant efficiency improvement. Now, I get that it's hard to reason with this from technical perspective, but interaction with users actually shows that a very large portion of users doesn't want to aggregate shares, but still would like to have efficiency boost, which I think makes sense to cater for this use-case, especially since Braiins already uses Group Extended Channels. There are two compelling reasons on why miners and Pools want to have individual granularity of the worker share data on the Pool level.
One thing that has always concerned me about the plugin route, especially this early in SV2 adoption phase is compatibility. How will things work if one pool supports one, but the fallback happens and the other doesn't? Then your setup becomes quite fragile. Imagine your auditing breaks ,because fallback happened. We can of course wait to find out, but should we really push users into using experimental extension system, especially if majority that we've interacted with expressed the necessity for it, and they would be better supported if it worked right out of the box? My point here, is that upon having quite a few interactions with miners, mining pools and some of the early adopters, I think this spec change would allow us to move forward with a behaviour that I would say over 70% of adopters asked for in the most efficient way possible, and it seems we can move into a non-breaking manner. I think extensions should be used for features that are opinionated and only a handful users want, but if a feature is something that majority of current and future adopters want, I think it's sensible to consider making a spec change. |
Beta Was this translation helpful? Give feedback.
-
IMO the entire concept of Group Channels is discussed as something very sophisticated, while the idea behind it is fairly simple. first of all, it's actually not a real channel. Client doesn't request a group channel opening. There are just two channel types - standard and extended. Standard channels have group_id assigned at the creation. The purpose of group id is explained in the spec. Extended channels don't have any group_id assigned implicitly. And further relations to the groups are not mentioned in the spec. (In fact, I'd prefer calling it channel-groups not group channels, but whatever) And our question is whether extended channels should be allowed in a group.
so unless I'm missing something I'm fine with using groups also for extended channels. I don't see reason for being overly restrictive in the spec. Every channel may have two ids - one for unicast, other for multicast (group). For standard channels it's implicit. For extended it's optional. Then there is a completely different topic of whether it makes sense to use groups to distribute various things. For example using groups to distribute extended jobs to extended channels is a mistake. But using groups to distribute prev hash is fine IMO. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There's been a lot of discussions in the Sv2 community around some fundamental UX aspect of Translator Proxy.
It can work in two different modes:
Agrregated mode brings a lot of efficiency in terms of bandwidth and job broadcasting. However, it has the downside of losing data granularity, meaning that the user cannot look at the Pool dashboard and visualize metrics on a per-worker basis. This is the UX that miners are used to today, and forcing them to move away from it could become a barrier for protocol adoption.
Non-aggregated mode allows for such granularity, but loses all the efficiency optimizations of aggregation.
Sv2 has the notion of Group Channels, which are meant to make job broadcasting more efficient. This could be an interesting option to optimize non-aggregated mode.
And now the main problem:
The fact that Group Channels can only contain Standard Channels (but not Extended) is a bit counter-intuitive at first sight, because when it comes to the design space in front of us, there's no fundamental blocker preventing the protocol from allowing this.
But this restriction becomes clear when we read the following sections:
5.2.3 Group Channel
5.3.16 NewExtendedMiningJob
5.3.22 SetGroupChannel
This Discussion is meant to try to get consensus on changing the Mining Spec, in order to allow Group Channels to also contain Extended Channels.
This would enable a Translator Proxy that retains a legacy-friendly UX (with per-worker data granularity via non-aggregated mode) that can still receive jobs broadcasts from a Pool in an efficient way.
The proposal is split in two parts, where the second is optional and complimentary to the first.
Beta Was this translation helpful? Give feedback.
All reactions