dashboard: match P2Pool pool-type by exact port, not substring (#142)#154
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
detect_pool_typedecided 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.:137889or: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_timeand 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