feat: share TCP discovery scanning and target validation - #1040
Closed
ankitgoswami wants to merge 1 commit into
Closed
feat: share TCP discovery scanning and target validation#1040ankitgoswami wants to merge 1 commit into
ankitgoswami wants to merge 1 commit into
Conversation
This was referenced Sep 11, 2026
ankitgoswami
added this pull request to stack #1041
September 11, 2026 18:06
ankitgoswami
removed this pull request from stack #1041
September 11, 2026 18:07
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.
Reviewable diff: +587/-117 across 10 files (excludes generated, test, and story files).
Summary
Fleet Server and Fleet Nodes gain a shared foundation for discovering miners without an external scanner. This PR centralizes target handling and adds the TCP reachability scanner; the following two PRs switch the runtime callers.
Stack: #1040 (this PR) → #1034 → #1035 → #1036 → #1037
This diff targets
main, which already includes #1030 manual discovery fan-out. This PR carries the shared-scanner changes from #1033 ontomain. This layer keeps the existing /22 and 1,024-target limits while establishing the scanner and target contract used by the rest of the stack.Node adoption is in #1034; server adoption and dependency removal in #1035; warnings in #1036; the final API name and capacity increase in #1037.
How it works
Requests and report scopes use the same parsed address intervals, DNS rules, and normalized ports. The shared
fleet-node-local-subnettarget asks the node to choose its own subnet. Bounded target parsing returns the validated interval for callers to reuse; server-local discovery keeps the broader parser. The new scanner consumes addresses lazily, connects without sending application data, closes each socket, and returns sorted open ports to the existing plugin-identification layer. Each endpoint acquires process-wide capacity before its worker starts. All scanner instances share a 512-worker/socket budget with a three-second connect timeout.Diagrams
Areas of the code involved
Key technical decisions & trade-offs
Testing & validation
Post-deploy monitoring & validation
Release the complete stack with server, nodes and client updated together. On a controlled network, compare expected miners against both server and node discovery, exercise an incomplete scan, and confirm that retained results and its warning reach the client. Pause rollout if expected devices disappear, scans cannot stop within their budgets, or completed reports are lost. No deployment was performed for these draft PRs.
Restack validation: affected unit/race suites, server lint, protobuf lint, client type check and 33 focused client tests pass. Database integration tests remain for CI.