Skip to content

poc - JD port config - #224

Closed
pavlenex wants to merge 2 commits into
stratum-mining:mainfrom
pavlenex:jd-config
Closed

poc - JD port config#224
pavlenex wants to merge 2 commits into
stratum-mining:mainfrom
pavlenex:jd-config

Conversation

@pavlenex

Copy link
Copy Markdown
Contributor

This PR is proof of concept, it doesn't yet work for me so I hope at least UI or something can be useful.

Screenshot 2026-07-21 at 12 54 22
2026-07-21T07:52:22.102358583Z [jdc] [stdout] 2026-07-21T07:52:22.102305Z  INFO jd_client_sv2: Job declarator client starting... setting up subsystems
2026-07-21T07:52:22.102553541Z [jdc] [stdout] 2026-07-21T07:52:22.102358Z  INFO jd_client_sv2: Initializing monitoring server on http://0.0.0.0:9091
2026-07-21T07:52:22.102557416Z [jdc] [stdout] 2026-07-21T07:52:22.102410Z  INFO jd_client_sv2: Using Bitcoin Core IPC socket at: /root/.bitcoin/node.sock
2026-07-21T07:52:22.102558416Z [jdc] [stdout] 2026-07-21T07:52:22.102420Z  INFO stratum_apps::monitoring::http_server: Starting monitoring server on http://0.0.0.0:9091
2026-07-21T07:52:22.102559166Z [jdc] [stdout] 2026-07-21T07:52:22.102424Z  INFO stratum_apps::monitoring::http_server: Cache refresh interval: 15s
2026-07-21T07:52:22.102559791Z [jdc] [stdout] 2026-07-21T07:52:22.102437Z  INFO jd_client_sv2::monitoring: Starting JDC miner telemetry loop with interval of 15 seconds
2026-07-21T07:52:22.102700875Z [jdc] [stdout] 2026-07-21T07:52:22.102637Z  INFO jd_client_sv2: Attempting to initialize upstream...
2026-07-21T07:52:22.102704666Z [jdc] [stdout] 2026-07-21T07:52:22.102643Z  INFO jd_client_sv2: Trying upstream 1 of 1: pool=sv2solo.ckpool.org:3336, jds=sv2solo.ckpool.org:3337
2026-07-21T07:52:22.103138041Z [jdc] [stdout] 2026-07-21T07:52:22.103037Z  INFO stratum_apps::monitoring::http_server: Swagger UI available at http://0.0.0.0:9091/swagger-ui
2026-07-21T07:52:22.103144666Z [jdc] [stdout] 2026-07-21T07:52:22.103055Z  INFO stratum_apps::monitoring::http_server: Prometheus metrics available at http://0.0.0.0:9091/metrics
2026-07-21T07:52:22.103496041Z [jdc] [stdout] 2026-07-21T07:52:22.103351Z  INFO bitcoin_core_sv2::unix_capnp::v31x::template_distribution_protocol: Creating new BitcoinCoreSv2TDP via IPC over UNIX socket: /root/.bitcoin/node.sock
2026-07-21T07:52:22.103736916Z [jdc] [stdout] 2026-07-21T07:52:22.103646Z  INFO jd_client_sv2::channel_manager: Starting vardiff loop for downstreams
2026-07-21T07:52:22.103741250Z [jdc] [stdout] 2026-07-21T07:52:22.103658Z  INFO jd_client_sv2::channel_manager: Vardiff update cycle complete
2026-07-21T07:52:22.104390208Z [jdc] [stdout] 2026-07-21T07:52:22.104346Z  INFO bitcoin_core_sv2::unix_capnp::v31x::template_distribution_protocol: IPC execution thread client successfully created.
2026-07-21T07:52:22.104830833Z [jdc] [stdout] 2026-07-21T07:52:22.104745Z  INFO bitcoin_core_sv2::unix_capnp::v31x::template_distribution_protocol: IPC mining client successfully created.
2026-07-21T07:52:22.104834083Z [jdc] [stdout] 2026-07-21T07:52:22.104757Z  INFO bitcoin_core_sv2::unix_capnp::v31x::template_distribution_protocol: Waiting for first CoinbaseOutputConstraints message
2026-07-21T07:52:22.104835208Z [jdc] [stdout] 2026-07-21T07:52:22.104760Z  INFO bitcoin_core_sv2::unix_capnp::v31x::template_distribution_protocol: Received: CoinbaseOutputConstraints { coinbase_output_max_additional_size: 31, coinbase_output_max_additional_sigops: 0 }
2026-07-21T07:52:22.126516458Z [jdc] [stdout] 2026-07-21T07:52:22.126416Z  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(0306a20e), coinbase_tx_input_sequence: 0xfffffffe, coinbase_tx_value_remaining: 316575294, coinbase_tx_outputs_count: 1, coinbase_tx_outputs: B064K(0000000000000000266a24aa21a9ed8159bf2ae7442c77170719c81ed8f9cb74195120306b2b9378dfadbbc03b4f96), coinbase_tx_locktime: 958981, merkle_path: Seq0255<len=12: [2568970980fab16945f07d3200651acb551d1c1cf2693190252eb2e75ab67bd1, 203d66cb48f5a89d8d515f8c6bc6f2cde1e5eb74c3a1953188cc72795cf75d2f, ... , e6a60bf11a01b0097f36986564dc6d612e10fe2e795a1f9ff724abff1883a154, 4ff5634b02a48cec97cda4515bc9b49ea9ce3b4a056c5752f202d9364e580c10])
2026-07-21T07:52:22.126537791Z [jdc] [stdout] 2026-07-21T07:52:22.126461Z  INFO jd_client_sv2::channel_manager::template_message_handler: Received: SetNewPrevHash { template_id: 0, prev_hash: U256(000000000000000000017a06ab77841a7caa8f201b1aa85fe467c9931d3a29fa), header_timestamp: 1784620342, n_bits: 0x1702369d, target: U256(00000000000000000002369d0000000000000000000000000000000000000000) }
2026-07-21T07:52:23.105265458Z [jdc] [stdout] 2026-07-21T07:52:23.104888Z  INFO jd_client_sv2: Connection attempt 1/3...
2026-07-21T07:52:23.105297708Z [jdc] [stdout] 2026-07-21T07:52:23.104926Z  INFO jd_client_sv2: Upstream connection in-progress at initialize single
2026-07-21T07:52:23.105301583Z [jdc] [stdout] 2026-07-21T07:52:23.104932Z  INFO stratum_apps::network_helpers::resolve_hostname: Resolving hostname 'sv2solo.ckpool.org' via DNS...
2026-07-21T07:52:23.271152042Z [jdc] [stdout] 2026-07-21T07:52:23.270804Z  INFO jd_client_sv2::upstream: Connected to upstream at 51.81.56.15:3336
2026-07-21T07:52:23.434380709Z [jdc] [stdout] 2026-07-21T07:52:23.434196Z  INFO jd_client_sv2: Upstream connection done at initialize single
2026-07-21T07:52:23.434420625Z [jdc] [stdout] 2026-07-21T07:52:23.434227Z  INFO stratum_apps::network_helpers::resolve_hostname: Resolving hostname 'sv2solo.ckpool.org' via DNS...
2026-07-21T07:52:23.439015000Z [jdc] [stdout] 2026-07-21T07:52:23.438654Z  INFO jd_client_sv2::job_declarator: Connecting to JD Server at 51.81.56.15:3337
2026-07-21T07:52:23.600242500Z [jdc] [stdout] 2026-07-21T07:52:23.599873Z  INFO jd_client_sv2::job_declarator: Connection established with JD Server at 51.81.56.15:3337 in mode: JDMode { inner: 2, config_mode: FullTemplate }
2026-07-21T07:52:23.762119334Z [jdc] [stdout] 2026-07-21T07:52:23.761793Z  INFO jd_client_sv2::upstream: Upstream: initiating SV2 handshake...
2026-07-21T07:52:23.762179459Z [jdc] [stdout] 2026-07-21T07:52:23.761858Z  INFO jd_client_sv2::upstream: Sent `SetupConnection` to upstream, awaiting response...
2026-07-21T07:52:23.955188917Z [jdc] [stdout] 2026-07-21T07:52:23.954862Z  INFO jd_client_sv2::upstream: Dispatching inbound handshake message ext_type=0 msg_type=1
2026-07-21T07:52:23.955257375Z [jdc] [stdout] 2026-07-21T07:52:23.954929Z  INFO jd_client_sv2::upstream::message_handler: Received: SetupConnectionSuccess(used_version: 2, flags: 0x00000000)
2026-07-21T07:52:23.955263500Z [jdc] [stdout] 2026-07-21T07:52:23.955008Z  INFO jd_client_sv2::job_declarator: Sending SetupConnection to JDS at 51.81.56.15:3337
2026-07-21T07:52:24.129426459Z [jdc] [stdout] 2026-07-21T07:52:24.128908Z  INFO jd_client_sv2::job_declarator::message_handler: Received: SetupConnectionSuccess(used_version: 2, flags: 0x00000000)
2026-07-21T07:52:24.129660876Z [jdc] [stdout] 2026-07-21T07:52:24.128962Z  INFO jd_client_sv2::job_declarator: Job declarator: SV2 handshake completed successfully.
2026-07-21T07:52:24.129672042Z [jdc] [stdout] 2026-07-21T07:52:24.129028Z  INFO jd_client_sv2::channel_manager: Requested allocation of 2 mining job tokens to JDS
2026-07-21T07:52:24.129674667Z [jdc] [stdout] 2026-07-21T07:52:24.129071Z  INFO jd_client_sv2: Spawning status listener task...
2026-07-21T07:52:24.130001584Z [jdc] [stdout] 2026-07-21T07:52:24.129220Z  INFO jd_client_sv2::channel_manager: Required template data received, ready to accept connections
2026-07-21T07:52:24.130044251Z [jdc] [stdout] 2026-07-21T07:52:24.129260Z  INFO jd_client_sv2::channel_manager: Starting downstream server at 0.0.0.0:34265
2026-07-21T07:52:25.211475959Z [translator] [stdout] 2026-07-21T07:52:25.211415Z  INFO translator_sv2: Starting Translator Proxy...
2026-07-21T07:52:25.211486084Z [translator] [stdout] 2026-07-21T07:52:25.211451Z  INFO translator_sv2: Initializing upstream connection...
2026-07-21T07:52:25.211487501Z [translator] [stdout] 2026-07-21T07:52:25.211463Z  INFO translator_sv2: Trying upstream 1 of 1: sv2-jdc:34265
2026-07-21T07:52:25.211488334Z [translator] [stdout] 2026-07-21T07:52:25.211464Z  INFO translator_sv2: Connection attempt 1/3...
2026-07-21T07:52:26.215849501Z [translator] [stdout] 2026-07-21T07:52:26.214366Z  INFO translator_sv2::sv2::upstream: Trying to connect to upstream at sv2-jdc:34265
2026-07-21T07:52:26.215871418Z [translator] [stdout] 2026-07-21T07:52:26.214417Z  INFO stratum_apps::network_helpers::resolve_hostname: Resolving hostname 'sv2-jdc' via DNS...
2026-07-21T07:52:26.217967085Z [jdc] [stdout] 2026-07-21T07:52:26.217160Z  INFO jd_client_sv2::channel_manager: New downstream connection socket_address=172.19.0.3:57596
2026-07-21T07:52:26.217971418Z [translator] [stdout] 2026-07-21T07:52:26.217044Z  INFO translator_sv2::sv2::upstream: Connected to upstream at 172.19.0.2:34265
2026-07-21T07:52:26.219112793Z [jdc] [stdout] 2026-07-21T07:52:26.218932Z  INFO jd_client_sv2::downstream::common_message_handler: Received: SetupConnection(protocol: 0, min_version: 2, max_version: 2, flags: 0x00000004, endpoint_host: 172.19.0.2, endpoint_port: 34265, vendor: SRI, hardware_version: Translator Proxy, firmware: , device_id: )
2026-07-21T07:52:26.219308043Z [translator] [stdout] 2026-07-21T07:52:26.219158Z  INFO translator_sv2::sv2::upstream::common_message_handler: Received: SetupConnectionSuccess(used_version: 2, flags: 0x00000000)
2026-07-21T07:52:26.219318585Z [translator] [stdout] 2026-07-21T07:52:26.219217Z  INFO translator_sv2::sv1::sv1_server: Starting SV1 server on 0.0.0.0:34255
2026-07-21T07:52:26.219385335Z [translator] [stdout] 2026-07-21T07:52:26.219316Z  INFO translator_sv2::sv1::sv1_server: Translator Proxy: listening on 0.0.0.0:34255
2026-07-21T07:52:26.219388877Z [translator] [stdout] 2026-07-21T07:52:26.219346Z  INFO translator_sv2: Launching ChannelManager tasks...
2026-07-21T07:52:26.219498752Z [translator] [stdout] 2026-07-21T07:52:26.219355Z  INFO translator_sv2: Initializing monitoring server on http://0.0.0.0:9092
2026-07-21T07:52:26.219502210Z [translator] [stdout] 2026-07-21T07:52:26.219402Z  INFO translator_sv2::sv1::sv1_server::difficulty_manager: Variable difficulty adjustment enabled - starting vardiff loop
2026-07-21T07:52:26.219503752Z [translator] [stdout] 2026-07-21T07:52:26.219414Z  INFO translator_sv2::sv1::sv1_server: Starting job keepalive loop with interval of 60 seconds
2026-07-21T07:52:26.219587918Z [translator] [stdout] 2026-07-21T07:52:26.219522Z  INFO stratum_apps::monitoring::http_server: Starting monitoring server on http://0.0.0.0:9092
2026-07-21T07:52:26.219591793Z [translator] [stdout] 2026-07-21T07:52:26.219534Z  INFO stratum_apps::monitoring::http_server: Cache refresh interval: 15s
2026-07-21T07:52:26.219593335Z [translator] [stdout] 2026-07-21T07:52:26.219543Z  INFO translator_sv2::sv1::monitoring: Starting SV1 miner telemetry loop with interval of 15 seconds
2026-07-21T07:52:26.220837418Z [translator] [stdout] 2026-07-21T07:52:26.220610Z  INFO stratum_apps::monitoring::http_server: Swagger UI available at http://0.0.0.0:9092/swagger-ui
2026-07-21T07:52:26.220858960Z [translator] [stdout] 2026-07-21T07:52:26.220635Z  INFO stratum_apps::monitoring::http_server: Prometheus metrics available at http://0.0.0.0:9092/metrics
2026-07-21T07:52:26.220978793Z [translator] [stdout] 2026-07-21T07:52:26.220917Z  INFO translator_sv2::sv1::sv1_server::difficulty_manager: Starting vardiff loop for downstreams
2026-07-21T07:52:30.391978545Z [translator] [stdout] 2026-07-21T07:52:30.391794Z  INFO translator_sv2::sv1::sv1_server: New SV1 downstream connection from 172.19.0.1:58186
2026-07-21T07:52:30.392496878Z [jdc] [stdout] 2026-07-21T07:52:30.392328Z  INFO jd_client_sv2::channel_manager::jd_message_handler: Received: AllocateMiningJobTokenSuccess(request_id: 0, mining_job_token: B0255(6e23c6ba830d78926ed3fc937b55a4f3), coinbase_outputs: B064K(010000000000000000160014cf47692d47655595ff0f42d12f1e05476f3ff0d0))
2026-07-21T07:52:30.392108128Z [translator] [stdout] 2026-07-21T07:52:30.391832Z  INFO translator_sv2::sv1::sv1_server: Downstream 1 registered successfully (channel will be opened after first message)
2026-07-21T07:52:30.392113087Z [translator] [stdout] 2026-07-21T07:52:30.391924Z  INFO translator_sv2::sv1::sv1_server: SV1 server: opening extended mining channel for downstream 1 after first message
2026-07-21T07:52:30.392155920Z [translator] [stdout] 2026-07-21T07:52:30.391959Z  INFO translator_sv2::sv2::channel_manager: Sending OpenExtendedMiningChannel message to upstream: OpenExtendedMiningChannel(request_id: 1, user_identity: bc1qearkjt28v42etlc0gtgj78s9gahnluxsne06gs.miner1, nominal_hash_rate: 300000000000000, max_target: U256(0000000000001804ea1c6b17c6b54c2455da7ed349255caaa38da73794ab29b5), min_extranonce_size: 8)
2026-07-21T07:52:30.393218837Z [jdc] [stdout] 2026-07-21T07:52:30.392369Z  INFO jd_client_sv2::channel_manager::jd_message_handler: Received: AllocateMiningJobTokenSuccess(request_id: 1, mining_job_token: B0255(ea6e2d0aee8adf1f8f145d31af61ac40), coinbase_outputs: B064K(010000000000000000160014cf47692d47655595ff0f42d12f1e05476f3ff0d0))
2026-07-21T07:52:30.556681754Z [jdc] [stdout] 2026-07-21T07:52:30.555364Z  WARN jd_client_sv2::channel_manager::upstream_message_handler: Received: OpenMiningChannelError(request_id: 1, error_code: unsupported-min-extranonce-size)
2026-07-21T07:52:30.556747962Z [jdc] [stdout] 2026-07-21T07:52:30.555431Z  WARN jd_client_sv2::channel_manager::upstream_message_handler: ⚠️ Cannot open extended channel with the upstream server, preparing fallback.
2026-07-21T07:52:30.556752754Z [jdc] [stdout] 2026-07-21T07:52:30.555444Z ERROR jd_client_sv2::channel_manager: Error handling Pool message error=JDCError { kind: OpenMiningChannelError, action: Fallback, _owner: PhantomData<jd_client_sv2::error::ChannelManager> }
2026-07-21T07:52:30.556756545Z [jdc] [stdout] 2026-07-21T07:52:30.555458Z  WARN jd_client_sv2::channel_manager: ChannelManager::handle_pool_message_frame requested fallback error_kind=OpenMiningChannelError
2026-07-21T07:52:30.556759045Z [jdc] [stdout] 2026-07-21T07:52:30.555674Z  INFO jd_client_sv2::upstream: Upstream: fallback triggered
2026-07-21T07:52:30.556761254Z [jdc] [stdout] 2026-07-21T07:52:30.555673Z  WARN jd_client_sv2: Upstream/Job Declarator connection dropped — attempting reconnection...
2026-07-21T07:52:30.556763587Z [jdc] [stdout] 2026-07-21T07:52:30.555692Z  WARN jd_client_sv2::upstream: Upstream: unified message loop exited.
2026-07-21T07:52:30.556765795Z [jdc] [stdout] 2026-07-21T07:52:30.555705Z  INFO jd_client_sv2: Monitoring server: fallback triggered.
2026-07-21T07:52:30.556767920Z [jdc] [stdout] 2026-07-21T07:52:30.555710Z  INFO stratum_apps::monitoring::http_server: Monitoring server received shutdown signal, stopping...
2026-07-21T07:52:30.556770879Z [jdc] [stdout] 2026-07-21T07:52:30.555909Z  INFO jd_client_sv2::channel_manager: Downstream Server: received fallback signal
2026-07-21T07:52:30.556773087Z [jdc] [stdout] 2026-07-21T07:52:30.555924Z  INFO jd_client_sv2::channel_manager: Downstream server: Unified loop break
2026-07-21T07:52:30.556775295Z [jdc] [stdout] 2026-07-21T07:52:30.555971Z  INFO jd_client_sv2::monitoring: JDC miner telemetry loop received fallback signal
2026-07-21T07:52:30.556777670Z [jdc] [stdout] 2026-07-21T07:52:30.555981Z  INFO jd_client_sv2: JDC miner telemetry task exited and signaled fallback coordinator
2026-07-21T07:52:30.556780212Z [jdc] [stdout] 2026-07-21T07:52:30.556000Z  WARN jd_client_sv2::io_task: Writer task exited.
2026-07-21T07:52:30.556801795Z [jdc] [stdout] 2026-07-21T07:52:30.556135Z  INFO stratum_apps::monitoring::http_server: Monitoring server stopped
2026-07-21T07:52:30.556803879Z [jdc] [stdout] 2026-07-21T07:52:30.556163Z  INFO jd_client_sv2: Monitoring server task exited and signaled fallback coordinator
2026-07-21T07:52:30.556807379Z [jdc] [stdout] 2026-07-21T07:52:30.556212Z  WARN jd_client_sv2::io_task: Writer task exited.
2026-07-21T07:52:30.556809087Z [jdc] [stdout] 2026-07-21T07:52:30.556260Z  WARN jd_client_sv2::io_task: Reader task exited.
2026-07-21T07:52:30.556810712Z [jdc] [stdout] 2026-07-21T07:52:30.556311Z  INFO jd_client_sv2::job_declarator: Job Declarator: fallback triggered
2026-07-21T07:52:30.556812920Z [jdc] [stdout] 2026-07-21T07:52:30.556319Z  WARN jd_client_sv2::job_declarator: JobDeclarator: unified message loop exited.
2026-07-21T07:52:30.556815004Z [jdc] [stdout] 2026-07-21T07:52:30.556338Z  WARN jd_client_sv2::downstream: Downstream: unified message loop exited.
2026-07-21T07:52:30.556816670Z [jdc] [stdout] 2026-07-21T07:52:30.556348Z  WARN jd_client_sv2::io_task: Reader task exited.
2026-07-21T07:52:30.556818379Z [jdc] [stdout] 2026-07-21T07:52:30.556365Z  WARN jd_client_sv2::io_task: Writer task exited.
2026-07-21T07:52:30.556820045Z [jdc] [stdout] 2026-07-21T07:52:30.556388Z  WARN jd_client_sv2::io_task: Reader task exited.
2026-07-21T07:52:30.557667295Z [jdc] [stdout] 2026-07-21T07:52:30.556685Z  INFO jd_client_sv2: All components finished fallback cleanup
2026-07-21T07:52:30.557673754Z [jdc] [stdout] 2026-07-21T07:52:30.556703Z  INFO jd_client_sv2: Existing Upstream or JD instance taken out. Preparing fallback.
2026-07-21T07:52:30.557675712Z [jdc] [stdout] 2026-07-21T07:52:30.556922Z  INFO jd_client_sv2: Attempting to initialize Jd and upstream...
2026-07-21T07:52:30.557677379Z [jdc] [stdout] 2026-07-21T07:52:30.556927Z  INFO jd_client_sv2: Trying upstream 1 of 1: pool=sv2solo.ckpool.org:3336, jds=sv2solo.ckpool.org:3337
2026-07-21T07:52:30.557679754Z [jdc] [stdout] 2026-07-21T07:52:30.556993Z  INFO bitcoin_core_sv2::unix_capnp::v31x::template_distribution_protocol::monitors: Received: CoinbaseOutputConstraints: CoinbaseOutputConstraints(coinbase_output_max_additional_size: 31, coinbase_output_max_additional_sigops: 0)
2026-07-21T07:52:30.557601129Z [translator] [stdout] 2026-07-21T07:52:30.556911Z ERROR translator_sv2::io_task: Reader error error=SocketClosed
2026-07-21T07:52:30.557639129Z [translator] [stdout] 2026-07-21T07:52:30.556976Z  WARN translator_sv2::io_task: Reader task exited.
2026-07-21T07:52:30.557642504Z [translator] [stdout] 2026-07-21T07:52:30.557081Z  WARN translator_sv2::io_task: Outbound channel closed
2026-07-21T07:52:30.557644462Z [translator] [stdout] 2026-07-21T07:52:30.557085Z  WARN translator_sv2::io_task: Writer task exited.
2026-07-21T07:52:30.557646212Z [translator] [stdout] 2026-07-21T07:52:30.557232Z  WARN translator_sv2::sv2::upstream: Upstream::handle_upstream_message requested fallback error_kind=ChannelErrorReceiver(RecvError)
2026-07-21T07:52:30.557648170Z [translator] [stdout] 2026-07-21T07:52:30.557253Z  WARN translator_sv2::sv2::upstream: Upstream: task shutting down cleanly.
2026-07-21T07:52:30.557649962Z [translator] [stdout] 2026-07-21T07:52:30.557268Z  INFO translator_sv2::sv2::channel_manager: ChannelManager: fallback triggered, resetting state
2026-07-21T07:52:30.557651754Z [translator] [stdout] 2026-07-21T07:52:30.557281Z  WARN translator_sv2::sv2::channel_manager: ChannelManager: unified message loop exited.
2026-07-21T07:52:30.557653504Z [translator] [stdout] 2026-07-21T07:52:30.557290Z  INFO translator_sv2: Monitoring server: fallback triggered.
2026-07-21T07:52:30.557655170Z [translator] [stdout] 2026-07-21T07:52:30.557294Z  INFO stratum_apps::monitoring::http_server: Monitoring server received shutdown signal, stopping...
2026-07-21T07:52:30.558355004Z [translator] [stdout] 2026-07-21T07:52:30.557456Z  INFO translator_sv2::sv1::downstream: Downstream 1: fallback triggered
2026-07-21T07:52:30.558379879Z [translator] [stdout] 2026-07-21T07:52:30.557472Z  WARN translator_sv2::sv1::downstream: Downstream 1: unified task shutting down
2026-07-21T07:52:30.558381754Z [translator] [stdout] 2026-07-21T07:52:30.557489Z  INFO translator_sv2::sv1::sv1_server: 🔌 Downstream: 1 disconnected and removed from sv1 server downstreams
2026-07-21T07:52:30.558383962Z [translator] [stdout] 2026-07-21T07:52:30.557558Z  INFO stratum_apps::monitoring::http_server: Monitoring server stopped
2026-07-21T07:52:30.558385254Z [translator] [stdout] 2026-07-21T07:52:30.557565Z  INFO translator_sv2: Monitoring server task exited and signaled fallback coordinator
2026-07-21T07:52:30.558386587Z [translator] [stdout] 2026-07-21T07:52:30.557593Z  INFO translator_sv2::sv1::sv1_server: SV1 Server: fallback triggered, clearing state
2026-07-21T07:52:30.558387837Z [translator] [stdout] 2026-07-21T07:52:30.557595Z  INFO translator_sv2::sv1::monitoring: SV1 miner telemetry loop received fallback signal
2026-07-21T07:52:30.558389129Z [translator] [stdout] 2026-07-21T07:52:30.557601Z  INFO translator_sv2: SV1 miner telemetry task exited and signaled fallback coordinator
2026-07-21T07:52:30.558390462Z [translator] [stdout] 2026-07-21T07:52:30.557683Z  INFO translator_sv2: Preparing fallback
2026-07-21T07:52:30.558391712Z [translator] [stdout] 2026-07-21T07:52:30.557689Z  INFO translator_sv2: All components finished fallback cleanup
2026-07-21T07:52:30.558407712Z [translator] [stdout] 2026-07-21T07:52:30.557805Z ERROR translator_sv2: All upstreams failed after 3 retries each
2026-07-21T07:52:30.558409295Z [translator] [stdout] 2026-07-21T07:52:30.557811Z ERROR translator_sv2: Couldn't perform fallback, shutting system down: CouldNotInitiateSystem
2026-07-21T07:52:30.558410712Z [translator] [stdout] 2026-07-21T07:52:30.557816Z  WARN translator_sv2: Graceful shutdown: waiting 5 seconds for tasks to finish
2026-07-21T07:52:30.558412004Z [translator] [stdout] 2026-07-21T07:52:30.557933Z  INFO translator_sv2: All tasks joined cleanly
2026-07-21T07:52:30.558413337Z [translator] [stdout] 2026-07-21T07:52:30.557937Z  INFO translator_sv2: TranslatorSv2 shutdown complete.
2026-07-21T07:52:30.558414587Z [translator] [stdout] 2026-07-21T07:52:30.557949Z  INFO translator_sv2: TranslatorSv2 dropped
2026-07-21T07:52:30.559178004Z [jdc] [stdout] 2026-07-21T07:52:30.558688Z  INFO jd_client_sv2::channel_manager: Starting vardiff loop for downstreams
2026-07-21T07:52:30.559228920Z [jdc] [stdout] 2026-07-21T07:52:30.558739Z  INFO jd_client_sv2::channel_manager: Vardiff update cycle complete
2026-07-21T07:52:30.560909295Z [jdc] [stdout] 2026-07-21T07:52:30.560181Z  WARN bitcoin_core_sv2::unix_capnp::v31x::template_distribution_protocol::monitors: Exiting mempool change monitoring loop
2026-07-21T07:52:30.588431587Z [jdc] [stdout] 2026-07-21T07:52:30.588323Z  INFO jd_client_sv2::channel_manager::template_message_handler: Received: NewTemplate(template_id: 1, future_template: true, version: 0x20000000, coinbase_tx_version: 0x00000002, coinbase_prefix: B0255(0306a20e), coinbase_tx_input_sequence: 0xfffffffe, coinbase_tx_value_remaining: 316575294, coinbase_tx_outputs_count: 1, coinbase_tx_outputs: B064K(0000000000000000266a24aa21a9ed8159bf2ae7442c77170719c81ed8f9cb74195120306b2b9378dfadbbc03b4f96), coinbase_tx_locktime: 958981, merkle_path: Seq0255<len=12: [2568970980fab16945f07d3200651acb551d1c1cf2693190252eb2e75ab67bd1, 203d66cb48f5a89d8d515f8c6bc6f2cde1e5eb74c3a1953188cc72795cf75d2f, ... , e6a60bf11a01b0097f36986564dc6d612e10fe2e795a1f9ff724abff1883a154, 4ff5634b02a48cec97cda4515bc9b49ea9ce3b4a056c5752f202d9364e580c10])
2026-07-21T07:52:30.588449754Z [jdc] [stdout] 2026-07-21T07:52:30.588375Z  INFO jd_client_sv2::channel_manager::template_message_handler: Received: SetNewPrevHash { template_id: 1, prev_hash: U256(000000000000000000017a06ab77841a7caa8f201b1aa85fe467c9931d3a29fa), header_timestamp: 1784620350, n_bits: 0x1702369d, target: U256(00000000000000000002369d0000000000000000000000000000000000000000) }
2026-07-21T07:52:31.561360296Z [jdc] [stdout] 2026-07-21T07:52:31.561076Z  INFO jd_client_sv2: Upstream previously marked as malicious, skipping initial attempt warnings.
2026-07-21T07:52:31.561392129Z [jdc] [stdout] 2026-07-21T07:52:31.561115Z ERROR jd_client_sv2: All upstreams failed after 3 retries each
2026-07-21T07:52:31.561395004Z [jdc] [stdout] 2026-07-21T07:52:31.561122Z ERROR jd_client_sv2: Failed to initialize upstream: CouldNotInitiateSystem
2026-07-21T07:52:31.561396671Z [jdc] [stdout] 2026-07-21T07:52:31.561126Z  INFO jd_client_sv2: Fallback to solo mining mode
2026-07-21T07:52:31.561397921Z [jdc] [stdout] 2026-07-21T07:52:31.561128Z  INFO jd_client_sv2: Reinitializing monitoring server on http://0.0.0.0:9091
2026-07-21T07:52:31.561399171Z [jdc] [stdout] 2026-07-21T07:52:31.561304Z  INFO stratum_apps::monitoring::http_server: Starting monitoring server on http://0.0.0.0:9091
2026-07-21T07:52:31.561400421Z [jdc] [stdout] 2026-07-21T07:52:31.561316Z  INFO stratum_apps::monitoring::http_server: Cache refresh interval: 15s
2026-07-21T07:52:31.561492504Z [jdc] [stdout] 2026-07-21T07:52:31.561396Z  INFO jd_client_sv2::channel_manager: Required template data received, ready to accept connections
2026-07-21T07:52:31.561502421Z [jdc] [stdout] 2026-07-21T07:52:31.561410Z  INFO jd_client_sv2::channel_manager: Starting downstream server at 0.0.0.0:34265
2026-07-21T07:52:31.561505337Z [jdc] [stdout] 2026-07-21T07:52:31.561373Z  INFO jd_client_sv2::monitoring: Starting JDC miner telemetry loop with interval of 15 seconds
2026-07-21T07:52:31.562352546Z [jdc] [stdout] 2026-07-21T07:52:31.562251Z  INFO stratum_apps::monitoring::http_server: Swagger UI available at http://0.0.0.0:9091/swagger-ui
2026-07-21T07:52:31.562379962Z [jdc] [stdout] 2026-07-21T07:52:31.562269Z  INFO stratum_apps::monitoring::http_server: Prometheus metrics available at http://0.0.0.0:9091/metrics

@GitGab19

Copy link
Copy Markdown
Member

The issue you're facing seems not related to this PR at all, but it's about extranonce_size requested:

2026-07-21T07:52:30.556681754Z [jdc] [stdout] 2026-07-21T07:52:30.555364Z  WARN jd_client_sv2::channel_manager::upstream_message_handler: Received: OpenMiningChannelError(request_id: 1, error_code: unsupported-min-extranonce-size)
2026-07-21T07:52:30.556747962Z [jdc] [stdout] 2026-07-21T07:52:30.555431Z  WARN jd_client_sv2::channel_manager::upstream_message_handler: ⚠️ Cannot open extended channel with the upstream server, preparing fallback.

@pavlenex

Copy link
Copy Markdown
Contributor Author

@GitGab19 seems to be working but I have no idea how d530cbc would really need some sanity checks here and to ensure it's not just wrapped around this specific use-case.

@pavlenex

pavlenex commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

I think it's a garbage solution but can probably help us understand the issue better. The JDC adds a 2-byte routing prefix; for a pool limit of 4, enter 2.

"The original issue was a hidden JDC default.
The UI showed Extranonce2 as 4, but jdc.toml omitted:
reserved_downstream_rollable_extranonce_size
The JDC therefore defaulted the reservation to 8 and added its own two-byte routing prefix:
2 + max(8, 4) = 10
CK supports a minimum request of 4, so it rejected the hidden request of 10 with unsupported-min-extranonce-size.
We fixed it by generating:
downstream_extranonce2_size = 2
reserved_downstream_rollable_extranonce_size = 2
Now the JDC requests:
2 + max(2, 2) = 4
CK accepts that. The later miner socket disconnect is separate from the original CK/JDC configuration problem."

makes no sense to me

@pavlenex

Copy link
Copy Markdown
Contributor Author

I'm reporting here that running this PR allows me to mine on CKPool. I however don't understand all the changes done here as it seems there was a structural bug in how we do configs.

Comment thread server/src/config-generator.ts Outdated
Comment on lines +267 to +270
const downstreamExtranonce2Size = positiveInteger(
normalizedData.translator?.downstream_extranonce2_size,
DEFAULT_DOWNSTREAM_EXTRANONCE2_SIZE,
);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

just signaling the changes about the exatranonce. And the AI is adding this to the config file reserved_downstream_rollable_extranonce_size

@GitGab19

Copy link
Copy Markdown
Member

Closing in favor of #230

@GitGab19 GitGab19 closed this Jul 27, 2026
@pavlenex pavlenex reopened this Jul 28, 2026
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.

3 participants