fix(axum-http-server): return compact peer list by default per BEP 23 - #1990
Merged
josecelano merged 2 commits intoJul 16, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aligns the HTTP announce endpoint in axum-http-server with BEP 23’s suggestion to return compact peer lists by default when the compact query parameter is omitted, while still honoring compact=0 to request the dictionary (non-compact) format.
Changes:
- Inverted announce response selection so
compactabsent → compact, andcompact=0→ dictionary format. - Updated module documentation to remove the prior “deviation” notice and reflect the new default behavior.
- Adjusted contract tests and test helpers to accept either announce response format.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/axum-http-server/src/v1/handlers/announce.rs | Inverts the compact/default announce response selection logic. |
| packages/axum-http-server/src/lib.rs | Updates HTTP tracker docs: removes prior deviation notice and documents compact-by-default behavior. |
| packages/axum-http-server/tests/server/v1/contract/for_all_config_modes/receiving_an_announce_request.rs | Renames and flips the “default compact” contract test assertion. |
| packages/axum-http-server/tests/server/asserts.rs | Updates assert_is_announce_response to accept both compact and normal response formats. |
| docs/issues/open/1986-align-http-tracker-compact-default-with-bep-23/ISSUE.md | Marks the issue spec tasks/verification as completed with evidence. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…1990 - Use instead of in helper to handle arbitrary binary data in compact peer strings. - Change column for in the query-parameter table from to (compact) for clarity, per Copilot review feedback.
Member
Author
|
ACK 25162a0 |
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.
Description
Aligns the HTTP tracker with BEP 23, which SUGGESTS that trackers return compact peer lists by default when the client omits the
compactGET parameter.Changes
packages/axum-http-server/src/v1/handlers/announce.rs— Inverted the compact logic inbuild_response. NowNone(absentcompactparam) maps to compact response. Onlycompact=0returns dictionary format.packages/axum-http-server/src/lib.rs— Removed the BEP 23 deviation NOTICE. Updated the query-parameter tableDefaultcolumn forcompactfromNonetocompact (BEP 23).packages/axum-http-server/tests/server/v1/contract/for_all_config_modes/receiving_an_announce_request.rs— Renamed testshould_not_return_the_compact_response_by_default→should_return_the_compact_response_by_default. Flipped assertion. Removedcode-reviewcomment.packages/axum-http-server/tests/server/asserts.rs— Updatedassert_is_announce_responsehelper to accept both compact and normal formats.Verification
axum-http-serverpackagelinter allexits with code 0compactparam → compact responsecompact=1→ compact responsecompact=0→ dictionary responseCloses #1986