fix(file): pace chunks to fit rendezvous rate limit #22
Loading…
Reference in a new issue
No description provided.
Delete branch "wt/t_fc02d8b6"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
File transfer was silently truncated by the incoming rendezvous token bucket (30/60s, burst 10). A 1 MiB file is 17 one-shot Noise sessions; anything past the burst of 10 could be dropped with no retry.
This PR is a latency trade, not a protocol change and not a security fix. The DoS control is unchanged: same bucket constants, same pre-handshake drop, friends and floods still indistinguishable at accept.
Sender-side only:
xfer_idcontinuation.filframe layout unchanged.Wall-clock cost (1 MiB / 17 chunks)
Pacing floor is 16 × 3s = 48s between the first and last attempt on the happy path, plus 17 Tor connect + Noise handshakes. Retries add another 3s each. That is the cost of fitting the published budget instead of being truncated by it.
Tests
TokenBucket::default(): unpaced 17 chunks drop 7; paced at 3s drop 0.cargo test --lockedgreen (148 passed / 3 ignored).cargo clippy --locked --all-targets -- -D warningsgreen.src/ratelimit.rsbyte-identical toorigin/main(blob629f2bf182dbdfd96c0a1d04202ecba929da9270).