Repository navigation
fix(http-protocol): [#2417] cap scrape info hashes per protocol - #2444
josecelano merged 41 commits into
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 2
Open (3)
What changed in this PR
Caps scrape info_hash counts per protocol to align behavior with documentation and mitigate abuse, while removing the shared core cap and adding client-side truncation warnings + regression coverage.
Changes:
- Enforce per-protocol scrape limits: HTTP caps at 100 in the parser; UDP caps at 74 computed from
MAX_PACKET_SIZE. - Remove
torrust_tracker_core::MAX_SCRAPE_TORRENTSand update UDP server plumbing to pass the UDP protocol cap. - Update/extend tests, docs, and add ADR + fake trackers to validate truncation and client warnings end-to-end.
| File | Description |
|---|---|
| project-words.txt | Adds new accepted words used in tests/docs (sendmsg, settimeout). |
| packages/udp-server/tests/server/contract.rs | Adds UDP contract coverage for 75-hash scrape truncation to 74. |
| packages/udp-server/src/lib.rs | Updates UDP server crate docs to reference the new per-protocol cap constant and ADR. |
| packages/udp-server/src/handlers/mod.rs | Switches UDP parsing cap source from core to UDP protocol; adds wiring test for parser cap. |
| packages/udp-protocol/src/request.rs | Introduces computed MAX_SCRAPE_INFO_HASHES, changes parser API to usize, and adds limit tests. |
| packages/tracker-core/src/scrape_handler.rs | Adds test asserting core has no scrape cap. |
| packages/tracker-core/src/lib.rs | Removes the public MAX_SCRAPE_TORRENTS constant. |
| packages/http-protocol/src/v1/requests/scrape.rs | Adds HTTP MAX_SCRAPE_INFO_HASHES = 100 and caps parsing to first 100 params with tests. |
| packages/axum-http-server/tests/.../receiving_an_scrape_request.rs | Adds end-to-end HTTP server contract test for 101 → 100. |
| packages/axum-http-server/src/lib.rs | Updates HTTP server docs to describe the HTTP cap and ADR link. |
| docs/refactor-plans/closed/.../REFACTOR-PLAN.md | Documents resolution of monitor success-path test via reusable fake trackers. |
| docs/issues/open/2417-.../prose-first-test-review.md | Adds prose-first AAA comparison record for the new/changed tests. |
| docs/issues/open/2417-.../manual-verification-evidence.md | Updates manual verification evidence with post-fix results and client behavior. |
| docs/issues/open/2417-.../implementation-retrospective.md | Adds implementation retrospective for the decision and tests. |
| docs/issues/open/2417-.../agent-review-reports.md | Records independent Task Reviewer reports and follow-ups. |
| docs/issues/open/2417-.../ISSUE.md | Updates issue spec with decisions, test matrix, and completion status/evidence. |
| docs/issues/open/2411-spam-and-abuse-resistance/EPIC.md | Updates EPIC row A3 to reflect the resolved decision + ADR link. |
| docs/adrs/index.md | Adds ADR index entry for the new scrape-cap ADR. |
| docs/adrs/20261005124222_cap_scrape_info_hashes_per_protocol.md | Adds ADR documenting per-protocol caps, rationale, and consequences. |
| console/tracker-client/tests/tracker_client/scrape.rs | Adds binary-level scrape tests verifying truncation warnings and stdout stability. |
| console/tracker-client/tests/tracker_client.rs | Registers the new scrape integration test module. |
| console/tracker-client/tests/tracker_checker/monitor.rs | Reworks monitor tests to run against fake UDP trackers (success + timeout paths). |
| console/tracker-client/tests/common/mod.rs | Exposes reusable fake trackers for integration tests. |
| console/tracker-client/tests/common/fake_trackers/mod.rs | Adds shared fake-tracker threading harness with stop-on-drop. |
| console/tracker-client/tests/common/fake_trackers/udp.rs | Adds a fake UDP tracker capable of truncation/silence behaviors. |
| console/tracker-client/tests/common/fake_trackers/http.rs | Adds a fake HTTP tracker that answers scrapes and can truncate responses. |
| console/tracker-client/src/console/clients/unified/udp.rs | Removes CLI 74-hash cap and emits truncation warning on stderr for UDP scrape. |
| console/tracker-client/src/console/clients/unified/scrape.rs | Adds shared truncation-warning + HTTP distinct-count helpers with unit tests. |
| console/tracker-client/src/console/clients/unified/mod.rs | Exposes the new shared scrape helper module. |
| console/tracker-client/src/console/clients/unified/http.rs | Emits truncation warning on stderr for HTTP scrape based on distinct requested hashes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 20f9c51b5aa7f9756897de947d43b43dbaddab5b (round 1). Recomputed from the bytes at this head, against develop at 632f8b177.
The PR. 21 commits on the develop tip (merge base 632f8b177), 30 files, +1775/−204, no manifest or lockfile change. Each protocol parser now owns its scrape cap (HTTP 100, UDP 74), tracker-core drops the shared constant, and the unified tracker_client stops capping udp scrape and warns on stderr when a scrape returns fewer entries than requested, pinned by binary-level tests against new fake trackers.
Cap per protocol. HTTP: pub const MAX_SCRAPE_INFO_HASHES: usize = 100 (http-protocol/src/v1/requests/scrape.rs:25), applied by .take() before decoding (:78); /scrape and /scrape/{key} both reach it through the one extractor (axum-http-server/src/v1/extractors/scrape_request.rs:76). UDP: (MAX_PACKET_SIZE - 16) / 20 = (1496 − 16) / 20 = 74 (udp-protocol/src/request.rs:21,29, common.rs:19), passed by handle_packet (udp-server/src/handlers/mod.rs:87-89). That file's ±150 is the constant swap plus a rustfmt reflow; the token stream is identical modulo whitespace. Both protocols truncate silently, in the same shape. tracker-core/src/lib.rs loses only MAX_SCRAPE_TORRENTS, and scrape_handler.rs adds only test C1, so no core cap applies twice; there is no REST scrape route. Below the caps nothing changed. Boundary tests: H1-H5 scrape.rs:178-233, S1 receiving_an_scrape_request.rs:217, U1-U3 request.rs:391-419, W1 handlers/mod.rs:603, US1 contract.rs:393, C1 scrape_handler.rs:240.
Client and tests. num_args = 1.. (unified/udp.rs:70); the warning sits at :125-129 (UDP, raw count) and at unified/http.rs:233 (HTTP, distinct count); the legacy udp/app.rs:181 keeps 1..=74. The fakes bind 127.0.0.1:0 and stop and join on drop. K1-K8 and both monitor tests exist. The monitor rewrite adds the success path and tightens the timeout path (URL, every status, timeout_percent 100, null latencies), so coverage rises. The DevSkim suppression (fake_trackers/http.rs:42) uses the repository's existing // DevSkim: ignore DS137138 form. See F1, F3, F7.
ADR and EPIC. The ADR's values and paths match the code. Its shape fits create-adr's "no rigid template", the index row is at index.md:49, and it supersedes nothing (the other scrape ADR, 20261002173716, covers the persistence batch). EPIC A3 (EPIC.md:58,65-66) agrees with the ADR. The Subissues row stays TODO until cleanup-completed-issues Step 5. For information: a trial merge with the loop's open #2438 conflicts in EPIC.md, because both edit the inventory rows around :56-66 and the Notes; the loop will rebase #2438 after this PR merges. REFACTOR-PLAN.md:247-250 records #1178 item 14 as resolved.
Spec folder. Every matrix row H1-K8 maps to a test at this head. The only commit id in the changed docs is a develop ancestor; the other hex tokens are rustc hashes, request-ID fragments and info-hash keys. prose-first-test-review.md records the comparison that write-unit-test step 5 requires, and the retrospective has the template's core sections. The Task Reviewer PASS is named as reported, not recomputed. See F2, F4-F6.
Hygiene. All 21 subjects are Conventional. 16 carry [#2417]; the five feat/test(tracker-client) subjects do not, and no rule requires the tag in commit subjects (AGENTS.md:382 governs PR titles). Author and committer times are ordered (2026-10-05 12:42Z to 2026-10-06 09:15Z). There is no attribution trailer and no banned token. project-words.txt adds sendmsg and settimeout, both used by the evidence. The PR body has the open-pull-request sections and Closes #2417. For information: a trial merge with the open #2445 conflicts, so whichever PR merges second needs a rebase.
Findings
- F1 [Major, blocking]
udp scrapewith 125 or more hashes: the client's 1496-byte receive buffer keeps 124 entries, and the warning blames the tracker. - F2 [Minor, blocking: spec wrong] Four ISSUE.md statements are false at this head.
- F3 [Minor] The spec lacks create-issue's ownership, drop-path and deadline design for the fake trackers.
- F4 [Nit] The recorded pre-push run and Task Reviewer pass predate the head's last commit.
- F5 [Nit] Implementer entries in
agent-review-reports.mdcarry reviewer verdicts. - F6 [Nit] The V4 command block cannot be run as written.
- F7 [Suggestion] The HTTP warning cannot tell truncation from omitted unknown torrents.
Checked, no finding: HTTP order and duplicates (MultiMap keeps insertion order per key); a bencoded failure takes the fallback path, not the warning; every parse_bytes caller moved to usize; the rustdoc link paths are public; #[allow(dead_code, unused_imports, reason = ...)] at tests/common/mod.rs:3; related-pr: null (cleanup sets it); last-updated-utc equals the last Progress Log entry; the ADR is placed at the root; the frozen legacy client still caps.
Checks
On the loop's compute hub at this head, base develop 632f8b177 (receipt server-gates-krkavec-76): pre-commit profile gate exit 0 (81 s), clippy-allow-reasons --base-ref 632f8b177 exit 0, tree clean after the gate; linter markdown, linter cspell, linter lychee exit 0; cargo +stable test --workspace --all-targets --all-features: 2988 passed, 0 failed (118 s); cargo +nightly clippy --workspace --all-targets --all-features -- -D warnings: 0 diagnostics. GitHub checks at this head at posting time: 3 completed/skipped; 31 completed/success. At posting, develop is ed3cea204 (the merges of #2441 and #2442) and this head still merges cleanly onto it.
20f9c51 to
b8c797f
Compare
Set related-pr and log the constructor rename and the opened PR.
The cleanup-completed-issues step sets related-pr; the previous commit set it too early (PR torrust#2444 review round 1).
…he tracker packet size The UDP client read replies into a MAX_PACKET_SIZE (1496-byte) buffer, so a scrape answer with 125 or more entries (8 + 12 x N bytes) was cut to 124 and tracker_client blamed the tracker for the truncation. Size the receive buffer for any UDP datagram: the tracker's packet size limits what it reads, not what a client may receive. A 125-hash test against a fake tracker pins it (PR torrust#2444 review finding F1).
… at the cap Apply max_scrape_info_hashes before collecting, so the parser neither builds nor copies info hashes past the cap (PR torrust#2444 review finding F9).
…packet fits a scrape MAX_SCRAPE_INFO_HASHES subtracts the scrape header from MAX_PACKET_SIZE; a compile-time assertion now explains a packet size too small for one info hash instead of failing with an arithmetic overflow (PR torrust#2444 review finding F8).
…P parser &payload[..payload.len()] is &payload (PR torrust#2444 review finding F10).
…quest read A connected peer that sent nothing blocked the fake's request read with no deadline, and dropping the fake joins its thread, so the test could hang. Set a read timeout so such a peer fails the test instead (PR torrust#2444 review finding F3).
…iles can mean A UDP scrape response is positional, but an HTTP files dictionary collapses duplicates and may omit unknown torrents, so the truncation warning is a hedge for HTTP (PR torrust#2444 review finding F7).
74 comes from the scrape request size, not the response; M2 is done; the issue's ADR is now related; T9 names the renamed start_silent() (PR torrust#2444 review finding F2).
…s for the fake trackers Add the create-issue design section for the reusable fake-tracker fixtures: who owns each socket and thread, stop-and-join on every drop path, and the polling and read deadlines (PR torrust#2444 review finding F3).
Add test-matrix row K9 and its prose-first comparison: the client receives a UDP scrape answer larger than the tracker packet size in full (PR torrust#2444 review finding F1).
Add the hash-generation loops, one command per probe with its own output files, and the counting commands (PR torrust#2444 review finding F6).
…enter follow-ups Append a correction: the Implementation Follow-up entries are not independent reviews, so their verdicts are withdrawn and the 21:07 UTC Task Reviewer pass stands (PR torrust#2444 review finding F5).
…he pre-push rerun Record the round-1 processing and that the full pre-push suite passed at the head with every round-1 code fix (PR torrust#2444 review finding F4).
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at b8c797f61a7c8dee9a8f11ec257929279b7cd5d7 (round 2). Recomputed from the bytes at this head, against develop at d0c97baef.
This head is the round-1 commits rebased onto the moved develop, plus fourteen commits that answer F1-F7 and Copilot's three comments and tighten the UDP parser. A rebase gets its own round because the base, the commit ids and the reviewed bytes all change, and an approval binds to one head.
Rebase. The git range-diff of the round-1 range against d0c97baef..03baa866e shows 21 of 21 =. The merge base is d0c97baef; the PR is 35 commits, 31 files, +1890/−214. The develop delta is 16 docs files (the #1669 EPIC, the #2246 and #2412 specs archived to closed/, and three PR-review records). It shares no file with this PR, and no line this PR adds cites a moved path.
F1-F7 (each checked against its reply and its commit):
- F1 fixed.
RECEIVE_BUFFER_SIZE = 65_535(packages/tracker-client/src/udp/client.rs:22) covers every non-jumbogram UDP payload (65,507 bytes over IPv4, 65,527 over IPv6).vec!(:164) plustruncate(:176) returns the same bytes as the oldto_vecplustruncate. The tracker still reads intoMAX_PACKET_SIZE(udp-server/src/server/receiver.rs:15). K9 (tests/tracker_client/scrape.rs:125) runsFakeUdpTracker::start()(no limit, 65,535-byte buffer), which answers 125 hashes in 1508 bytes; the test expects 125 entries and an empty stderr. K5 still pins the warning path. - F2: three of the four statements are fixed (
ISSUE.md:64-65,:197,:296). The M2 replacement at:244-245is false; re-raised inline. - F3 fixed.
REQUEST_READ_TIMEOUTis 5 s (fake_trackers/http.rs:16,66), so a silent peer panics the fake and fails the test through the join; the UDP fake was already bounded by a 10 ms read timeout (udp.rs:50).ISSUE.md:213-236gives the ownership map, both lifetimes and the deadlines, and says plainly that no first-slice checkpoint was held. - F4 fixed. The pre-push rerun is logged at 10:55 UTC (
ISSUE.md:415-421), after the last Rust commit at 10:45:54Z, and the PR body no longer says "final branch". - F5 fixed. An appended Correction (
agent-review-reports.md:90-99) withdraws both follow-up verdicts and names the standing 21:07 PASS; the earlier entries are unchanged. - F6 fixed. V4 (
manual-verification-evidence.md:183-206) now defineshashesand runs one command per probe into its own files, matching the table at:208-212. - F7 fixed as documented. The module doc is at
unified/scrape.rs:8-11; the warning kind and text are unchanged, as the reply says.
Parser commits.
.take(max)beforecollect(udp-protocol/src/request.rs:143-148) yields the firstmin(max, n)hashes in order for every input,max= 0 included. Empty and short bodies still fail earlier, at:125-141.- The compile-time assert (
:23-26) holds (1496 ≥ 16 + 20). It guards what its message says: room for one hash, so the cap is at least 1 and the subtraction at:34cannot underflow. &udp_request.payload(udp-server/src/handlers/mod.rs:87, 130 columns) is the same&[u8]as before.- No test changed; U1, U2 and W1 still cover the path. Copilot's three comments are fixed as their replies state.
Carried forward. The caps are unchanged (HTTP 100 at scrape.rs:25,78; UDP 74 at request.rs:34). Matrix rows H1-K9 map to tests at this head, and no MAX_SCRAPE_TORRENTS remains outside the docs. The ADR, its index row and EPIC A3 are unchanged and consistent. Hygiene over the 35 commits:
- All subjects are Conventional, and the fourteen new ones carry
[#2417]. - Committer times are ascending (one rebase at 11:00Z).
- No trailer, no banned token, no manifest change.
For information: the loop's open #2438 edits the same EPIC.md rows and Notes and will be rebased after this PR merges. #2445 (open, changes requested) also overlaps this PR, so whichever merges second needs a rebase.
Findings
- F2 [Minor, re-raise, blocking: spec wrong]
ISSUE.md:244-245says M2 was recorded before the final behavior was selected; the spec's own record says after. - F11 [Minor, blocking: spec wrong]
ISSUE.md:416-417cites an audit record that does not exist at this head. It is numbered F11 because this PR already assigns F8-F10 to Copilot's findings.
Threads: F1 and F3-F7 are verified and can be resolved; F2 stays open. The audit record that process-pr-review owes for round 1 is not blocking, and committing it also fixes F11.
Checks
On the loop's compute hub at this head, base develop d0c97baef (receipt server-gates-krkavec-79): pre-commit profile gate exit 0 (73 s), clippy-allow-reasons --base-ref d0c97baef exit 0, tree clean after the gate; linter markdown, linter cspell, linter lychee exit 0; cargo +stable test --workspace --all-targets --all-features: 3010 passed, 0 failed (72 s; 22 more than at the round-1 tip, the new client and parser tests included); cargo +nightly clippy --workspace --all-targets --all-features -- -D warnings: 0 diagnostics. GitHub checks at this head at posting time: 1 completed/skipped; 30 completed/success; 1 in_progress/null. At posting, develop is d0c97baef and this head merges cleanly onto it.
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 113b8073fe14a4ab6bac14cc69cc22180e46f026 (round 3). Recomputed from the bytes at this head, against develop at d0c97baef.
This head is the round-2 tip plus one commit, docs(pr-reviews): [#2417] audit review round 1 of PR #2444. It adds only docs/pr-reviews/pr-2444-review/PR-REVIEW.md (+220); the spec, the evidence and the code are byte-identical to the round-2 tip.
The record (round 1).
- The shape matches the template and the merged #2440, #2441 and #2443 records: frontmatter linking the skill and the #2417 spec, Ownership, Status Values, ten rows with ten detail entries in the same order, a Processing Log and Completion Rules.
- My seven severities equal their bracket tags, which the validator compares (
process-pr-review/SKILL.md:226). - Copilot's three rows carry
(inferred)because its comments had no brackets (template:35-36, "append(inferred)when derived from free prose"). Its overview rates them Medium, Medium and Low, recorded as Minor, Minor and Suggestion. securityfor F9 fits, because the concern is the cap as an abuse-mitigation boundary (category by concern, template:59). The row order follows the IDs' source-review order (template:51).- All ten Source and Reply URLs match the captured comments and replies, and every Resolution reference is a subject on the branch.
- The Processing Log is in order. Its 10:28 entry records the fetch, not the 09:35 and 09:54 submissions. Its 11:19 stamp precedes the commit that carries it (11:20:40Z), which is the direction
SKILL.md:230-231asks to be checked by hand. "Reran pre-push (exit 0)" cannot be checked from the bytes. RESOLVEDis forward state: at capture, F2 (held by the loop) and F8-F10 (the author's to resolve) are still open.- The round-1 F2 row can stay
FIXED, because the vocabulary has no partial disposition (template:31), and template:53-54says "Every re-raise has its own tracking row and matching detail entry; never collapse it into the original finding."
F2 and F11 at this head.
- F2 (re-raise) stands.
ISSUE.md:244-245still says M2 "was recorded before the final behavior was selected (V2)", and there is no reply on its thread. The record's F2 detail entry quotes the sentence without that clause. - F11 is fixed by this commit. The path cited at
ISSUE.md:415-417and in the PR body now resolves. No reply has been posted on its thread yet.
Owed after this round (not requested).
- A row for the F2 re-raise:
RE_RAISE_OF:F2, with the next audit-local ID (reviewer ID F2) underSKILL.md:57-61. - A row for F11 with exactly one reply URL.
- Log entries for review 5427602231 and for this review.
The validator checks the ten rows that exist; the round-2 findings have no rows yet, so it cannot see them.
Carried forward. The round-2 results stand unchanged: the clean rebase, F1 and F3-F7 fixed, the three UDP commits behaviour-neutral, the caps (HTTP 100, UDP 74), the H1-K9 matrix, and EPIC A3. Hygiene over 36 commits:
- The new subject is
docs(pr-reviews)with[#2417]. - Its author and committer are the same, at 11:20:40Z, after 10:56:31Z.
- No trailer, no banned token, no manifest change.
For information: the loop's open #2438 edits the same EPIC.md rows and will be rebased after this PR merges. #2445 (open, changes requested) also overlaps, so whichever merges second needs a rebase.
Findings: none new. F2 (re-raise, Minor, the spec is wrong) still blocks.
Threads: both F2 threads stay open; the F11 thread can be resolved.
Checks
On the loop's compute hub at this head, base develop d0c97baef (receipt server-gates-krkavec-81): pre-commit profile gate exit 0 (70 s), clippy-allow-reasons --base-ref d0c97baef exit 0, tree clean after the gate; linter markdown, linter cspell, linter lychee exit 0; cargo +stable test --workspace --all-targets --all-features: 3010 passed, 0 failed (71 s); cargo +nightly clippy --workspace --all-targets --all-features -- -D warnings: 0 diagnostics; validate-audit-record.py --pr-number 2444 over the live review comments captured after the replies: 10 rows, 4 log entries, 0 failures (it checks recorded rows only; the round-2 findings have no rows yet). GitHub checks at this head at posting time: 1 completed/skipped; 27 completed/success; 4 in_progress/null. At posting, this head merges cleanly onto develop.
… selected The round-1 rewrite said M2 was recorded before the selection; the spec's own record shows it ran after T2, with the fix applied (PR torrust#2444 review finding F12, a re-raise of F2).
Persist the re-review report, apply its optional retrospective and review-record findings, and tick the Task Reviewer checkpoint.
Tick the linter and tests acceptance criterion after the full pre-push suite passed on the rebased branch.
…start keeping_first(n), answering(), and silent() named neither what was kept nor that a running tracker is returned. Use start(), start_with_scrape_limit(n), and start_silent(); the private constructor becomes spawn(behavior). Update the refactor plan torrust#1178 resolution note.
Set related-pr and log the constructor rename and the opened PR.
The cleanup-completed-issues step sets related-pr; the previous commit set it too early (PR torrust#2444 review round 1).
…he tracker packet size The UDP client read replies into a MAX_PACKET_SIZE (1496-byte) buffer, so a scrape answer with 125 or more entries (8 + 12 x N bytes) was cut to 124 and tracker_client blamed the tracker for the truncation. Size the receive buffer for any UDP datagram: the tracker's packet size limits what it reads, not what a client may receive. A 125-hash test against a fake tracker pins it (PR torrust#2444 review finding F1).
… at the cap Apply max_scrape_info_hashes before collecting, so the parser neither builds nor copies info hashes past the cap (PR torrust#2444 review finding F9).
…packet fits a scrape MAX_SCRAPE_INFO_HASHES subtracts the scrape header from MAX_PACKET_SIZE; a compile-time assertion now explains a packet size too small for one info hash instead of failing with an arithmetic overflow (PR torrust#2444 review finding F8).
…P parser &payload[..payload.len()] is &payload (PR torrust#2444 review finding F10).
…quest read A connected peer that sent nothing blocked the fake's request read with no deadline, and dropping the fake joins its thread, so the test could hang. Set a read timeout so such a peer fails the test instead (PR torrust#2444 review finding F3).
…iles can mean A UDP scrape response is positional, but an HTTP files dictionary collapses duplicates and may omit unknown torrents, so the truncation warning is a hedge for HTTP (PR torrust#2444 review finding F7).
74 comes from the scrape request size, not the response; M2 is done; the issue's ADR is now related; T9 names the renamed start_silent() (PR torrust#2444 review finding F2).
…s for the fake trackers Add the create-issue design section for the reusable fake-tracker fixtures: who owns each socket and thread, stop-and-join on every drop path, and the polling and read deadlines (PR torrust#2444 review finding F3).
Add test-matrix row K9 and its prose-first comparison: the client receives a UDP scrape answer larger than the tracker packet size in full (PR torrust#2444 review finding F1).
Add the hash-generation loops, one command per probe with its own output files, and the counting commands (PR torrust#2444 review finding F6).
…enter follow-ups Append a correction: the Implementation Follow-up entries are not independent reviews, so their verdicts are withdrawn and the 21:07 UTC Task Reviewer pass stands (PR torrust#2444 review finding F5).
…he pre-push rerun Record the round-1 processing and that the full pre-push suite passed at the head with every round-1 code fix (PR torrust#2444 review finding F4).
… selected The round-1 rewrite said M2 was recorded before the selection; the spec's own record shows it ran after T2, with the fix applied (PR torrust#2444 review finding F12, a re-raise of F2).
…2444 Round 3 raised no new finding; log it alongside round 2.
…s 2-4 Bump last-updated-utc, which the F12 fix left stale, and log the F12 fix, the round-4 approval, and the rebase (PR torrust#2444 review finding F13).
…2444 Record the round-4 approval, its Nit F13 with the fix and reply, and the rebase.
5b3d7c5 to
55350a2
Compare
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 55350a2dc9799f6206d8f965a35b3dc3fd4b51bc (round 5). Recomputed from the bytes at this head, against develop at 427b39ac8.
A pass at the previous tip was superseded by a rebase-and-record push. This head is the round-4 commits rebased onto the merged #2445 and #2447, plus the stamp commit and the round-4 record.
Second rebase.
- The
git range-diffof the previous tip's forty commits against the rebased forty shows 40 of 40=. - The develop delta (#2447) touches five docs files. The only one shared with this PR is
project-words.txt, wheregit diff 427b39ac8..headadds only this PR'ssendmsgandsettimeoutand deletes nothing. Indocs/adrs/index.mdit adds only this PR's row, next to #2445's, with no upstream line lost. - Every code and test file is byte-identical to the previous tip's version.
The record, now complete for rounds 1-4. There are thirteen rows, thirteen detail entries and thirteen threads, all resolved.
- F13 is Human,
Nit(matching the[Nit]bracket) andmetadata,ORIGINAL/FIXED/RESOLVED. - Its source review (5427924536), source URL (my round-4 comment), reply URL (12:32:21Z) and resolution
docs(issues): [#2417] bump the spec stamp and log review rounds 2-4match the capture. - Its Current-tree verification reproduces:
ISSUE.md:12reads"2026-10-06 12:27", equal to the last Progress Log entry. - The row follows source-review order.
- The log entries match the events. 12:29 records the review (11:54:51Z), the first rebase (12:16-12:20Z) and the F13 fix (12:29:50Z). 12:32 records the push (12:31:18Z) and the reply (12:32:21Z). Both precede their commit's author time (12:33:55Z). "Ran pre-push (exit 0)" cannot be checked from the bytes.
- The validator now checks thirteen rows.
- Owed: a log entry covering the second rebase and push, and this review.
Carried forward from round 5, unchanged at the bytes. These stand:
- F13 fixed (stamp = last log entry), and the F2 fix (F12).
- The three UDP commits, the caps (HTTP 100, UDP 74), the H1-K9 matrix, the ADR and EPIC A3.
Hygiene over 41 commits:
- The rebased forty keep their subjects and author times; all 41 committer times fall at the second rebase (12:34:25-12:34:44Z).
- The new subject is
docs(pr-reviews)with[#2417], by the same author and committer. - No trailer, no manifest change.
For information: the loop's open #2438 edits the same EPIC.md rows and will be rebased after this PR merges.
Findings: none new.
Verdict: APPROVE.
Checks
On the loop's compute hub at this head (receipt server-gates-krkavec-92; its pre-commit base was 29ef7cb80, one docs-only merge behind the merge base 427b39ac8): pre-commit profile gate exit 0 (73 s), clippy-allow-reasons --base-ref 29ef7cb80 exit 0, tree clean after the gate; linter markdown, linter cspell, linter lychee exit 0; cargo +stable test --workspace --all-targets --all-features: 3010 passed, 0 failed (133 s); cargo +nightly clippy --workspace --all-targets --all-features -- -D warnings: 0 diagnostics; validate-audit-record.py --pr-number 2444 --base 427b39ac8 over the live review comments at this head: 13 rows, 9 log entries, 0 failures. GitHub checks at this head at posting time: 1 completed/skipped; 7 in_progress/null; 16 queued/null. At posting, this head merges cleanly onto develop 427b39ac8; the loop's #2438 will be rebased after this PR merges.
|
ACK 55350a2 — the second rebase onto 427b39a is verified (40 identical commits, only this PR's lines added in the shared files, no code drift), and the audit record is complete for rounds 1-4 (thirteen rows matching the posted comments, replies and fix subjects), with one log entry for this round owed |
|
ACK 55350a2 |


Closes #2417
Part of the spam and abuse EPIC #2411.
Summary
The documentation said an HTTP scrape is limited to 74 info hashes, but only UDP enforced it: a local HTTP scrape with 1000 hashes returned 1000 entries. After reconsidering the HTTP limit on its own merits (the UDP 74 comes from the packet size, which does not apply to HTTP), each protocol now has its own limit, enforced in its parser and documented with its reason. The decision is recorded in ADR
docs/adrs/20261005124222_cap_scrape_info_hashes_per_protocol.md.info_hashparams and ignores the rest without decoding them. 100 is an abuse-mitigation policy value; duplicates count toward it.MAX_PACKET_SIZE((1496 - 16) / 20).torrust_tracker_core::MAX_SCRAPE_TORRENTSis removed; each protocol package ownsMAX_SCRAPE_INFO_HASHES.udp scrape(it blocked manual verification and is a tracker's limit, not the protocol's). Because trackers truncate silently, it now writes one NDJSONscrape_response_truncatedwarning to stderr when a UDP or HTTP scrape returns fewer entries than requested; stdout is unchanged. The frozen legacyudp_tracker_clientkeeps its limit.A per-request cap does not replace rate limiting: parallel requests bypass it. That remains EPIC #2411's work.
Public API and scope notes
fix(http-protocol): [#2417] cap scrape info hashes per protocolalso changesudp-protocol,udp-server, andtracker-core, including the removal of the public constanttorrust_tracker_core::MAX_SCRAPE_TORRENTS(accepted for3.0.0-develop).Request::parse_bytesinudp-protocolnow takesmax_scrape_info_hashes: usizeinstead of au8, so the computed constant needs no truncating cast.tracker-clientintegration tests, which also implement the monitor success-path test deferred as item 14 of refactor plan Tracker Checker (UDP): add command to monitor uptime #1178.Tests
Every decision and edge case is pinned by a test with literal counts (the test matrix is in the issue spec):
http-protocolparser: 100 kept; 101 → first 100 in order; an invalid 101st param is ignored; an invalid param within the first 100 still fails; duplicates count.axum-http-server: 101 hashes → 100 files end to end.udp-protocol: 74 fit in one packet and 75 do not; 74 kept; 75 → first 74.udp-server: ahandle_packettest proves the server passes the parser cap (the 1496-byte receive buffer also truncates a 75-hash datagram, so a socket-level test alone cannot); plus the socket-level contract test.tracker-core: 101 hashes → 101 entries (no cap in core).tracker-client: CLI accepts 75 hashes; warning logic; binary-level tests against fake trackers with a scrape limit of 2, checking stdout, stderr, and exit code; monitor success and timeout paths.Red-first or mutation-checked: the HTTP parser and server tests failed before the fix; mutating the UDP server cap fails only the
handle_packettest; dropping the client warning or counting raw HTTP params fails the binary-level tests; recording an extra timeout per success fails the monitor success-path test.Validation
linter all) passed on every commit. The full pre-push suite passed at the head pushed after review round 1, which includes every round-1 code fix and is rebased on the latestdevelop.docs/pr-reviews/pr-2444-review/PR-REVIEW.md. F1 was a real defect: the UDP client read replies into a 1496-byte buffer, so a scrape answer above 124 entries was cut and blamed on the tracker; the buffer now fits any UDP datagram, pinned by a 125-hash test (K9).manual-verification-evidence.md): HTTP 74/75/1000 → 74/75/100 entries; UDP 75 → 74 entries with 1516 bytes sent; the maintained client warns for UDP 75 and HTTP 1000 and stays silent for HTTP 74.agent-review-reports.md, and the prose-first comparison is inprose-first-test-review.md.