From 3a0799f0b1d70afea9ba5deb164c53c3c3d46e6d Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Wed, 11 Nov 2026 23:21:30 +0530 Subject: [PATCH 1/3] refactor: drop the is_client_authorized impls handlers_sv2 removed the method from its mining client traits; the pool and JDC implementations only returned Ok(true). --- .../lib/channel_manager/downstream_message_handler.rs | 8 -------- .../src/lib/channel_manager/mining_message_handler.rs | 9 --------- 2 files changed, 17 deletions(-) diff --git a/miner-apps/jd-client/src/lib/channel_manager/downstream_message_handler.rs b/miner-apps/jd-client/src/lib/channel_manager/downstream_message_handler.rs index f1878b2bb..c5e1cfdb2 100644 --- a/miner-apps/jd-client/src/lib/channel_manager/downstream_message_handler.rs +++ b/miner-apps/jd-client/src/lib/channel_manager/downstream_message_handler.rs @@ -13,7 +13,6 @@ use stratum_apps::stratum_core::{ use stratum_apps::{ stratum_core::{ - binary_sv2::Str0255, bitcoin::{Target, hashes::sha256d}, channels_sv2::{ Vardiff, VardiffState, client, @@ -180,13 +179,6 @@ impl HandleMiningMessagesFromClientOwnedAsync for ChannelManager { fn is_work_selection_enabled_for_client(&self, _client_id: Option) -> bool { false } - fn is_client_authorized( - &self, - _client_id: Option, - _user_identity: &Str0255, - ) -> Result { - Ok(true) - } // Handles a `CloseChannel` message: // - Look up the downstream associated with the given `channel_id`. diff --git a/pool-apps/pool/src/lib/channel_manager/mining_message_handler.rs b/pool-apps/pool/src/lib/channel_manager/mining_message_handler.rs index 9886afa4c..2e3452eb0 100644 --- a/pool-apps/pool/src/lib/channel_manager/mining_message_handler.rs +++ b/pool-apps/pool/src/lib/channel_manager/mining_message_handler.rs @@ -11,7 +11,6 @@ use stratum_apps::stratum_core::{ }; use stratum_apps::stratum_core::{ - binary_sv2::Str0255, bitcoin::Target, channels_sv2::{ Vardiff, VardiffState, @@ -70,14 +69,6 @@ impl HandleMiningMessagesFromClientOwnedAsync for ChannelManager { true } - fn is_client_authorized( - &self, - _client_id: Option, - _user_identity: &Str0255, - ) -> Result { - Ok(true) - } - fn get_negotiated_extensions_with_client( &self, client_id: Option, From 422c1b35721718ed6748f4c44bbcb7934b0851c4 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Wed, 11 Nov 2026 23:21:39 +0530 Subject: [PATCH 2/3] refactor: drop the get_channel_type impls handlers_sv2 no longer gates mining messages on SupportedChannelTypes. The pool and JDC downstream side declared GroupAndExtended, which already accepted every message. JDC upstream and the translator now receive the few they used to have filtered out and handle them as before: they log and ignore them, or fall back. --- .../src/lib/channel_manager/downstream_message_handler.rs | 5 +---- .../src/lib/channel_manager/upstream_message_handler.rs | 4 ---- .../src/lib/sv2/channel_manager/mining_message_handler.rs | 6 +----- .../pool/src/lib/channel_manager/mining_message_handler.rs | 6 +----- 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/miner-apps/jd-client/src/lib/channel_manager/downstream_message_handler.rs b/miner-apps/jd-client/src/lib/channel_manager/downstream_message_handler.rs index c5e1cfdb2..d839942c1 100644 --- a/miner-apps/jd-client/src/lib/channel_manager/downstream_message_handler.rs +++ b/miner-apps/jd-client/src/lib/channel_manager/downstream_message_handler.rs @@ -27,7 +27,7 @@ use stratum_apps::{ extensions_sv2::{ EXTENSION_TYPE_WORKER_HASHRATE_TRACKING, TLV_FIELD_TYPE_USER_IDENTITY, UserIdentity, }, - handlers_sv2::{HandleMiningMessagesFromClientOwnedAsync, SupportedChannelTypes}, + handlers_sv2::HandleMiningMessagesFromClientOwnedAsync, mining_sv2::*, parsers_sv2::{ AnyMessageOwned, JobDeclarationOwned, MiningOwned, TemplateDistributionOwned, Tlv, @@ -173,9 +173,6 @@ impl HandleMiningMessagesFromClientOwnedAsync for ChannelManager { }) } - fn get_channel_type_for_client(&self, _client_id: Option) -> SupportedChannelTypes { - SupportedChannelTypes::GroupAndExtended - } fn is_work_selection_enabled_for_client(&self, _client_id: Option) -> bool { false } diff --git a/miner-apps/jd-client/src/lib/channel_manager/upstream_message_handler.rs b/miner-apps/jd-client/src/lib/channel_manager/upstream_message_handler.rs index ed2346b57..2648a3acd 100644 --- a/miner-apps/jd-client/src/lib/channel_manager/upstream_message_handler.rs +++ b/miner-apps/jd-client/src/lib/channel_manager/upstream_message_handler.rs @@ -17,7 +17,6 @@ use stratum_apps::{ }, handlers_sv2::{ HandleMiningMessagesFromClientOwnedAsync, HandleMiningMessagesFromServerOwnedAsync, - SupportedChannelTypes, }, mining_sv2::*, parsers_sv2::{AnyMessageOwned, MiningOwned, Tlv}, @@ -48,9 +47,6 @@ impl HandleMiningMessagesFromServerOwnedAsync for ChannelManager { .map_err(JDCError::shutdown) } - fn get_channel_type_for_server(&self, _server_id: Option) -> SupportedChannelTypes { - SupportedChannelTypes::Extended - } fn is_work_selection_enabled_for_server(&self, _server_id: Option) -> bool { true } diff --git a/miner-apps/translator/src/lib/sv2/channel_manager/mining_message_handler.rs b/miner-apps/translator/src/lib/sv2/channel_manager/mining_message_handler.rs index 8c6a7db09..0d1e75519 100644 --- a/miner-apps/translator/src/lib/sv2/channel_manager/mining_message_handler.rs +++ b/miner-apps/translator/src/lib/sv2/channel_manager/mining_message_handler.rs @@ -16,7 +16,7 @@ use stratum_apps::{ ExtranonceAllocator, ExtranoncePrefix, MAX_EXTRANONCE_LEN, bytes_needed, }, }, - handlers_sv2::{HandleMiningMessagesFromServerOwnedAsync, SupportedChannelTypes}, + handlers_sv2::HandleMiningMessagesFromServerOwnedAsync, mining_sv2::{ CloseChannelOwned, MESSAGE_TYPE_OPEN_STANDARD_MINING_CHANNEL_SUCCESS, MESSAGE_TYPE_SET_CUSTOM_MINING_JOB_ERROR, MESSAGE_TYPE_SET_CUSTOM_MINING_JOB_SUCCESS, @@ -36,10 +36,6 @@ use tracing::{error, info, warn}; impl HandleMiningMessagesFromServerOwnedAsync for ChannelManager { type Error = TproxyError; - fn get_channel_type_for_server(&self, _server_id: Option) -> SupportedChannelTypes { - SupportedChannelTypes::GroupAndExtended - } - fn is_work_selection_enabled_for_server(&self, _server_id: Option) -> bool { false } diff --git a/pool-apps/pool/src/lib/channel_manager/mining_message_handler.rs b/pool-apps/pool/src/lib/channel_manager/mining_message_handler.rs index 2e3452eb0..aef9c940e 100644 --- a/pool-apps/pool/src/lib/channel_manager/mining_message_handler.rs +++ b/pool-apps/pool/src/lib/channel_manager/mining_message_handler.rs @@ -25,7 +25,7 @@ use stratum_apps::stratum_core::{ extensions_sv2::{ EXTENSION_TYPE_WORKER_HASHRATE_TRACKING, TLV_FIELD_TYPE_USER_IDENTITY, UserIdentity, }, - handlers_sv2::{HandleMiningMessagesFromClientOwnedAsync, SupportedChannelTypes}, + handlers_sv2::HandleMiningMessagesFromClientOwnedAsync, mining_sv2::*, parsers_sv2::{Tlv, TlvField}, template_distribution_sv2::SubmitSolutionOwned, @@ -61,10 +61,6 @@ fn extranonce_allocation_error_code( impl HandleMiningMessagesFromClientOwnedAsync for ChannelManager { type Error = PoolError; - fn get_channel_type_for_client(&self, _client_id: Option) -> SupportedChannelTypes { - SupportedChannelTypes::GroupAndExtended - } - fn is_work_selection_enabled_for_client(&self, _client_id: Option) -> bool { true } From 3ee64ae3f4dad1c963ee943d517d28043d3588b6 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Thu, 12 Nov 2026 09:09:31 +0530 Subject: [PATCH 3/3] chore(deps): temporarily build stratum-core from the companion stratum branch Temporary: points stratum-core at bit-aloo/stratum 2026-11-11-handlers-sv2-fixes so CI builds against the companion stratum PR. Drop this commit and update stratum-core to stratum main once that PR lands. --- Cargo.lock | 43 ++++++++++++++++++------------------- bitcoin-core-sv2/Cargo.toml | 2 +- stratum-apps/Cargo.toml | 2 +- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ad00fc915..9b5c26c56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1023,7 +1023,7 @@ checksum = "32637268377fc7b10a8c6d51de3e7fba1ce5dd371a96e342b34e6078db558e7f" [[package]] name = "binary_sv2" version = "8.0.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" dependencies = [ "buffer_sv2", "derive_codec_sv2", @@ -1220,7 +1220,7 @@ dependencies = [ [[package]] name = "buffer_sv2" version = "4.0.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" [[package]] name = "bumpalo" @@ -1354,7 +1354,7 @@ dependencies = [ [[package]] name = "channels_sv2" version = "9.0.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" dependencies = [ "binary_sv2", "bitcoin", @@ -1473,7 +1473,7 @@ dependencies = [ [[package]] name = "codec_sv2" version = "8.1.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" dependencies = [ "binary_sv2", "buffer_sv2", @@ -1510,7 +1510,7 @@ dependencies = [ [[package]] name = "common_messages_sv2" version = "10.0.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" dependencies = [ "binary_sv2", ] @@ -1800,7 +1800,7 @@ dependencies = [ [[package]] name = "derive_codec_sv2" version = "2.0.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" [[package]] name = "digest" @@ -2006,7 +2006,7 @@ dependencies = [ [[package]] name = "extensions_sv2" version = "0.4.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" dependencies = [ "binary_sv2", ] @@ -2089,7 +2089,7 @@ dependencies = [ [[package]] name = "framing_sv2" version = "9.0.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" dependencies = [ "binary_sv2", "buffer_sv2", @@ -2300,10 +2300,9 @@ dependencies = [ [[package]] name = "handlers_sv2" -version = "0.7.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +version = "0.8.0" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" dependencies = [ - "binary_sv2", "common_messages_sv2", "extensions_sv2", "framing_sv2", @@ -2904,7 +2903,7 @@ dependencies = [ [[package]] name = "job_declaration_sv2" version = "11.0.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" dependencies = [ "binary_sv2", ] @@ -3154,8 +3153,8 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "mining_sv2" -version = "13.0.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +version = "13.0.1" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" dependencies = [ "binary_sv2", ] @@ -3220,7 +3219,7 @@ dependencies = [ [[package]] name = "noise_sv2" version = "2.1.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" dependencies = [ "chacha20poly1305", "rand 0.8.6", @@ -3381,8 +3380,8 @@ dependencies = [ [[package]] name = "parsers_sv2" -version = "0.7.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +version = "0.8.0" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" dependencies = [ "binary_sv2", "common_messages_sv2", @@ -4508,8 +4507,8 @@ dependencies = [ [[package]] name = "stratum-core" -version = "0.7.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +version = "0.8.0" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" dependencies = [ "binary_sv2", "bitcoin", @@ -4532,7 +4531,7 @@ dependencies = [ [[package]] name = "stratum_translation" version = "0.6.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" dependencies = [ "binary_sv2", "bitcoin", @@ -4579,7 +4578,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "sv1_api" version = "7.0.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" dependencies = [ "binary_sv2", "bitcoin", @@ -4658,7 +4657,7 @@ dependencies = [ [[package]] name = "template_distribution_sv2" version = "8.0.0" -source = "git+https://github.com/stratum-mining/stratum?branch=main#2220f62dbdc833a64c53f05bd0fbed3ae611f4d6" +source = "git+https://github.com/bit-aloo/stratum?branch=2026-11-11-handlers-sv2-fixes#f425aecf6d32f5048a0dcb302ffd7e056fb4b38c" dependencies = [ "binary_sv2", ] diff --git a/bitcoin-core-sv2/Cargo.toml b/bitcoin-core-sv2/Cargo.toml index d3ccae316..e04600ece 100644 --- a/bitcoin-core-sv2/Cargo.toml +++ b/bitcoin-core-sv2/Cargo.toml @@ -30,4 +30,4 @@ bitcoin_capnp_types_v32 = { package = "bitcoin-capnp-types", version = "0.3.0" } # fetching from github enables synchronizing development workflows across sv2-apps and stratum repos # it MUST be changed before bitcoin-core-sv2 is published to crates.io # with the proper version of stratum-core being fetched from crates.io as well -stratum-core = { git = "https://github.com/stratum-mining/stratum", branch = "main" } +stratum-core = { git = "https://github.com/bit-aloo/stratum", branch = "2026-11-11-handlers-sv2-fixes" } diff --git a/stratum-apps/Cargo.toml b/stratum-apps/Cargo.toml index f3368e547..d133427bf 100644 --- a/stratum-apps/Cargo.toml +++ b/stratum-apps/Cargo.toml @@ -17,7 +17,7 @@ keywords = ["stratum", "mining", "bitcoin", "protocol", "sv2"] # fetching from github enables synchronizing development workflows across sv2-apps and stratum repos # it MUST be changed before stratum-apps is published to crates.io # with the proper version of stratum-core being fetched from crates.io as well -stratum-core = { git = "https://github.com/stratum-mining/stratum", branch = "main", optional = true } +stratum-core = { git = "https://github.com/bit-aloo/stratum", branch = "2026-11-11-handlers-sv2-fixes", optional = true } bitcoin-core-sv2 = { package = "bitcoin_core_sv2", version = "0.7.0", path = "../bitcoin-core-sv2", optional = true } # External dependencies needed by the modules