Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
dbdfd51
refactor: checkout v1.5.0 before build
average-gary Sep 29, 2025
1fc7bc8
use v1.5.0
average-gary Oct 2, 2025
a0d6401
feat(template-provider): Enhance SV2 Template Provider configuration …
average-gary Oct 2, 2025
a9c3568
chore(config): Refactor SV2 configuration and startup scripts
average-gary Oct 2, 2025
2952250
feat(config): Update SV2 configuration files for v1.5.0 compatibility
average-gary Oct 2, 2025
a75c0d9
feat(config): Update SV2 configuration files for benchmarking
average-gary Oct 3, 2025
dcb6242
ci(workflow): Add Clippy component to GitHub Actions Rust setup
average-gary Oct 3, 2025
ee0c04a
feat(config): Add min_extranonce_size parameter to JDC configuration
average-gary Oct 3, 2025
d3e23a4
feat(proxy): Migrate SV2 custom proxy to v1.5.0 crates
average-gary Oct 3, 2025
876c0b2
feat(proxy): Upgrade SV2 custom proxy to use v1.5.0 crates and tracing
average-gary Oct 6, 2025
f478a9f
feat(metrics): Add comprehensive metrics for SV2 proxy components
average-gary Oct 6, 2025
3326c32
feat(grafana): Add JDC performance metrics to Prometheus monitoring d…
average-gary Oct 6, 2025
10a1269
feat(proxy): Enhance SV2 custom proxy block submission and metrics tr…
average-gary Oct 6, 2025
23d249b
feat(config): Update Prometheus and tproxy configuration for network …
average-gary Oct 6, 2025
7ce7372
fix(proxy): Update share counting logic in submit share success handler
average-gary Oct 6, 2025
3db631b
chore(dockerfile): Update public pool repository source
average-gary Oct 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
toolchain: stable
profile: minimal
override: true
components: clippy

- name: Run Clippy
run: cargo clippy --workspace --all-targets -- -D warnings
Expand All @@ -45,6 +46,7 @@ jobs:
toolchain: stable
profile: minimal
override: true
components: rustfmt

- name: Run rustfmt
run: cargo fmt -- --check
Expand Down
10 changes: 10 additions & 0 deletions containers-scripts/start-sv2-tp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Start bitcoin-node in the background with IPC binding
/bitcoin/bin/bitcoin-node -chain=testnet4 -ipcbind=unix -server=1 -rpcuser=username -rpcpassword=password -rpcbind=0.0.0.0:18332 -rpcallowip=0.0.0.0/0 &

# Wait a moment for bitcoin to start
sleep 5

# Start sv2-tp in the foreground, connecting to the bitcoin node via IPC
exec /bitcoin/bin/sv2-tp -sv2port="$SV2_PORT" -sv2interval="$SV2_INTERVAL" -sv2feedelta=0 -debug=sv2 -loglevel=sv2:debug -sv2bind=0.0.0.0 -ipcconnect=unix:/root/.bitcoin/testnet4/node.sock
1 change: 1 addition & 0 deletions custom-configs/sri-roles/bitcoin-tp-miner.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ rpcuser=username
rpcpassword=password
rpcbind=0.0.0.0:18332
rpcallowip=0.0.0.0/0
ipcbind=unix

[testnet4]
rpcbind=0.0.0.0:18332
Expand Down
1 change: 1 addition & 0 deletions custom-configs/sri-roles/bitcoin-tp-pool.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ rpcuser=username
rpcpassword=password
rpcbind=0.0.0.0:18332
rpcallowip=0.0.0.0/0
ipcbind=unix

[testnet4]
rpcbind=0.0.0.0:18332
Expand Down
57 changes: 31 additions & 26 deletions custom-configs/sri-roles/config-a/jdc-config-a-docker-example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,51 @@ 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
# User identity/username for pool connection
user_identity = "jdc_user"

# target number of shares per minute applied to every downstream channel
shares_per_minute = 6.0

# Share batch size
share_batch_size = 1

# Minimum extranonce size for downstream connections
# This controls the minimum size of the extranonce field
# Min value: 2, Max value: 16
min_extranonce_size = 4

# JDC supports two modes:
# "FULLTEMPLATE" - full template mining
# "COINBASEONLY" - coinbase-only mining
mode = "FULLTEMPLATE"

# Template Provider config
# Local TP (this is pointing to localhost so you must run a TP locally for this configuration to work)
tp_address = "10.5.0.20:8440"
# Hosted testnet TP
# tp_address = "75.119.150.111:8442"

# string to be added into `extranonce_prefix`
# note: these bytes are fixed and they effectively reduce the search space available for the extranonce
# the bigger this field, the smaller the search space available for downstream
jdc_signature = "JDC"
# string to be added into the Coinbase scriptSig
jdc_signature = "Sv2MinerSignature"

# 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
# Coinbase output used to build the coinbase tx in case of Solo Mining (as last-resort solution of the pools fallback system)
#
# Coinbase outputs are specified as descriptors. A full list of descriptors is available at
# https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki#appendix-b-index-of-script-expressions
# Although the `musig` descriptor is not yet supported and the legacy `combo` descriptor never
# will be. If you have an address, embed it in a descriptor like `addr(<address here>)`.
coinbase_reward_script = "addr(tb1q3z6v6ga372pqwej23r0akpx3v6n6xdffglhd72)"

# 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 = "10.5.0.4:34254"
jd_address = "10.5.0.5:34264"
# Pool signature (string to be included in coinbase tx)
pool_signature = "Stratum V2 SRI Pool"
pool_address = "10.5.0.4"
pool_port = 34254
jds_address = "10.5.0.5"
jds_port = 34264

# [[upstreams]]
# authority_pubkey = "2di19GHYQnAZJmEpoUeP7C3Eg9TCcksHr23rZCC83dvUiZgiDL"
Expand Down
28 changes: 17 additions & 11 deletions custom-configs/sri-roles/config-a/jds-config-a-docker-example.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# If set to true, JDS require JDC to reveal the transactions they are going to mine on
full_template_mode_required = true

# SRI Pool config
authority_public_key = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72"
authority_secret_key = "mkDLTBBRxdBv998612qipDYoTK3YUrqLe8uWw7gu3iXbSrn2n"
cert_validity_sec = 3600

# List of coinbase outputs used to build the coinbase tx
# ! 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" },
]
# Version support
max_supported_version = 2
min_supported_version = 2

# Coinbase outputs are specified as descriptors. A full list of descriptors is available at
# https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki#appendix-b-index-of-script-expressions
# Although the `musig` descriptor is not yet supported and the legacy `combo` descriptor never
# will be. If you have an address, embed it in a descriptor like `addr(<address here>)`.
coinbase_reward_script = "addr(tb1q3z6v6ga372pqwej23r0akpx3v6n6xdffglhd72)"

# SRI Pool JD config
listen_jd_address = "10.5.0.5:34264"
Expand All @@ -26,3 +27,8 @@ core_rpc_pass = "password"
[mempool_update_interval]
unit = "secs"
value = 1

# Additional v1.5.0 compliance settings
[timeout]
unit = "secs"
value = 30
33 changes: 20 additions & 13 deletions custom-configs/sri-roles/config-a/pool-config-a-docker-example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,30 @@ cert_validity_sec = 3600
test_only_listen_adress_plain = "0.0.0.0:34250"
listen_address = "10.5.0.4:34254"

# List of coinbase outputs used to build the coinbase tx
# ! 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" },
]
# Version support
max_supported_version = 2
min_supported_version = 2

# Coinbase outputs are specified as descriptors. A full list of descriptors is available at
# https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki#appendix-b-index-of-script-expressions
# Although the `musig` descriptor is not yet supported and the legacy `combo` descriptor never
# will be. If you have an address, embed it in a descriptor like `addr(<address here>)`.
coinbase_reward_script = "addr(tb1q3z6v6ga372pqwej23r0akpx3v6n6xdffglhd72)"

# Server Id (number to guarantee unique search space allocation across different Pool servers)
server_id = 1

# Pool signature (string to be included in coinbase tx)
pool_signature = "Stratum V2 SRI Pool"
pool_signature = "average-benchmark"

# Template Provider config
# Local TP (this is pointing to localhost so you must run a TP locally for this configuration to work)
tp_address = "10.5.0.2:8442"

shares_per_minute = 1.0
shares_per_minute = 1.0
share_batch_size = 10

# Additional v1.5.0 compliance settings
[timeout]
unit = "secs"
value = 30
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,37 @@
# upstream_address = "18.196.32.109"
# upstream_port = 3336

# Local SRI JDC Upstream Connection
upstream_address = "10.5.0.17"
upstream_port = 34251
upstream_authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72"

# Local Mining Device Downstream Connection
downstream_address = "10.5.0.7"
downstream_address = "0.0.0.0"
downstream_port = 34256

# 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)
# Extranonce2 size for downstream connections
# This controls the rollable part of the extranonce for downstream miners
# Max value for CGminer: 8
# Min value: 2
min_extranonce2_size = 4
downstream_extranonce2_size = 4

# User identity/username for pool connection
# This will be appended with a counter for each mining client (e.g., username.miner1, username.miner2)
user_identity = "translator_user"

# Aggregate channels: if true, all miners share one upstream channel; if false, each miner gets its own channel
aggregate_channels = false

# Difficulty params
[downstream_difficulty_config]
# hashes/s of the weakest miner that will be connecting (e.g.: 10 Th/s = 10_000_000_000_000.0)
min_individual_miner_hashrate = 10_000_000_000_000.0
# target number of shares per minute the miner should be sending
shares_per_minute = 6.0
# disable variable difficulty adjustment when using with JDC (JDC handles vardiff)
enable_vardiff = false

[upstream_difficulty_config]
# interval in seconds to elapse before updating channel hashrate with the pool
channel_diff_update_interval = 60
# estimated accumulated hashrate of all downstream miners (e.g.: 10 Th/s = 10_000_000_000_000.0)
channel_nominal_hashrate = 10_000_000_000_000.0
[[upstreams]]
address = "10.5.0.17"
port = 34251
authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72"
35 changes: 21 additions & 14 deletions custom-configs/sri-roles/config-c/pool-config-c-docker-example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,33 @@ authority_public_key = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72"
authority_secret_key = "mkDLTBBRxdBv998612qipDYoTK3YUrqLe8uWw7gu3iXbSrn2n"
#authority_secret_key = "7qbpUjScc865jyX2kiB4NVJANoC7GA7TAJupdzXWkc62"
cert_validity_sec = 3600
test_only_listen_adress_plain = "0.0.0.0:34250"
test_only_listen_adress_plain = "0.0.0.0:34250"
listen_address = "10.5.0.4:34254"

# List of coinbase outputs used to build the coinbase tx
# ! 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" },
]
# Version support
max_supported_version = 2
min_supported_version = 2

# Coinbase outputs are specified as descriptors. A full list of descriptors is available at
# https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki#appendix-b-index-of-script-expressions
# Although the `musig` descriptor is not yet supported and the legacy `combo` descriptor never
# will be. If you have an address, embed it in a descriptor like `addr(<address here>)`.
coinbase_reward_script = "addr(tb1q3z6v6ga372pqwej23r0akpx3v6n6xdffglhd72)"

# Server Id (number to guarantee unique search space allocation across different Pool servers)
server_id = 1

# Pool signature (string to be included in coinbase tx)
pool_signature = "Stratum V2 SRI Pool"
pool_signature = "average-benchmark"

# Template Provider config
# Local TP (this is pointing to localhost so you must run a TP locally for this configuration to work)
tp_address = "10.5.0.20:8441"

shares_per_minute = 1.0
shares_per_minute = 1.0
share_batch_size = 10

# Additional v1.5.0 compliance settings
[timeout]
unit = "secs"
value = 30
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ min_supported_version = 2
# Min value: 2
min_extranonce2_size = 4

# Aggregate channels: if true, all miners share one upstream channel; if false, each miner gets its own channel
aggregate_channels = false

# Difficulty params
[downstream_difficulty_config]
# hashes/s of the weakest miner that will be connecting (e.g.: 10 Th/s = 10_000_000_000_000.0)
Expand All @@ -32,5 +35,3 @@ shares_per_minute = 6.0
[upstream_difficulty_config]
# interval in seconds to elapse before updating channel hashrate with the pool
channel_diff_update_interval = 60
# estimated accumulated hashrate of all downstream miners (e.g.: 10 Th/s = 10_000_000_000_000.0)
channel_nominal_hashrate = 10_000_000_000_000.0
Loading
Loading