Related: #242, PR #245
When enable_vardiff = false (the recommended configuration when using a JDC), the tProxy does not update nominal_hashrate in response to upstream SetTarget messages.
As a result, three hashrate metrics remain stuck at their initial values, even after upstream difficulty changes.
PR #245 fixes the case where the tProxy itself generates UpdateChannel (i.e., when enable_vardiff = true).
It does not fix the SetTarget path, which is the only path used when vardiff is disabled.
Affected Metrics
| Metric |
Why It's Incorrect |
sv2_server_hashrate_total |
handle_set_target updates target but not nominal_hashrate |
sv2_client_hashrate_total |
Same channel, same issue |
sv1_hashrate_total |
d.hashrate never updated when forwarding difficulty to SV1 miners |
All three metrics remain at the value declared in OpenExtendedMiningChannel (derived from min_individual_miner_hashrate), regardless of subsequent upstream difficulty adjustments.
Reproduction
-
Configure tProxy with enable_vardiff = false (typical when using JDC):
[downstream_difficulty_config]
min_individual_miner_hashrate = 10_000_000_000_000.0
shares_per_minute = 6.0
enable_vardiff = false
-
Connect a miner whose actual hashrate differs from the configured value.
-
Allow upstream (JDC or pool) to adjust difficulty via SetTarget.
-
Observe:
sv2_server_hashrate_total remains at the initial configured value
sv1_hashrate_total remains at the initial configured value
- The upstream pool correctly reflects adjusted hashrate.
What PR #245 Fixes
When enable_vardiff = true, and the tProxy emits UpdateChannel, it now updates nominal_hashrate.
What's missing:
1. handle_set_target (SV2 path)
When receiving SetTarget, the handler updates channel target(s) but not nominal_hashrate.
2. SV1 downstream hashrate
When vardiff is disabled, difficulty updates are forwarded to SV1 miners but d.hashrate is never updated.
Test Matrix
We should be sure to verify across all 4 variations of enable_vardiff and aggregate_channels to ensure all supported configurations are correctly accounted for.
Related: #242, PR #245
When
enable_vardiff = false(the recommended configuration when using a JDC), the tProxy does not updatenominal_hashratein response to upstreamSetTargetmessages.As a result, three hashrate metrics remain stuck at their initial values, even after upstream difficulty changes.
PR #245 fixes the case where the tProxy itself generates
UpdateChannel(i.e., whenenable_vardiff = true).It does not fix the
SetTargetpath, which is the only path used when vardiff is disabled.Affected Metrics
sv2_server_hashrate_totalhandle_set_targetupdates target but notnominal_hashratesv2_client_hashrate_totalsv1_hashrate_totald.hashratenever updated when forwarding difficulty to SV1 minersAll three metrics remain at the value declared in
OpenExtendedMiningChannel(derived frommin_individual_miner_hashrate), regardless of subsequent upstream difficulty adjustments.Reproduction
Configure tProxy with
enable_vardiff = false(typical when using JDC):Connect a miner whose actual hashrate differs from the configured value.
Allow upstream (JDC or pool) to adjust difficulty via
SetTarget.Observe:
sv2_server_hashrate_totalremains at the initial configured valuesv1_hashrate_totalremains at the initial configured valueWhat PR #245 Fixes
When
enable_vardiff = true, and the tProxy emitsUpdateChannel, it now updatesnominal_hashrate.What's missing:
1.
handle_set_target(SV2 path)When receiving
SetTarget, the handler updates channel target(s) but notnominal_hashrate.2. SV1 downstream hashrate
When vardiff is disabled, difficulty updates are forwarded to SV1 miners but
d.hashrateis never updated.Test Matrix
We should be sure to verify across all 4 variations of
enable_vardiffandaggregate_channelsto ensure all supported configurations are correctly accounted for.