Skip to content

Fix/user identity validate authorize - #1

Open
average-gary wants to merge 23 commits into
bit-aloo:2026-01-05-remove-deadlockfrom
marafoundation:fix/user-identity-validate-authorize
Open

Fix/user identity validate authorize#1
average-gary wants to merge 23 commits into
bit-aloo:2026-01-05-remove-deadlockfrom
marafoundation:fix/user-identity-validate-authorize

Conversation

@average-gary

Copy link
Copy Markdown

No description provided.

GitGab19 and others added 9 commits January 22, 2026 11:54
…ve-deadlock

Remove circular dependency on Sv1Server and downstream in tproxy
…sions-release-apps-script

make `scripts/release-apps.yaml` executable
…publishing-bitcoin-core-sv2

avoid publishing `bitcoin-core-sv2`
it was originally copied from stratum repo, where we use cargo 1.75

this version of cargo returns a `already uploaded` string

but on this repo, we're using cargo 1.85, which returns `already exists` string
…release-apps-script

patch `release-apps.sh`
…publishing-apps

avoid publishing all apps
@average-gary
average-gary force-pushed the fix/user-identity-validate-authorize branch from 190ec4c to 30d4718 Compare January 22, 2026 17:06
@average-gary
average-gary force-pushed the fix/user-identity-validate-authorize branch from 8acdf30 to 9583132 Compare January 23, 2026 15:16
bit-aloo and others added 11 commits January 25, 2026 07:46
…ve-check-alive-check

Remove check alive check from spawn job keepalive loop method
…on-no-downstream-channel

(Tproxy): log on no upstream channel instead of shutdown
…broadcast-shutdown

add `SHUTDOWN_BROADCAST_CAPACITY` constant
Refactor user identity handling in the translator to properly separate
channel identity from worker identity for TLV extension.

Changes:
- Rename authorized_worker_name to worker_name_from_authorize for clarity
- Store only worker suffix (part after '.') in user_identity for TLV use
- Remove username length validation at authorize time (username is ignored)
- Disconnect client at share submission if worker suffix exceeds 32 bytes
- Remove config-based user_identity overwrite in open_extended_mining_channel
- Update integration tests to reflect new behavior

The user_identity in TLV now contains only the worker portion from
mining.authorize (e.g., 'worker1' from 'user.worker1'), enabling
pass-through of worker identification for hashrate tracking.

The channel identity sent in OpenExtendedMiningChannel continues to use
the translator's config value, which is separate from the TLV worker identity.
@average-gary
average-gary force-pushed the fix/user-identity-validate-authorize branch from 9583132 to 1010f9a Compare February 2, 2026 20:08
bit-aloo pushed a commit that referenced this pull request Apr 29, 2026
…st assertions

Replaces string-concatenation form ("name{k=\"v\"}") with a structured
Metric<'a> { name, labels } type. Bare-name callers stay unchanged via
From<&str>; labeled callers use Metric::with_labels(name, &[(k, v), ...]).

Benefits over the previous string-prefix matching:
- Label matching is order-independent (current code passed by accident
  thanks to the prometheus crate's BTreeMap label ordering)
- Subset matching: query a single label, ignore extras on the line
- Type-safe k/v pairs, no quote escaping at call sites
- Single match path used by parse_metric_value, assert_metric_*,
  assert_metric_present/not_present, and poll_until_metric_gte

Leverages the new API in monitoring_integration tests to assert on the
specific (client_id, channel_id, user_identity) tuple each topology
produces, rather than matching the first series for a metric name.
Catches mis-attributed shares that the bare-name form would silently
accept:
- Test #1 (sv2 mining device): adds an explicit user_id to the fixture
  so the user_identity label is a meaningful 'test-miner' rather than
  empty.
- Test #2 (pool + tProxy + 1 SV1): asserts the SV1 worker name flows
  through to the pool's view of tProxy's channel as
  'user_identity.miner1'.
- Test #3 (aggregated): asserts JDC's 'IT-test' identity on the pool
  side and the SV1 worker name on tProxy's server view.
- Test #4 (block found): unchanged \u2014 sv2_client_blocks_found_total is
  a scalar gauge (no labels), so a bare-name selector is correct here.

Addresses stratum-mining#336 and the related review feedback on stratum-mining#338.
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.

5 participants