Track: port RustScan to tokio (PR #856)
Author: bee-sanCreated Oct 1, 2026Updated Oct 1, 2026
Tracking issue for the async-runtime port proposed in #856 ("port to tokio again" by @vrtgs). #856 is a large architecture change, so it stays open and isn't part of the current round of PR merges. This issue records what it does and what it would need before it can land.
Why it matters
RustScan's scanner, DNS resolution and tests run on async-std. Upstream has discontinued async-std and recommends migrating away (see the async-std README/CHANGELOG and RUSTSEC-2025-0052). So moving to a maintained runtime is worth doing eventually.
What #856 changes
- Size: one commit, +966/−1218 across 13 files (about 1.2k of that churn is
Cargo.lock). There's no PR description and no benchmark numbers. - Runtime: replaces
async-std/futureswithtokio(rt-multi-thread,net,fs,macros). It also addstokio-par-stream,futures-lite,futures-util,eitherandblackrock2. - Port randomisation: deletes the LCG
src/port_strategy/range_iterator.rsand switches toblackrock2. It also reshapesPortStrategy(src/port_strategy/mod.rs→src/port_strategy.rs). - DNS/address parsing: becomes async (
TokioAsyncResolver,tokio::net::lookup_host, async file reads).parse_addressesturns into anasync fn, andparse_addressnow takes aCow<str>and returns an iterator. - Scanner: rewrites
Scanner::run, the socket iterator and the TCP/UDP connect paths on top of tokio. - Library API:
rustscan::address,rustscan::scannerandrustscan::port_strategyall change in breaking ways, so this needs a semver-major release (or at least a clearly announced minor one).
Conflicts / staleness
CONFLICTINGwithmaster. It was branched before several dependency bumps (rand0.8,dirs5,toml0.8,colored2,subprocess), and nearly every file it touches has changed since.- It edits
tests/timelimits.rs, which no longer exists. - It turns the address tests into
#[tokio::test], including ones that resolvegoogle.com, invalid hostnames and host files. Those network/DNS tests were removed on purpose in #942/#943, so they must not come back.
Risks
- Scanning hot path: concurrency, batching and timeout behaviour can shift in subtle ways, including fd limits and the batch-size/ulimit logic.
- Performance: speed is RustScan's main feature, and no comparison has been posted.
- New dependencies:
blackrock2andtokio-par-streamare small, little-used crates. They'd need a supply-chain review, or replacing with well-known alternatives. - Port order: replacing the LCG changes the order (and the distribution) of randomised scans.
- Embedders: library users have to adopt tokio and the new async signatures.
- Open PRs: it will conflict with every PR in flight that touches the scanner or address parsing.
What would be needed to land it
- Rebase onto current
master, with no network/DNS/script-executing tests (keep the #942 policy). - Split it into reviewable steps, e.g. (a) swap the runtime and keep the public API, (b) async resolver, (c) any port-randomisation change as its own PR (or keep the existing LCG iterator).
- Justify or drop each new dependency, and keep
cargo treegrowth minimal. - Post before/after scan-speed numbers from a controlled environment.
- Document the library API migration and decide on the version bump.
- CI green on Linux, macOS and Windows.
PR: #856
Source: bee-san/RustScan