Skip to content

adapt bitcoin_core_sv2 to Bitcoin Core v31#439

Merged
GitGab19 merged 11 commits intostratum-mining:mainfrom
plebhash:2026-04-17-bitcoin-core-v31
May 4, 2026
Merged

adapt bitcoin_core_sv2 to Bitcoin Core v31#439
GitGab19 merged 11 commits intostratum-mining:mainfrom
plebhash:2026-04-17-bitcoin-core-v31

Conversation

@plebhash
Copy link
Copy Markdown
Member

@plebhash plebhash commented Apr 17, 2026

close #318

version bumps:

  • bitcoin_core_sv2: v0.1.1 -> v0.2.0
  • pool_sv2: v0.2.2 -> v0.3.0
  • jd_server_sv2: v0.1.2 -> v0.2.0
  • jd_client_sv2: v0.1.4 -> v0.2.0
  • integration_tests_sv2: v0.1.1 -> v0.2.0

a new Version Compatibility table is also added to bitcoin_core_sv2's REAMDE.md listing all bitcoin_core_sv2 vs Bitcoin Core versions

@plebhash plebhash force-pushed the 2026-04-17-bitcoin-core-v31 branch from f5b2575 to 194238d Compare April 17, 2026 21:52
@plebhash plebhash force-pushed the 2026-04-17-bitcoin-core-v31 branch from 194238d to 32d26c7 Compare April 17, 2026 21:54
Comment thread bitcoin-core-sv2/Cargo.toml Outdated
@plebhash plebhash force-pushed the 2026-04-17-bitcoin-core-v31 branch from 32d26c7 to d4e7a97 Compare April 17, 2026 22:28
@plebhash plebhash changed the title Bitcoin Core v31 adapt bitcoin_core_sv2 to Bitcoin Core v31 Apr 17, 2026
@plebhash plebhash force-pushed the 2026-04-17-bitcoin-core-v31 branch 4 times, most recently from ccd0b3c to d52c95e Compare April 20, 2026 23:08
@plebhash

This comment was marked as outdated.

@plebhash plebhash marked this pull request as ready for review April 21, 2026 13:46
@pinheadmz
Copy link
Copy Markdown

Testing this branch with bitcoin core v31.0.0rc4 running bitcoin-node -ipcbind=unix, successful so far.

@lucasbalieiro
Copy link
Copy Markdown
Collaborator

started a testings session @ 40193a8 plebhash Tue Apr 21 09:53:24 2026 -0300 fix pool_does_not_hang_on_no_handshake test by waiting for pool listener

With bitcoin core 31 downloaded directly from the website.

Mining on signet

@lucasbalieiro
Copy link
Copy Markdown
Collaborator

started a testings session @ 40193a8 plebhash Tue Apr 21 09:53:24 2026 -0300 fix pool_does_not_hang_on_no_handshake test by waiting for pool listener

With bitcoin core 31 downloaded directly from the website.

Mining on signet

First 24 hours on Signet went ok.

Switched to mainnet

Copy link
Copy Markdown
Member

@GitGab19 GitGab19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested this yet.

I left a couple of questions in the meantime, but overall it looks good to me!

Comment thread bitcoin-core-sv2/src/job_declaration_protocol/handlers.rs
Comment thread bitcoin-core-sv2/src/job_declaration_protocol/monitors.rs
Comment thread bitcoin-core-sv2/src/template_distribution_protocol/mod.rs
Comment thread integration-tests/lib/template_provider.rs
Comment thread integration-tests/tests/translator_integration.rs
@GitGab19
Copy link
Copy Markdown
Member

If I run the Pool + JDS while Bitcoin Core is doing IBD, I don't see any warning, instead here is what I see:

2026-04-27T10:46:42.050973Z  INFO pool_sv2: JDS config present — initializing embedded Job Declaration Server
2026-04-27T10:46:42.053768Z  INFO bitcoin_core_sv2::job_declaration_protocol: Creating new BitcoinCoreSv2JDP via IPC over UNIX socket: /home/gitgab19/.bitcoin/node.sock
2026-04-27T10:46:42.055336Z  INFO bitcoin_core_sv2::job_declaration_protocol: IPC execution thread client successfully created.

@GitGab19
Copy link
Copy Markdown
Member

When running the Pool WITHOUT JDS, I get the following logs instead, which are correctly showing the warnings:

2026-04-27T10:50:42.256284Z  INFO pool_sv2: No [jds] config — Job Declaration not available
2026-04-27T10:50:42.259097Z  INFO pool_sv2: Initializing monitoring server on http://127.0.0.1:9090
2026-04-27T10:50:42.259308Z  INFO pool_sv2: Using Bitcoin Core IPC socket at: /home/gitgab19/.bitcoin/node.sock
2026-04-27T10:50:42.259370Z  INFO stratum_apps::monitoring::http_server: Starting monitoring server on http://127.0.0.1:9090
2026-04-27T10:50:42.259399Z  INFO stratum_apps::monitoring::http_server: Cache refresh interval: 15s
2026-04-27T10:50:42.259467Z  WARN pool_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-27T10:50:42.259479Z  WARN pool_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-27T10:50:42.260637Z  INFO pool_sv2::channel_manager: Starting vardiff loop for downstreams
2026-04-27T10:50:42.260667Z  INFO pool_sv2::channel_manager: Vardiff update cycle complete
2026-04-27T10:50:42.261437Z  INFO bitcoin_core_sv2::template_distribution_protocol: Creating new BitcoinCoreSv2TDP via IPC over UNIX socket: /home/gitgab19/.bitcoin/node.sock
2026-04-27T10:50:42.261901Z  INFO stratum_apps::monitoring::http_server: Swagger UI available at http://127.0.0.1:9090/swagger-ui
2026-04-27T10:50:42.261918Z  INFO stratum_apps::monitoring::http_server: Prometheus metrics available at http://127.0.0.1:9090/metrics
2026-04-27T10:50:42.262897Z  INFO bitcoin_core_sv2::template_distribution_protocol: IPC execution thread client successfully created.
2026-04-27T10:50:42.263353Z  INFO bitcoin_core_sv2::template_distribution_protocol: IPC mining client successfully created.
2026-04-27T10:50:42.263410Z  INFO bitcoin_core_sv2::template_distribution_protocol: Waiting for first CoinbaseOutputConstraints message
2026-04-27T10:50:42.263425Z  INFO bitcoin_core_sv2::template_distribution_protocol: Received: CoinbaseOutputConstraints { coinbase_output_max_additional_size: 74, coinbase_output_max_additional_sigops: 4 }
2026-04-27T10:50:43.260925Z  WARN pool_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-27T10:50:43.260977Z  WARN pool_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-27T10:50:44.261935Z  WARN pool_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-27T10:50:44.261981Z  WARN pool_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-27T10:50:45.263350Z  WARN pool_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-27T10:50:45.263406Z  WARN pool_sv2::channel_manager: Is the Bitcoin node undergoing IBD?

@lucasbalieiro
Copy link
Copy Markdown
Collaborator

lucasbalieiro commented Apr 27, 2026

For the past three days, I’ve been running the full setup on mainnet and have consistently observed the applications being terminated by the OS due to OOM. This has occurred about three times.

From the application logs, everything appears to run normally and then stops abruptly, with no errors or warnings, consistent with processes being killed by the OS. In some cases this happens after more than a day; in others, after just a few hours. I have not been able to reproduce this behavior on signet.

ziped logs attached: logs.zip

In this latest crash the apps were running at commit b78d204

Running sudo dmesg | tail -n X shows that jd_client_sv2 was killed:

[3201264.957565] Tasks state (memory values in pages):
[3201264.957566] [  pid  ]   uid  tgid total_vm      rss rss_anon rss_file rss_shmem pgtables_bytes swapents oom_score_adj name
[3201264.957583] [    841]     0   841     1806      576       64      512         0    49152        0             0 cron
[3201264.957589] [    842]   101   842     2547     1024      256      768         0    61440        0          -900 dbus-daemon
[3201264.957595] [    865]     0   865     4813     1344      576      768         0    77824        0             0 systemd-logind
[3201264.957600] [    948]     0   948     1537      480       32      448         0    57344        0             0 agetty
[3201264.957605] [    958]     0   958    27503     3136     2304      832         0   114688        0             0 unattended-upgr
[3201264.957611] [    972]     0   972     1526      480       32      448         0    49152        0             0 agetty
[3201264.957616] [   8484]  1000  8484     5070     1216      480      736         0    81920        0           100 systemd
[3201264.957621] [   8486]  1000  8486     5288      719      431      288         0    73728        0           100 (sd-pam)
[3201264.957625] [   8628]  1000  8628    11313     6401     5985      416         0   139264        0             0 tmux: server
[3201264.957629] [   8629]  1000  8629     2312      928      416      512         0    61440        0             0 bash
[3201264.957633] [   8630]  1000  8630     2387      928       96      832         0    57344        0           200 dbus-daemon
[3201264.957637] [  29887]  1000 29887     2282      960      416      544         0    65536        0             0 bash
[3201264.957641] [  30275]  1000 30275     4285      960      288      672         0    86016        0             0 sudo
[3201264.957645] [  30276]  1000 30276     4285      557      301      256         0    73728        0             0 sudo
[3201264.957650] [  30277]     0 30277   317371     3134     3134        0         0   217088        0             0 caddy
[3201264.957654] [ 105135]  1000 105135    62926     3000     2392      608         0   135168        0             0 transmission-cl
[3201264.957659] [ 105449]  1000 105449     2282      928      384      544         0    53248        0             0 bash
[3201264.957662] [ 336662]     0 336662     3037      800      256      544         0    69632        0         -1000 sshd
[3201264.957666] [ 541009]     0 541009    25913     1034      256      778         0   196608        0          -250 systemd-journal
[3201264.957670] [ 541010]   996 541010    22757      960      224      736         0    81920        0             0 systemd-timesyn
[3201264.957674] [ 541011]     0 541011    55896     6720     4576     2144         0   106496        0         -1000 multipathd
[3201264.957678] [ 541019]   991 541019     5396     1248      544      704         0    90112        0             0 systemd-resolve
[3201264.957682] [ 541025]   989 541025    77041      992      192      800         0    98304        0             0 polkitd
[3201264.957686] [ 541037]     0 541037   158870     2398     1413      985         0   569344        0             0 fwupd
[3201264.957690] [ 541038]     0 541038     6264     1056      384      672         0    73728        0         -1000 systemd-udevd
[3201264.957694] [ 541040]     0 541040   117248     1376      480      896         0   143360        0             0 udisksd
[3201264.957794] [ 541044]   102 541044    55627     1056      256      800         0    86016        0             0 rsyslogd
[3201264.957800] [ 541065]     0 541065    79590     1312      448      864         0   126976        0             0 ModemManager
[3201264.957805] [ 541073]   998 541073     4752      992      288      704         0    77824        0             0 systemd-network
[3201264.957810] [ 548997]  1000 548997   595029    18122    17156      966         0   512000        0             0 bitcoin-node
[3201264.957815] [ 570055]  1000 570055  4170601   285997   284758     1239         0 23654400        0             0 bitcoin-node
[3201264.957839] [ 618809]  1000 618809     2579     1184      672      512         0    57344        0             0 bash
[3201264.957843] [ 619124]  1000 619124   521627    44946    44306      640         0   712704        0             0 sv2-getting-sta
[3201264.957848] [ 620795]  1000 620795   248536    27895    27319      576         0   417792        0             0 pool_sv2
[3201264.957851] [ 620796]  1000 620796  1668513  1548760  1547800      960         0 12566528        0             0 jd_client_sv2
[3201264.957856] [ 620797]  1000 620797    74186     1589     1045      544         0   114688        0             0 translator_sv2
[3201264.957860] [ 620798]  1000 620798    58315      512       64      448         0    77824        0             0 minerd
[3201264.957867] [ 627752]     0 627752     3006      864      224      640         0    61440        0             0 sshd
[3201264.957870] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/user@1000.service/tmux-spawn-d7018a37-0e48-4e41-9730-600002927293.scope,task=jd_client_sv2,pid=620796,uid=1000
[3201264.957965] Out of memory: Killed process 620796 (jd_client_sv2) total-vm:6674052kB, anon-rss:6191200kB, file-rss:3840kB, shmem-rss:0kB, UID:1000 pgtables:12272kB oom_score_adj:0
[3202029.013487] free (627930): drop_caches: 1

greping the dmesg shows that the problem was always the jdc in every session:

sudo dmesg | grep -i 'killed process'
[2948306.132421] Out of memory: Killed process 570296 (jd_client_sv2) total-vm:6868580kB, anon-rss:6451612kB, file-rss:3840kB, shmem-rss:0kB, UID:1000 pgtables:12776kB oom_score_adj:0
[2970120.615123] Out of memory: Killed process 577945 (jd_client_sv2) total-vm:6738940kB, anon-rss:6320964kB, file-rss:3328kB, shmem-rss:0kB, UID:1000 pgtables:12536kB oom_score_adj:0
[3201264.957965] Out of memory: Killed process 620796 (jd_client_sv2) total-vm:6674052kB, anon-rss:6191200kB, file-rss:3840kB, shmem-rss:0kB, UID:1000 pgtables:12272kB oom_score_adj:0

my config files diff:

diff --git a/miner-apps/jd-client/config-examples/signet/jdc-config-bitcoin-core-ipc-local-infra-example.toml b/miner-apps/jd-client/config-examples/signet/jdc-config-bitcoin-core-ipc-local-infra-example.toml
index 1a29688b..1a6c0d83 100644
--- a/miner-apps/jd-client/config-examples/signet/jdc-config-bitcoin-core-ipc-local-infra-example.toml
+++ b/miner-apps/jd-client/config-examples/signet/jdc-config-bitcoin-core-ipc-local-infra-example.toml
@@ -32 +32 @@ mode = "FULLTEMPLATE"
-jdc_signature = "Sv2MinerSignature"
+jdc_signature = "autopilot-439"
@@ -80 +80 @@ jds_port = 33334
-network = "signet"
+network = "mainnet"
diff --git a/miner-apps/translator/config-examples/signet/tproxy-config-local-jdc-example.toml b/miner-apps/translator/config-examples/signet/tproxy-config-local-jdc-example.toml
index ae9565ad..b9f0f815 100644
--- a/miner-apps/translator/config-examples/signet/tproxy-config-local-jdc-example.toml
+++ b/miner-apps/translator/config-examples/signet/tproxy-config-local-jdc-example.toml
@@ -41 +41 @@ monitoring_cache_refresh_secs = 15
-min_individual_miner_hashrate=10_000_000_000_000.0
+min_individual_miner_hashrate=10_000_000.0
diff --git a/pool-apps/pool/config-examples/signet/pool-config-bitcoin-core-ipc-example.toml b/pool-apps/pool/config-examples/signet/pool-config-bitcoin-core-ipc-example.toml
index 97b2aba1..18d93b3d 100644
--- a/pool-apps/pool/config-examples/signet/pool-config-bitcoin-core-ipc-example.toml
+++ b/pool-apps/pool/config-examples/signet/pool-config-bitcoin-core-ipc-example.toml
@@ -36 +36 @@ monitoring_cache_refresh_secs = 15
-network = "signet"
+network = "mainnet"

VPS Details

lscpu && echo && free -h && echo && uname -a
Architecture:                x86_64
  CPU op-mode(s):            32-bit, 64-bit
  Address sizes:             52 bits physical, 48 bits virtual
  Byte Order:                Little Endian
CPU(s):                      4
  On-line CPU(s) list:       0-3
Vendor ID:                   AuthenticAMD
  Model name:                AMD EPYC Processor (with IBPB)
    CPU family:              23
    Model:                   1
    Thread(s) per core:      1
    Core(s) per socket:      4
    Socket(s):               1
    Stepping:                2
    BogoMIPS:                4992.50
    Flags:                   fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid ext
                             d_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misal
                             ignsse 3dnowprefetch osvw topoext ssbd ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 arat
Virtualization features:     
  Hypervisor vendor:         KVM
  Virtualization type:       full
Caches (sum of all):         
  L1d:                       128 KiB (4 instances)
  L1i:                       256 KiB (4 instances)
  L2:                        2 MiB (4 instances)
  L3:                        8 MiB (1 instance)
NUMA:                        
  NUMA node(s):              1
  NUMA node0 CPU(s):         0-3
Vulnerabilities:             
  Gather data sampling:      Not affected
  Indirect target selection: Not affected
  Itlb multihit:             Not affected
  L1tf:                      Not affected
  Mds:                       Not affected
  Meltdown:                  Not affected
  Mmio stale data:           Not affected
  Reg file data sampling:    Not affected
  Retbleed:                  Mitigation; untrained return thunk; SMT disabled
  Spec rstack overflow:      Vulnerable: Safe RET, no microcode
  Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:                Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:                Mitigation; Retpolines; IBPB conditional; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
  Srbds:                     Not affected
  Tsa:                       Not affected
  Tsx async abort:           Not affected
  Vmscape:                   Not affected

               total        used        free      shared  buff/cache   available
Mem:           7.8Gi       1.7Gi       5.6Gi       1.0Mi       793Mi       6.1Gi
Swap:             0B          0B          0B

Linux vmi2897539 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux

@plebhash
Copy link
Copy Markdown
Member Author

If I run the Pool + JDS while Bitcoin Core is doing IBD, I don't see any warning, instead here is what I see:

2026-04-27T10:46:42.050973Z  INFO pool_sv2: JDS config present — initializing embedded Job Declaration Server
2026-04-27T10:46:42.053768Z  INFO bitcoin_core_sv2::job_declaration_protocol: Creating new BitcoinCoreSv2JDP via IPC over UNIX socket: /home/gitgab19/.bitcoin/node.sock
2026-04-27T10:46:42.055336Z  INFO bitcoin_core_sv2::job_declaration_protocol: IPC execution thread client successfully created.

should be fixed via 1e97f2f

@plebhash
Copy link
Copy Markdown
Member Author

@lucasbalieiro looking at the provided logs.zip it seems Pool+JDS is on signet, while JDC is on mainnet?

pool.log:

2026-04-27T16:01:11.996462Z  INFO bitcoin_core_sv2::job_declaration_protocol: Creating new BitcoinCoreSv2JDP via IPC over UNIX socket: /home/admin/.bitcoin/signet/node.sock

jd-client.log:

2026-04-27T16:01:12.056958Z  INFO bitcoin_core_sv2::template_distribution_protocol: Creating new BitcoinCoreSv2TDP via IPC over UNIX socket: /home/admin/.bitcoin/node.sock

@lucasbalieiro
Copy link
Copy Markdown
Collaborator

@lucasbalieiro looking at the provided logs.zip it seems Pool+JDS is on signet, while JDC is on mainnet?

pool.log:

2026-04-27T16:01:11.996462Z  INFO bitcoin_core_sv2::job_declaration_protocol: Creating new BitcoinCoreSv2JDP via IPC over UNIX socket: /home/admin/.bitcoin/signet/node.sock

jd-client.log:

2026-04-27T16:01:12.056958Z  INFO bitcoin_core_sv2::template_distribution_protocol: Creating new BitcoinCoreSv2TDP via IPC over UNIX socket: /home/admin/.bitcoin/node.sock

Oh 🤦‍♂️, sorry.

Yes, my Pool/JDS were on signet.

I adjusted the setup so now everything is in mainnet.
From last night to this morning the RAM usage got up to 2,19 Gb

@plebhash plebhash force-pushed the 2026-04-17-bitcoin-core-v31 branch from 1e97f2f to ad23dc4 Compare April 28, 2026 14:43
@plebhash
Copy link
Copy Markdown
Member Author

From last night to this morning the RAM usage got up to 2,19 Gb

in which process specifically?

@GitGab19
Copy link
Copy Markdown
Member

My testing session went pretty fine, for more than 24h.

I just noticed a small issue on JDC though, which can be reproduced in the following way:

  • run Pool+JDS
  • run JDC
  • wait for the connection to be established
  • kill Pool+JDS

At this point JDC does fallback to solo mining, but it keeps printing the warning logs, and cannot be killed with ctrl+c anymore.

Here the JDC logs I'm referring to:

2026-04-29T08:45:04.383266Z  INFO jd_client_sv2: Job declarator client starting... setting up subsystems, User Identity: your_username_here
2026-04-29T08:45:04.383420Z  INFO jd_client_sv2: Initializing monitoring server on http://0.0.0.0:9091
2026-04-29T08:45:04.383695Z  INFO jd_client_sv2: Using Bitcoin Core IPC socket at: /home/gitgab19/.bitcoin/node.sock
2026-04-29T08:45:04.383738Z  INFO stratum_apps::monitoring::http_server: Starting monitoring server on http://0.0.0.0:9091
2026-04-29T08:45:04.383763Z  INFO stratum_apps::monitoring::http_server: Cache refresh interval: 15s
2026-04-29T08:45:04.383975Z  INFO jd_client_sv2: Attempting to initialize upstream...
2026-04-29T08:45:04.383994Z  INFO jd_client_sv2: Trying upstream 1 of 1: pool=0.0.0.0:3333, jds=0.0.0.0:3334
2026-04-29T08:45:04.385140Z  INFO jd_client_sv2::channel_manager: Starting vardiff loop for downstreams
2026-04-29T08:45:04.385177Z  INFO jd_client_sv2::channel_manager: Vardiff update cycle complete
2026-04-29T08:45:04.386393Z  INFO bitcoin_core_sv2::template_distribution_protocol: Creating new BitcoinCoreSv2TDP via IPC over UNIX socket: /home/gitgab19/.bitcoin/node.sock
2026-04-29T08:45:04.387301Z  INFO stratum_apps::monitoring::http_server: Swagger UI available at http://0.0.0.0:9091/swagger-ui
2026-04-29T08:45:04.387342Z  INFO stratum_apps::monitoring::http_server: Prometheus metrics available at http://0.0.0.0:9091/metrics
2026-04-29T08:45:04.387940Z  INFO bitcoin_core_sv2::template_distribution_protocol: IPC execution thread client successfully created.
2026-04-29T08:45:04.388547Z  INFO bitcoin_core_sv2::template_distribution_protocol: IPC mining client successfully created.
2026-04-29T08:45:04.388605Z  INFO bitcoin_core_sv2::template_distribution_protocol: Waiting for first CoinbaseOutputConstraints message
2026-04-29T08:45:04.388628Z  INFO bitcoin_core_sv2::template_distribution_protocol: Received: CoinbaseOutputConstraints { coinbase_output_max_additional_size: 31, coinbase_output_max_additional_sigops: 0 }
2026-04-29T08:45:04.430808Z  INFO jd_client_sv2::channel_manager::template_message_handler: Received: NewTemplate(template_id: 0, future_template: true, version: 0x20000000, coinbase_tx_version: 0x00000002, coinbase_prefix: B0255(03b5730e), coinbase_tx_input_sequence: 0xfffffffe, coinbase_tx_value_remaining: 315260710, coinbase_tx_outputs_count: 1, coinbase_tx_outputs: B064K(0000000000000000266a24aa21a9edef5cb5d3692e7a40845744e0f5ffa2d0ee23324df7517fa40836bf57842ab84f), coinbase_tx_locktime: 947124, merkle_path: Seq0255<len=12: [a904f5e35aef56e965c9f92b12f32b607a4416bbd1cd890e260877c24a6b9306, 093a951550b4dcab29a6a09310e82f75c0c0cc8ff2417d864a3096e0ea5ab842, ... , cf9256178f06de7a131ce2231c7854851b9f67ef1a2eadc5fe42e5194723dee8, 35ad6045499d672acc0714eb85e54ee4c0b35b707997c405bca79e4e681f23ab])
2026-04-29T08:45:04.431035Z  INFO jd_client_sv2::channel_manager::template_message_handler: Received: SetNewPrevHash { template_id: 0, prev_hash: U256(00000000000000000001d74c7bf940205aff01f1cab58944914ab326d6fd73f1), header_timestamp: 1777452304, n_bits: 0x17021369, target: U256(0000000000000000000213690000000000000000000000000000000000000000) }
2026-04-29T08:45:05.385609Z  INFO jd_client_sv2: Connection attempt 1/3...
2026-04-29T08:45:05.385732Z  INFO jd_client_sv2: Upstream connection in-progress at initialize single
2026-04-29T08:45:05.386221Z  INFO jd_client_sv2::upstream: Connected to upstream at 0.0.0.0:3333
2026-04-29T08:45:05.390370Z  INFO jd_client_sv2: Upstream connection done at initialize single
2026-04-29T08:45:05.390395Z  INFO jd_client_sv2::job_declarator: Connecting to JD Server at 0.0.0.0:3334
2026-04-29T08:45:05.390712Z  INFO jd_client_sv2::job_declarator: Connection established with JD Server at 0.0.0.0:3334 in mode: JDMode { inner: 2, config_mode: FullTemplate }
2026-04-29T08:45:05.394138Z  INFO jd_client_sv2::upstream: Upstream: initiating SV2 handshake...
2026-04-29T08:45:05.394186Z  INFO jd_client_sv2::upstream: Sent `SetupConnection` to upstream, awaiting response...
2026-04-29T08:45:05.395355Z  INFO jd_client_sv2::upstream: Dispatching inbound handshake message ext_type=0 msg_type=1
2026-04-29T08:45:05.395435Z  INFO jd_client_sv2::upstream::message_handler: Received: SetupConnectionSuccess(used_version: 2, flags: 0x00000002)
2026-04-29T08:45:05.395475Z  INFO jd_client_sv2::job_declarator: Sending SetupConnection to JDS at 0.0.0.0:3334
2026-04-29T08:45:05.396297Z  INFO jd_client_sv2::job_declarator::message_handler: Received: SetupConnectionSuccess(used_version: 2, flags: 0x00000000)
2026-04-29T08:45:05.396329Z  INFO jd_client_sv2::job_declarator: Job declarator: SV2 handshake completed successfully.
2026-04-29T08:45:05.396378Z  INFO jd_client_sv2::channel_manager: Requested allocation of 2 mining job tokens to JDS
2026-04-29T08:45:05.396395Z  INFO jd_client_sv2::channel_manager: Required template data received, ready to accept connections
2026-04-29T08:45:05.396403Z  INFO jd_client_sv2::channel_manager: Starting downstream server at 127.0.0.1:34265
2026-04-29T08:45:05.396500Z  INFO jd_client_sv2: Spawning status listener task...
2026-04-29T08:45:05.397135Z  INFO jd_client_sv2::channel_manager::jd_message_handler: Received: AllocateMiningJobTokenSuccess(request_id: 0, mining_job_token: B0255(0000000000000000), coinbase_outputs: B064K(01000000000000000016001458806074c426bedea9376ac34685eca699f4e90f))
2026-04-29T08:45:05.397182Z  INFO jd_client_sv2::channel_manager::jd_message_handler: Coinbase outputs from JDS changed, recalculating constraints
2026-04-29T08:45:05.397208Z  INFO jd_client_sv2::channel_manager::jd_message_handler: Sent updated CoinbaseOutputConstraints to TP channel
2026-04-29T08:45:05.397276Z  INFO bitcoin_core_sv2::template_distribution_protocol::monitors: Received: CoinbaseOutputConstraints: CoinbaseOutputConstraints(coinbase_output_max_additional_size: 31, coinbase_output_max_additional_sigops: 0)
2026-04-29T08:45:05.397312Z  INFO jd_client_sv2::channel_manager::jd_message_handler: Received: AllocateMiningJobTokenSuccess(request_id: 1, mining_job_token: B0255(0100000000000000), coinbase_outputs: B064K(01000000000000000016001458806074c426bedea9376ac34685eca699f4e90f))
2026-04-29T08:45:05.398055Z  WARN bitcoin_core_sv2::template_distribution_protocol::monitors: Exiting mempool change monitoring loop
2026-04-29T08:45:06.260237Z ERROR jd_client_sv2::io_task: Reader error error=SocketClosed
2026-04-29T08:45:06.260243Z ERROR jd_client_sv2::io_task: Reader error error=SocketClosed
2026-04-29T08:45:06.260306Z  WARN jd_client_sv2::io_task: Reader task exited.
2026-04-29T08:45:06.260314Z  WARN jd_client_sv2::io_task: Reader task exited.
2026-04-29T08:45:06.260393Z ERROR jd_client_sv2::upstream: Upstream: error handling pool message. error=JDCError { kind: ChannelErrorReceiver(RecvError), action: Fallback, _owner: PhantomData<jd_client_sv2::error::Upstream> }
2026-04-29T08:45:06.260426Z  WARN jd_client_sv2::upstream: Upstream::handle_pool_message_frame requested fallback error_kind=ChannelErrorReceiver(RecvError)
2026-04-29T08:45:06.260447Z  WARN jd_client_sv2::upstream: Upstream: unified message loop exited.
2026-04-29T08:45:06.260474Z  WARN jd_client_sv2::io_task: Writer task exited.
2026-04-29T08:45:06.260473Z  WARN jd_client_sv2: Upstream/Job Declarator connection dropped — attempting reconnection...
2026-04-29T08:45:06.260483Z  INFO jd_client_sv2::channel_manager: Channel Manager: fallback triggered, resetting state
2026-04-29T08:45:06.260499Z  INFO jd_client_sv2: Monitoring server: fallback triggered.
2026-04-29T08:45:06.260516Z  INFO stratum_apps::monitoring::http_server: Monitoring server received shutdown signal, stopping...
2026-04-29T08:45:06.260511Z  INFO jd_client_sv2::job_declarator: Job Declarator: fallback triggered
2026-04-29T08:45:06.260538Z  INFO jd_client_sv2::channel_manager: Downstream Server: received fallback signal
2026-04-29T08:45:06.260537Z  WARN jd_client_sv2::io_task: Writer task exited.
2026-04-29T08:45:06.260542Z  INFO jd_client_sv2::channel_manager: Downstream server: Unified loop break
2026-04-29T08:45:06.260540Z  WARN jd_client_sv2::job_declarator: JobDeclarator: unified message loop exited.
2026-04-29T08:45:06.260715Z  INFO stratum_apps::monitoring::http_server: Monitoring server stopped
2026-04-29T08:45:06.260727Z  INFO jd_client_sv2: Monitoring server task exited and signaled fallback coordinator
2026-04-29T08:45:06.260733Z  INFO jd_client_sv2: All components finished fallback cleanup
2026-04-29T08:45:06.260740Z  INFO jd_client_sv2: Existing Upstream or JD instance taken out. Preparing fallback.
2026-04-29T08:45:06.260834Z  INFO jd_client_sv2: Attempting to initialize Jd and upstream...
2026-04-29T08:45:06.260845Z  INFO jd_client_sv2: Trying upstream 1 of 1: pool=0.0.0.0:3333, jds=0.0.0.0:3334
2026-04-29T08:45:06.260877Z  INFO bitcoin_core_sv2::template_distribution_protocol::monitors: Received: CoinbaseOutputConstraints: CoinbaseOutputConstraints(coinbase_output_max_additional_size: 31, coinbase_output_max_additional_sigops: 0)
2026-04-29T08:45:06.262126Z  INFO jd_client_sv2::channel_manager: Starting vardiff loop for downstreams
2026-04-29T08:45:06.262156Z  INFO jd_client_sv2::channel_manager: Vardiff update cycle complete
2026-04-29T08:45:06.262312Z  WARN bitcoin_core_sv2::template_distribution_protocol::monitors: Exiting mempool change monitoring loop
2026-04-29T08:45:07.262565Z  INFO jd_client_sv2: Upstream previously marked as malicious, skipping initial attempt warnings.
2026-04-29T08:45:07.262605Z ERROR jd_client_sv2: All upstreams failed after 3 retries each
2026-04-29T08:45:07.262620Z ERROR jd_client_sv2: Failed to initialize upstream: CouldNotInitiateSystem
2026-04-29T08:45:07.262629Z  INFO jd_client_sv2: Fallback to solo mining mode
2026-04-29T08:45:07.262634Z  INFO jd_client_sv2: Reinitializing monitoring server on http://0.0.0.0:9091
2026-04-29T08:45:07.262785Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:07.262792Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-29T08:45:07.262934Z  INFO stratum_apps::monitoring::http_server: Starting monitoring server on http://0.0.0.0:9091
2026-04-29T08:45:07.262963Z  INFO stratum_apps::monitoring::http_server: Cache refresh interval: 15s
2026-04-29T08:45:07.264919Z  INFO stratum_apps::monitoring::http_server: Swagger UI available at http://0.0.0.0:9091/swagger-ui
2026-04-29T08:45:07.264939Z  INFO stratum_apps::monitoring::http_server: Prometheus metrics available at http://0.0.0.0:9091/metrics
2026-04-29T08:45:08.264599Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:08.264641Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-29T08:45:09.266627Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:09.266671Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-29T08:45:09.431726Z  INFO bitcoin_core_sv2::template_distribution_protocol::monitors: 💹 Mempool fees increased! Sending NewTemplate message.
2026-04-29T08:45:09.432019Z  INFO jd_client_sv2::channel_manager::template_message_handler: Received: NewTemplate(template_id: 1, future_template: false, version: 0x20000000, coinbase_tx_version: 0x00000002, coinbase_prefix: B0255(03b5730e), coinbase_tx_input_sequence: 0xfffffffe, coinbase_tx_value_remaining: 315261839, coinbase_tx_outputs_count: 1, coinbase_tx_outputs: B064K(0000000000000000266a24aa21a9edf91554cfbef4df506c67ee2f7289ac5c9e1b8640388503fd92db470c6003a5da), coinbase_tx_locktime: 947124, merkle_path: Seq0255<len=12: [a904f5e35aef56e965c9f92b12f32b607a4416bbd1cd890e260877c24a6b9306, 093a951550b4dcab29a6a09310e82f75c0c0cc8ff2417d864a3096e0ea5ab842, ... , db5ad623b55a538156f953183d188f794b9b20e804f877d4f69c1c5cdcf0b037, e8a8c203803e14000c4bdac4e2b429924db47ad270126795926c292f0049fb06])
2026-04-29T08:45:10.269500Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:10.269559Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-29T08:45:11.271619Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:11.271658Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-29T08:45:12.273175Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:12.273217Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-29T08:45:13.273888Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:13.273949Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
^C^X2026-04-29T08:45:14.274760Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:14.274805Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-29T08:45:14.433490Z  INFO bitcoin_core_sv2::template_distribution_protocol::monitors: 💹 Mempool fees increased! Sending NewTemplate message.
2026-04-29T08:45:14.433717Z  INFO jd_client_sv2::channel_manager::template_message_handler: Received: NewTemplate(template_id: 2, future_template: false, version: 0x20000000, coinbase_tx_version: 0x00000002, coinbase_prefix: B0255(03b5730e), coinbase_tx_input_sequence: 0xfffffffe, coinbase_tx_value_remaining: 315263961, coinbase_tx_outputs_count: 1, coinbase_tx_outputs: B064K(0000000000000000266a24aa21a9ede9fc0ffb0126a921e283e27c531b5da4712c9c5231284a2e64978d8dc1b3deda), coinbase_tx_locktime: 947124, merkle_path: Seq0255<len=12: [a904f5e35aef56e965c9f92b12f32b607a4416bbd1cd890e260877c24a6b9306, 093a951550b4dcab29a6a09310e82f75c0c0cc8ff2417d864a3096e0ea5ab842, ... , a6e8a680993730f2a9961e87c20ff2db32ed525aff6e5d00219164f160a27165, 9b261b973d860449f6716176a47703b7bb9a123f493ae87a1b5c7ce964a36927])
^Z

@Shourya742
Copy link
Copy Markdown
Member

My testing session went pretty fine, for more than 24h.

I just noticed a small issue on JDC though, which can be reproduced in the following way:

  • run Pool+JDS
  • run JDC
  • wait for the connection to be established
  • kill Pool+JDS

At this point JDC does fallback to solo mining, but it keeps printing the warning logs, and cannot be killed with ctrl+c anymore.

Here the JDC logs I'm referring to:

2026-04-29T08:45:04.383266Z  INFO jd_client_sv2: Job declarator client starting... setting up subsystems, User Identity: your_username_here
2026-04-29T08:45:04.383420Z  INFO jd_client_sv2: Initializing monitoring server on http://0.0.0.0:9091
2026-04-29T08:45:04.383695Z  INFO jd_client_sv2: Using Bitcoin Core IPC socket at: /home/gitgab19/.bitcoin/node.sock
2026-04-29T08:45:04.383738Z  INFO stratum_apps::monitoring::http_server: Starting monitoring server on http://0.0.0.0:9091
2026-04-29T08:45:04.383763Z  INFO stratum_apps::monitoring::http_server: Cache refresh interval: 15s
2026-04-29T08:45:04.383975Z  INFO jd_client_sv2: Attempting to initialize upstream...
2026-04-29T08:45:04.383994Z  INFO jd_client_sv2: Trying upstream 1 of 1: pool=0.0.0.0:3333, jds=0.0.0.0:3334
2026-04-29T08:45:04.385140Z  INFO jd_client_sv2::channel_manager: Starting vardiff loop for downstreams
2026-04-29T08:45:04.385177Z  INFO jd_client_sv2::channel_manager: Vardiff update cycle complete
2026-04-29T08:45:04.386393Z  INFO bitcoin_core_sv2::template_distribution_protocol: Creating new BitcoinCoreSv2TDP via IPC over UNIX socket: /home/gitgab19/.bitcoin/node.sock
2026-04-29T08:45:04.387301Z  INFO stratum_apps::monitoring::http_server: Swagger UI available at http://0.0.0.0:9091/swagger-ui
2026-04-29T08:45:04.387342Z  INFO stratum_apps::monitoring::http_server: Prometheus metrics available at http://0.0.0.0:9091/metrics
2026-04-29T08:45:04.387940Z  INFO bitcoin_core_sv2::template_distribution_protocol: IPC execution thread client successfully created.
2026-04-29T08:45:04.388547Z  INFO bitcoin_core_sv2::template_distribution_protocol: IPC mining client successfully created.
2026-04-29T08:45:04.388605Z  INFO bitcoin_core_sv2::template_distribution_protocol: Waiting for first CoinbaseOutputConstraints message
2026-04-29T08:45:04.388628Z  INFO bitcoin_core_sv2::template_distribution_protocol: Received: CoinbaseOutputConstraints { coinbase_output_max_additional_size: 31, coinbase_output_max_additional_sigops: 0 }
2026-04-29T08:45:04.430808Z  INFO jd_client_sv2::channel_manager::template_message_handler: Received: NewTemplate(template_id: 0, future_template: true, version: 0x20000000, coinbase_tx_version: 0x00000002, coinbase_prefix: B0255(03b5730e), coinbase_tx_input_sequence: 0xfffffffe, coinbase_tx_value_remaining: 315260710, coinbase_tx_outputs_count: 1, coinbase_tx_outputs: B064K(0000000000000000266a24aa21a9edef5cb5d3692e7a40845744e0f5ffa2d0ee23324df7517fa40836bf57842ab84f), coinbase_tx_locktime: 947124, merkle_path: Seq0255<len=12: [a904f5e35aef56e965c9f92b12f32b607a4416bbd1cd890e260877c24a6b9306, 093a951550b4dcab29a6a09310e82f75c0c0cc8ff2417d864a3096e0ea5ab842, ... , cf9256178f06de7a131ce2231c7854851b9f67ef1a2eadc5fe42e5194723dee8, 35ad6045499d672acc0714eb85e54ee4c0b35b707997c405bca79e4e681f23ab])
2026-04-29T08:45:04.431035Z  INFO jd_client_sv2::channel_manager::template_message_handler: Received: SetNewPrevHash { template_id: 0, prev_hash: U256(00000000000000000001d74c7bf940205aff01f1cab58944914ab326d6fd73f1), header_timestamp: 1777452304, n_bits: 0x17021369, target: U256(0000000000000000000213690000000000000000000000000000000000000000) }
2026-04-29T08:45:05.385609Z  INFO jd_client_sv2: Connection attempt 1/3...
2026-04-29T08:45:05.385732Z  INFO jd_client_sv2: Upstream connection in-progress at initialize single
2026-04-29T08:45:05.386221Z  INFO jd_client_sv2::upstream: Connected to upstream at 0.0.0.0:3333
2026-04-29T08:45:05.390370Z  INFO jd_client_sv2: Upstream connection done at initialize single
2026-04-29T08:45:05.390395Z  INFO jd_client_sv2::job_declarator: Connecting to JD Server at 0.0.0.0:3334
2026-04-29T08:45:05.390712Z  INFO jd_client_sv2::job_declarator: Connection established with JD Server at 0.0.0.0:3334 in mode: JDMode { inner: 2, config_mode: FullTemplate }
2026-04-29T08:45:05.394138Z  INFO jd_client_sv2::upstream: Upstream: initiating SV2 handshake...
2026-04-29T08:45:05.394186Z  INFO jd_client_sv2::upstream: Sent `SetupConnection` to upstream, awaiting response...
2026-04-29T08:45:05.395355Z  INFO jd_client_sv2::upstream: Dispatching inbound handshake message ext_type=0 msg_type=1
2026-04-29T08:45:05.395435Z  INFO jd_client_sv2::upstream::message_handler: Received: SetupConnectionSuccess(used_version: 2, flags: 0x00000002)
2026-04-29T08:45:05.395475Z  INFO jd_client_sv2::job_declarator: Sending SetupConnection to JDS at 0.0.0.0:3334
2026-04-29T08:45:05.396297Z  INFO jd_client_sv2::job_declarator::message_handler: Received: SetupConnectionSuccess(used_version: 2, flags: 0x00000000)
2026-04-29T08:45:05.396329Z  INFO jd_client_sv2::job_declarator: Job declarator: SV2 handshake completed successfully.
2026-04-29T08:45:05.396378Z  INFO jd_client_sv2::channel_manager: Requested allocation of 2 mining job tokens to JDS
2026-04-29T08:45:05.396395Z  INFO jd_client_sv2::channel_manager: Required template data received, ready to accept connections
2026-04-29T08:45:05.396403Z  INFO jd_client_sv2::channel_manager: Starting downstream server at 127.0.0.1:34265
2026-04-29T08:45:05.396500Z  INFO jd_client_sv2: Spawning status listener task...
2026-04-29T08:45:05.397135Z  INFO jd_client_sv2::channel_manager::jd_message_handler: Received: AllocateMiningJobTokenSuccess(request_id: 0, mining_job_token: B0255(0000000000000000), coinbase_outputs: B064K(01000000000000000016001458806074c426bedea9376ac34685eca699f4e90f))
2026-04-29T08:45:05.397182Z  INFO jd_client_sv2::channel_manager::jd_message_handler: Coinbase outputs from JDS changed, recalculating constraints
2026-04-29T08:45:05.397208Z  INFO jd_client_sv2::channel_manager::jd_message_handler: Sent updated CoinbaseOutputConstraints to TP channel
2026-04-29T08:45:05.397276Z  INFO bitcoin_core_sv2::template_distribution_protocol::monitors: Received: CoinbaseOutputConstraints: CoinbaseOutputConstraints(coinbase_output_max_additional_size: 31, coinbase_output_max_additional_sigops: 0)
2026-04-29T08:45:05.397312Z  INFO jd_client_sv2::channel_manager::jd_message_handler: Received: AllocateMiningJobTokenSuccess(request_id: 1, mining_job_token: B0255(0100000000000000), coinbase_outputs: B064K(01000000000000000016001458806074c426bedea9376ac34685eca699f4e90f))
2026-04-29T08:45:05.398055Z  WARN bitcoin_core_sv2::template_distribution_protocol::monitors: Exiting mempool change monitoring loop
2026-04-29T08:45:06.260237Z ERROR jd_client_sv2::io_task: Reader error error=SocketClosed
2026-04-29T08:45:06.260243Z ERROR jd_client_sv2::io_task: Reader error error=SocketClosed
2026-04-29T08:45:06.260306Z  WARN jd_client_sv2::io_task: Reader task exited.
2026-04-29T08:45:06.260314Z  WARN jd_client_sv2::io_task: Reader task exited.
2026-04-29T08:45:06.260393Z ERROR jd_client_sv2::upstream: Upstream: error handling pool message. error=JDCError { kind: ChannelErrorReceiver(RecvError), action: Fallback, _owner: PhantomData<jd_client_sv2::error::Upstream> }
2026-04-29T08:45:06.260426Z  WARN jd_client_sv2::upstream: Upstream::handle_pool_message_frame requested fallback error_kind=ChannelErrorReceiver(RecvError)
2026-04-29T08:45:06.260447Z  WARN jd_client_sv2::upstream: Upstream: unified message loop exited.
2026-04-29T08:45:06.260474Z  WARN jd_client_sv2::io_task: Writer task exited.
2026-04-29T08:45:06.260473Z  WARN jd_client_sv2: Upstream/Job Declarator connection dropped — attempting reconnection...
2026-04-29T08:45:06.260483Z  INFO jd_client_sv2::channel_manager: Channel Manager: fallback triggered, resetting state
2026-04-29T08:45:06.260499Z  INFO jd_client_sv2: Monitoring server: fallback triggered.
2026-04-29T08:45:06.260516Z  INFO stratum_apps::monitoring::http_server: Monitoring server received shutdown signal, stopping...
2026-04-29T08:45:06.260511Z  INFO jd_client_sv2::job_declarator: Job Declarator: fallback triggered
2026-04-29T08:45:06.260538Z  INFO jd_client_sv2::channel_manager: Downstream Server: received fallback signal
2026-04-29T08:45:06.260537Z  WARN jd_client_sv2::io_task: Writer task exited.
2026-04-29T08:45:06.260542Z  INFO jd_client_sv2::channel_manager: Downstream server: Unified loop break
2026-04-29T08:45:06.260540Z  WARN jd_client_sv2::job_declarator: JobDeclarator: unified message loop exited.
2026-04-29T08:45:06.260715Z  INFO stratum_apps::monitoring::http_server: Monitoring server stopped
2026-04-29T08:45:06.260727Z  INFO jd_client_sv2: Monitoring server task exited and signaled fallback coordinator
2026-04-29T08:45:06.260733Z  INFO jd_client_sv2: All components finished fallback cleanup
2026-04-29T08:45:06.260740Z  INFO jd_client_sv2: Existing Upstream or JD instance taken out. Preparing fallback.
2026-04-29T08:45:06.260834Z  INFO jd_client_sv2: Attempting to initialize Jd and upstream...
2026-04-29T08:45:06.260845Z  INFO jd_client_sv2: Trying upstream 1 of 1: pool=0.0.0.0:3333, jds=0.0.0.0:3334
2026-04-29T08:45:06.260877Z  INFO bitcoin_core_sv2::template_distribution_protocol::monitors: Received: CoinbaseOutputConstraints: CoinbaseOutputConstraints(coinbase_output_max_additional_size: 31, coinbase_output_max_additional_sigops: 0)
2026-04-29T08:45:06.262126Z  INFO jd_client_sv2::channel_manager: Starting vardiff loop for downstreams
2026-04-29T08:45:06.262156Z  INFO jd_client_sv2::channel_manager: Vardiff update cycle complete
2026-04-29T08:45:06.262312Z  WARN bitcoin_core_sv2::template_distribution_protocol::monitors: Exiting mempool change monitoring loop
2026-04-29T08:45:07.262565Z  INFO jd_client_sv2: Upstream previously marked as malicious, skipping initial attempt warnings.
2026-04-29T08:45:07.262605Z ERROR jd_client_sv2: All upstreams failed after 3 retries each
2026-04-29T08:45:07.262620Z ERROR jd_client_sv2: Failed to initialize upstream: CouldNotInitiateSystem
2026-04-29T08:45:07.262629Z  INFO jd_client_sv2: Fallback to solo mining mode
2026-04-29T08:45:07.262634Z  INFO jd_client_sv2: Reinitializing monitoring server on http://0.0.0.0:9091
2026-04-29T08:45:07.262785Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:07.262792Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-29T08:45:07.262934Z  INFO stratum_apps::monitoring::http_server: Starting monitoring server on http://0.0.0.0:9091
2026-04-29T08:45:07.262963Z  INFO stratum_apps::monitoring::http_server: Cache refresh interval: 15s
2026-04-29T08:45:07.264919Z  INFO stratum_apps::monitoring::http_server: Swagger UI available at http://0.0.0.0:9091/swagger-ui
2026-04-29T08:45:07.264939Z  INFO stratum_apps::monitoring::http_server: Prometheus metrics available at http://0.0.0.0:9091/metrics
2026-04-29T08:45:08.264599Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:08.264641Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-29T08:45:09.266627Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:09.266671Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-29T08:45:09.431726Z  INFO bitcoin_core_sv2::template_distribution_protocol::monitors: 💹 Mempool fees increased! Sending NewTemplate message.
2026-04-29T08:45:09.432019Z  INFO jd_client_sv2::channel_manager::template_message_handler: Received: NewTemplate(template_id: 1, future_template: false, version: 0x20000000, coinbase_tx_version: 0x00000002, coinbase_prefix: B0255(03b5730e), coinbase_tx_input_sequence: 0xfffffffe, coinbase_tx_value_remaining: 315261839, coinbase_tx_outputs_count: 1, coinbase_tx_outputs: B064K(0000000000000000266a24aa21a9edf91554cfbef4df506c67ee2f7289ac5c9e1b8640388503fd92db470c6003a5da), coinbase_tx_locktime: 947124, merkle_path: Seq0255<len=12: [a904f5e35aef56e965c9f92b12f32b607a4416bbd1cd890e260877c24a6b9306, 093a951550b4dcab29a6a09310e82f75c0c0cc8ff2417d864a3096e0ea5ab842, ... , db5ad623b55a538156f953183d188f794b9b20e804f877d4f69c1c5cdcf0b037, e8a8c203803e14000c4bdac4e2b429924db47ad270126795926c292f0049fb06])
2026-04-29T08:45:10.269500Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:10.269559Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-29T08:45:11.271619Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:11.271658Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-29T08:45:12.273175Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:12.273217Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-29T08:45:13.273888Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:13.273949Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
^C^X2026-04-29T08:45:14.274760Z  WARN jd_client_sv2::channel_manager: Waiting for initial template and prevhash from Template Provider...
2026-04-29T08:45:14.274805Z  WARN jd_client_sv2::channel_manager: Is the Bitcoin node undergoing IBD?
2026-04-29T08:45:14.433490Z  INFO bitcoin_core_sv2::template_distribution_protocol::monitors: 💹 Mempool fees increased! Sending NewTemplate message.
2026-04-29T08:45:14.433717Z  INFO jd_client_sv2::channel_manager::template_message_handler: Received: NewTemplate(template_id: 2, future_template: false, version: 0x20000000, coinbase_tx_version: 0x00000002, coinbase_prefix: B0255(03b5730e), coinbase_tx_input_sequence: 0xfffffffe, coinbase_tx_value_remaining: 315263961, coinbase_tx_outputs_count: 1, coinbase_tx_outputs: B064K(0000000000000000266a24aa21a9ede9fc0ffb0126a921e283e27c531b5da4712c9c5231284a2e64978d8dc1b3deda), coinbase_tx_locktime: 947124, merkle_path: Seq0255<len=12: [a904f5e35aef56e965c9f92b12f32b607a4416bbd1cd890e260877c24a6b9306, 093a951550b4dcab29a6a09310e82f75c0c0cc8ff2417d864a3096e0ea5ab842, ... , a6e8a680993730f2a9961e87c20ff2db32ed525aff6e5d00219164f160a27165, 9b261b973d860449f6716176a47703b7bb9a123f493ae87a1b5c7ce964a36927])
^Z

This is happening on main, looking into it. Not related to this PR.

@GitGab19
Copy link
Copy Markdown
Member

I'll approve this PR though in the meantime.

@Shourya742
Copy link
Copy Markdown
Member

Opened an issue for the above JDC behavior: #466. It appears that JDC does not receive new template and prevhash after submitting a new CoinbaseConstraint to bitcoin-core-sv2.

Copy link
Copy Markdown
Member

@Shourya742 Shourya742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Some questions

Comment thread bitcoin-core-sv2/Cargo.toml Outdated
plebhash added 11 commits May 1, 2026 16:53
we need global_cancellation_token to be able to interrupt IPC createNewBlock

otherwise, long IBDs can make it hang indefinitely
no need to call it when DifficultyLevel::{Mid,High}

also the .expect was written under wrong assumptions about the underlying generate_to_address return type
Bitcoin Core v31 IPC createNewBlock waits while the node is in IBD, which
prevents bitcoin_core_sv2 from sending templates for stale static signet
fixtures.

Pass a large -maxtipage for mid/high difficulty signet fixtures so they can
leave IBD without freezing Bitcoin Core's clock with -mocktime. This keeps
template startup reliable while preserving wall-clock timestamps for newly
mined blocks.

ref bitcoin/bitcoin#33994
pool_does_not_hang_on_no_handshake was connecting to the pool immediately
after start_pool returned, but the pool only binds its downstream listener
after receiving initial template data.

now we retry ConnectionRefused briefly before creating the intentionally incomplete
downstream connection, so the test covers the Noise handshake timeout behavior
instead of racing pool startup.
@plebhash plebhash force-pushed the 2026-04-17-bitcoin-core-v31 branch from ad23dc4 to 2ae72c1 Compare May 1, 2026 19:59
@GitGab19 GitGab19 merged commit d48765f into stratum-mining:main May 4, 2026
11 checks passed
@plebhash plebhash deleted the 2026-04-17-bitcoin-core-v31 branch May 4, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

need to adapt bitcoin_core_sv2 to v31

5 participants