feat(deps): replace aquatic_udp_protocol with in-house implementation (#1732)#1733
Conversation
…p-protocol (step 1a of torrust#1732) These are verbatim copies of aquatic_peer_id 0.9.0 and aquatic_udp_protocol 0.9.0 (Apache 2.0), registered in the workspace Cargo.toml as path packages. No dependent package has been switched to use them yet — that is Step 1b. Each source file carries an inline attribution header crediting Joakim Frostegård (greatest-ape) and linking to the original crates.io release.
…ps (step 1b of torrust#1732) All 13 packages that previously depended on `aquatic_udp_protocol = "0"` (crates.io) now use `path = "../aquatic-udp-protocol"` (or `../../packages/aquatic-udp-protocol` for `console/tracker-client`). Build is clean and all tests pass.
…ent homes (torrust#1732) Split Step 4 into 4a (UDP protocol types → udp-protocol) and 4b (peer ID types → primitives). This reflects the fact that PeerId is a domain concept used by HTTP tracker, REST API, and core logic—not UDP-protocol-specific. Peer ID types belong in primitives with other peer-related domain types.
There was a problem hiding this comment.
Pull request overview
This PR introduces in-workspace forks of the unmaintained aquatic_udp_protocol / aquatic_peer_id crates and switches Torrust Tracker packages to consume those forks via path dependencies, as the first step toward unblocking the zerocopy 0.8 upgrade and reducing external maintenance risk.
Changes:
- Added new internal fork crates under
packages/aquatic-udp-protocolandpackages/aquatic-peer-id(source + LICENSE + README). - Updated multiple workspace crates to use the internal fork via path dependency instead of crates.io.
- Added workspace wiring/docs updates (
Cargo.tomlworkspace members + patch, analysis docs, word list updates).
Reviewed changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
Cargo.toml |
Adds fork crates to workspace members and adds a crates.io patch override for aquatic_*. |
Cargo.lock |
Removes registry sourcing for aquatic_* and records additional resolved deps for fork test/dev usage. |
project-words.txt |
Updates spellchecker allowlist for new terms used in the migration/docs/tests. |
console/tracker-client/Cargo.toml |
Switches console client to use forked aquatic_udp_protocol via path. |
packages/udp-tracker-server/Cargo.toml |
Switches dependency to forked aquatic_udp_protocol via path. |
packages/udp-tracker-core/Cargo.toml |
Switches dependency to forked aquatic_udp_protocol via path. |
packages/udp-protocol/Cargo.toml |
Switches dependency to forked aquatic_udp_protocol via path. |
packages/tracker-core/Cargo.toml |
Switches dependency to forked aquatic_udp_protocol via path. |
packages/tracker-client/Cargo.toml |
Switches dependency to forked aquatic_udp_protocol via path. |
packages/torrent-repository-benchmarking/Cargo.toml |
Switches dependency to forked aquatic_udp_protocol via path. |
packages/swarm-coordination-registry/Cargo.toml |
Switches dependency to forked aquatic_udp_protocol via path. |
packages/primitives/Cargo.toml |
Switches dependency to forked aquatic_udp_protocol via path. |
packages/http-tracker-core/Cargo.toml |
Switches dependency to forked aquatic_udp_protocol via path. |
packages/http-protocol/Cargo.toml |
Switches dependency to forked aquatic_udp_protocol via path. |
packages/axum-rest-tracker-api-server/Cargo.toml |
Switches dependency to forked aquatic_udp_protocol via path. |
packages/axum-http-tracker-server/Cargo.toml |
Switches dependency to forked aquatic_udp_protocol via path. |
packages/aquatic-udp-protocol/Cargo.toml |
New fork crate manifest for aquatic_udp_protocol. |
packages/aquatic-udp-protocol/src/lib.rs |
New fork crate module exports and lint allowances to preserve upstream code verbatim. |
packages/aquatic-udp-protocol/src/common.rs |
Forked shared protocol types/helpers. |
packages/aquatic-udp-protocol/src/request.rs |
Forked request parsing/serialization implementation + tests. |
packages/aquatic-udp-protocol/src/response.rs |
Forked response parsing/serialization implementation + tests. |
packages/aquatic-udp-protocol/README.md |
Documents purpose and provenance of the fork. |
packages/aquatic-udp-protocol/LICENSE |
Adds Apache-2.0 license text for the fork. |
packages/aquatic-peer-id/Cargo.toml |
New fork crate manifest for aquatic_peer_id. |
packages/aquatic-peer-id/src/lib.rs |
Forked peer-id parsing/client identification implementation. |
packages/aquatic-peer-id/README.md |
Documents purpose and provenance of the fork. |
packages/aquatic-peer-id/LICENSE |
Adds Apache-2.0 license text for the fork. |
docs/issues/1732-replace-aquatic-udp-protocol/ISSUE.md |
Adds in-repo migration plan/issue documentation. |
docs/issues/1732-replace-aquatic-udp-protocol/step-2-analysis.md |
Records Step 2 “unused code” analysis for the forks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #1733 +/- ##
===========================================
- Coverage 79.69% 79.52% -0.17%
===========================================
Files 359 368 +9
Lines 26411 27049 +638
Branches 26411 27049 +638
===========================================
+ Hits 21048 21511 +463
- Misses 5117 5258 +141
- Partials 246 280 +34 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- In ISSUE.md: replace the 'Related future work' callout in Step 4 with a leaner 'See also' note linking to the step-3 analysis doc; add new Step 4c checklist 'Consolidate InfoHash into bittorrent-primitives' with concrete action items (swap inner field to [u8;20], drop aquatic_udp_protocol dep, update impls/tests, publish, remove fork/patch entry). - In step-3-bittorrent-primitives-problem.md: rename 'Consolidate InfoHash' subsection to reference Step 4c explicitly; rename 'Update bittorrent-primitives after Step 4a' to 'Update bittorrent-primitives dependency after Step 4c' with matching explanation.
- New skill: process-copilot-suggestions for end-to-end workflow - Updated existing skills to reference comprehensive workflow - Added helper scripts in contrib/dev-tools/github-api-scripts/ * get-pr-review-threads.sh: fetch PR review threads * list-unresolved-threads.sh: filter unresolved threads * resolve-all-unresolved-threads.sh: batch resolve threads - Created template and workflow documentation in docs/pr-reviews/ - Example: completed PR torrust#1733 copilot suggestions audit - Includes reusable process for future PR reviews
|
ACK 7a587dd |
Replaces the external
aquatic_udp_protocolandaquatic_peer_iddependencies with in-house maintained packages and completes the post-migration refactor/cleanup for issue #1732.This removes the upstream maintenance bottleneck, keeps dependency/security updates under Torrust control, and preserves behavior across protocol and domain consumers.
Why this change
Upstream Aquatic crates appear unmaintained for our needs, while this tracker must continue evolving and receiving dependency/security updates.
Relevant upstream context:
What was delivered
udp-protocolrefactor into action-oriented modules.primitivesmodule refactor (announce/scrapesplit, cleanup).PeerId/PeerClientlogic into shared in-house package:packages/peer-id(bittorrent-peer-id)bittorrent-peer-idinto:packages/udp-protocolpackages/primitives(compatibility re-export preserved)packages/peer-idinternals into focused modules while keeping public API stable.packages/udp-protocol/README.mdpackages/peer-id/README.mdpackages/peer-idand clarified notices/acknowledgment.Architecture outcome
udp-protocolno longer owns duplicated peer-id logic.primitivesno longer owns duplicated peer-id logic.peer-idis the canonical owner ofPeerId/PeerClientlogic.udp-protocoldoes not depend onprimitives).Validation
All required checks were run and passed during the final slices:
cargo check --workspacecargo test --workspacecargo test --doc --workspacelinter allAttribution and licensing
Code originates from Aquatic crates (Apache-2.0), with in-house maintenance and required notices retained.
Special acknowledgment to greatest-ape (Joakim Frostegård) for significant contributions to the BitTorrent ecosystem.
Closes #1732