forked from stratum-mining/stratum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
in this PR is fixed the fallback to solo-mining in the case that the upstream sends a `SubmitShareError` on a valid share AND there are no other available upstreams in the JDC config. To check this PR you should follow the same procedure as described in the commit messages of the branch of this PR (which deals with a similar problem). stratum-mining#1001 The only exception is that the JDC should use this config test/config/change-upstream/jdc-config-local-example-change-upstream-solo-fallback.toml panics: 2024-07-11T15:57:25.769622Z INFO roles_logic_sv2::handlers::template_distribution: Received NewTemplate with id: 694, is future: true thread 'tokio-runtime-worker' panicked at jd-client/src/lib/downstream.rs:379:74: called `Option::unwrap()` on a `None` value note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace 2024-07-11T15:57:35.319832Z INFO roles_logic_sv2::handlers::mining: Received UpdateChannel->Extended message thread 'tokio-runtime-worker' panicked at jd-client/src/lib/downstream.rs:525:13: not yet implemented 2024-07-11T15:57:41.633138Z ERROR network_helpers_sv2::noise_connection_tokio: Disconnected from client while reading : early eof - 127.0.0.1:56278 ^C2024-07-11T15:57:57.023091Z INFO jd_client: Interrupt received
- Loading branch information
Showing
3 changed files
with
91 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
test/config/change-upstream/jdc-config-local-example-change-upstream-solo-fallback.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# SRI JDC config | ||
downstream_address = "127.0.0.1" | ||
downstream_port = 34265 | ||
|
||
# Version support | ||
max_supported_version = 2 | ||
min_supported_version = 2 | ||
|
||
# Minimum extranonce2 size for downstream | ||
# Max value: 16 (leaves 0 bytes for search space splitting of downstreams) | ||
# Max value for CGminer: 8 | ||
# Min value: 2 | ||
min_extranonce2_size = 8 | ||
|
||
# Withhold | ||
withhold = false | ||
|
||
# Auth keys for open encrypted connection downstream | ||
authority_public_key = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" | ||
authority_secret_key = "mkDLTBBRxdBv998612qipDYoTK3YUrqLe8uWw7gu3iXbSrn2n" | ||
cert_validity_sec = 3600 | ||
|
||
# How many time the JDC try to reinitialize itself after a failure | ||
retry = 10 | ||
|
||
# Template Provider config | ||
# Local TP (this is pointing to localhost so you must run a TP locally for this configuration to work) | ||
tp_address = "127.0.0.1:8442" | ||
# Hosted testnet TP | ||
# tp_address = "75.119.150.111:8442" | ||
|
||
# Solo Mining config | ||
# List of coinbase outputs used to build the coinbase tx in case of Solo Mining (as last-resort solution of the pools fallback system) | ||
# ! Put your Extended Public Key or Script as output_script_value ! | ||
# ! Right now only one output is supported, so comment all the ones you don't need ! | ||
# For P2PK, P2PKH, P2WPKH, P2TR a public key is needed. For P2SH and P2WSH, a redeem script is needed. | ||
coinbase_outputs = [ | ||
#{ output_script_type = "P2PK", output_script_value = "0372c47307e5b75ce365daf835f226d246c5a7a92fe24395018d5552123354f086" }, | ||
#{ output_script_type = "P2PKH", output_script_value = "0372c47307e5b75ce365daf835f226d246c5a7a92fe24395018d5552123354f086" }, | ||
#{ output_script_type = "P2SH", output_script_value = "00142ef89234bc95136eb9e6fee9d32722ebd8c1f0ab" }, | ||
#{ output_script_type = "P2WSH", output_script_value = "00142ef89234bc95136eb9e6fee9d32722ebd8c1f0ab" }, | ||
{ output_script_type = "P2WPKH", output_script_value = "036adc3bdf21e6f9a0f0fb0066bf517e5b7909ed1563d6958a10993849a7554075" }, | ||
#{ output_script_type = "P2TR", output_script_value = "036adc3bdf21e6f9a0f0fb0066bf517e5b7909ed1563d6958a10993849a7554075" }, | ||
] | ||
|
||
[timeout] | ||
unit = "secs" | ||
value = 1 | ||
|
||
# List of upstreams (JDS) used as backup endpoints | ||
# In case of shares refused by the JDS, the fallback system will propose the same job to the next upstream in this list | ||
[[upstreams]] | ||
authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" | ||
pool_address = "127.0.0.1:44254" | ||
jd_address = "127.0.0.1:34264" | ||
# Pool signature (string to be included in coinbase tx) | ||
pool_signature = "Stratum v2 SRI Pool" | ||
#[[upstreams]] | ||
#authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" | ||
#pool_address = "127.0.0.1:34254" | ||
#jd_address = "127.0.0.1:34264" | ||
# Pool signature (string to be included in coinbase tx) | ||
#pool_signature = "Stratum v2 SRI Pool" | ||
|
||
# [[upstreams]] | ||
# authority_pubkey = "2di19GHYQnAZJmEpoUeP7C3Eg9TCcksHr23rZCC83dvUiZgiDL" | ||
# pool_address = "127.0.0.1:34254" | ||
# jd_address = "127.0.0.1:34264" | ||
# Pool signature (string to be included in coinbase tx) | ||
# pool_signature = "Stratum v2 SRI Pool" |