adapt bitcoin_core_sv2 to Bitcoin Core v31#439
adapt bitcoin_core_sv2 to Bitcoin Core v31#439GitGab19 merged 11 commits intostratum-mining:mainfrom
bitcoin_core_sv2 to Bitcoin Core v31#439Conversation
f5b2575 to
194238d
Compare
194238d to
32d26c7
Compare
32d26c7 to
d4e7a97
Compare
ccd0b3c to
d52c95e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
Testing this branch with bitcoin core v31.0.0rc4 running |
|
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 |
GitGab19
left a comment
There was a problem hiding this comment.
I haven't tested this yet.
I left a couple of questions in the meantime, but overall it looks good to me!
dc85938 to
b78d204
Compare
|
If I run the Pool + JDS while Bitcoin Core is doing IBD, I don't see any warning, instead here is what I see: |
|
When running the Pool WITHOUT JDS, I get the following logs instead, which are correctly showing the warnings: |
|
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.
In this latest crash the apps were running at commit b78d204 Running [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
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:0my 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 |
should be fixed via 1e97f2f |
|
@lucasbalieiro looking at the provided logs.zip it seems Pool+JDS is on signet, while JDC is on mainnet?
|
Oh 🤦♂️, sorry. Yes, my Pool/JDS were on signet. I adjusted the setup so now everything is in mainnet. |
1e97f2f to
ad23dc4
Compare
in which process specifically? |
|
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:
At this point JDC does fallback to solo mining, but it keeps printing the warning logs, and cannot be killed with Here the JDC logs I'm referring to: |
This is happening on main, looking into it. Not related to this PR. |
|
I'll approve this PR though in the meantime. |
|
Opened an issue for the above JDC behavior: #466. It appears that JDC does not receive new template and |
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.
ad23dc4 to
2ae72c1
Compare
close #318
version bumps:
bitcoin_core_sv2: v0.1.1 -> v0.2.0pool_sv2: v0.2.2 -> v0.3.0jd_server_sv2: v0.1.2 -> v0.2.0jd_client_sv2: v0.1.4 -> v0.2.0integration_tests_sv2: v0.1.1 -> v0.2.0a new
Version Compatibilitytable is also added tobitcoin_core_sv2'sREAMDE.mdlisting allbitcoin_core_sv2vsBitcoin Coreversions