Skip to content

dashboard: match P2Pool pool-type by exact port, not substring (#142)#154

Merged
VijitSingh97 merged 1 commit into
mainfrom
claude/pool-type-detection
Jun 4, 2026
Merged

dashboard: match P2Pool pool-type by exact port, not substring (#142)#154
VijitSingh97 merged 1 commit into
mainfrom
claude/pool-type-detection

Conversation

@VijitSingh97
Copy link
Copy Markdown
Collaborator

detect_pool_type decided Main/Mini/Nano by testing whether the sidechain port (37889/37888/37890) appeared anywhere in the peer string (if "37889" in p). So a peer on an unrelated, longer port that merely contains those digits — e.g. :137889 or :378880 — was miscounted, as would a future change to the peer-string format.

Fix: parse the port as the last colon-segment (p.rsplit(":", 1)[-1]) and match it exactly.

Why it matters: pool type drives block_time and the PPLNS-window duration the XvB controller uses (algo_service), so a misclassification (e.g. Nano read as Main → 10s vs 30s block time) skews the controller's reserve/gate math.

Tests: ports containing a pool port as a substring, and trailing junk, now resolve to Unknown; exact ports still detected. Dashboard suite green, 93% coverage.

Closes #142.

🤖 Generated with Claude Code

detect_pool_type counted a peer as Main/Mini/Nano if the sidechain port (37889/37888/
37890) appeared anywhere in the peer string, so a peer on an unrelated longer port that
merely contains those digits (e.g. ":137889") was miscounted. Parse the port as the last
colon-segment and match it exactly. Pool type drives block_time and the PPLNS-window
duration the XvB controller relies on, so a misclassification skews the controller.

Test: ports that contain a pool port as a substring (or trailing junk) now resolve to
Unknown; exact ports still detected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@VijitSingh97 VijitSingh97 merged commit 94f54e0 into main Jun 4, 2026
5 checks passed
VijitSingh97 added a commit that referenced this pull request Jun 4, 2026
Resolve CHANGELOG.md conflict by keeping both [Unreleased] › Fixed entries — the #142
pool-type fix (landed on main via #154) and this branch's #139 reset-dashboard fix.
Suite green (stack 111, compose + shellcheck).
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.

detect_pool_type matches sidechain port as a substring of the whole peer string — can misclassify the pool

1 participant