Repository navigation
feat(1671): add client address labels and ipv6_v6only config option - #1928
Conversation
…arate socket bindings
- Clarify that fingerprint is arithmetic mixing, not cryptographic MAC - Document scope of gen_remote_fingerprint (full SocketAddr) - Quantify probability of successful forgery (~1 in 4M per guess) - Add test for cross-client cookie rejection with realistic addresses
…g option - Add ADR documenting the decision to use a config toggle - Update ISSUE.md spec with Task 3 (config option) - Add research-dual-stack-portability.md with cross-platform analysis - Add dictionary words for new technical terminology
- Add ipv6_v6only bool field to UdpTracker and HttpTracker (default false) - Conditionally set IPV6_V6ONLY socket option only when config is true - Update experiment config and examples with new field - Add client address labels to per-request metric counters
fefac46 to
2efd3d4
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #1928 +/- ##
===========================================
+ Coverage 79.31% 79.42% +0.10%
===========================================
Files 324 324
Lines 22963 23116 +153
Branches 22963 23116 +153
===========================================
+ Hits 18214 18360 +146
+ Misses 4486 4479 -7
- Partials 263 277 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Verifies that a UDP tracker configured with ipv6_v6only=true on an IPv6 socket accepts native IPv6 client connections.
…socket Verifies that an HTTP tracker configured with ipv6_v6only=true on an IPv6 socket accepts native IPv6 client connections.
There was a problem hiding this comment.
Pull request overview
Implements #1671 by extending tracker request metrics with client IP family/type labels and introducing an ipv6_v6only configuration option to control IPv6 socket binding behavior (to support separate IPv4/IPv6 sockets on the same port), alongside docs/ADR updates and test coverage.
Changes:
- Add
client_address_ip_family(inet/inet6) andclient_address_ip_type(plain/v4_mapped_v6) labels viaConnectionContext→LabelSetacross UDP server/core and HTTP core. - Add
ipv6_v6only: boolto UDP/HTTP tracker config and plumb it into UDP/TCP socket creation viasocket2. - Add/extend integration tests, unit tests, experiments, and documentation (issue spec, research doc, ADR, cspell dictionary).
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| src/bootstrap/jobs/http_tracker.rs | Passes ipv6_v6only into the HTTP server launcher. |
| project-words.txt | Adds networking/OS terms to cspell dictionary. |
| packages/udp-server/tests/server/contract.rs | Adds UDP integration test covering ipv6_v6only on IPv6 binds. |
| packages/udp-server/src/server/launcher.rs | Wires ipv6_v6only into UDP socket construction. |
| packages/udp-server/src/server/bound_socket.rs | Switches UDP socket binding to socket2 to support IPV6_V6ONLY. |
| packages/udp-server/src/event.rs | Adds client address labels to UDP server event label set. |
| packages/udp-server/examples/udp_only_public_tracker.rs | Updates example config with new ipv6_v6only field. |
| packages/udp-server/Cargo.toml | Adds socket2 dependency for UDP server. |
| packages/udp-core/src/event.rs | Adds client address label helpers + unit tests for label derivation. |
| packages/udp-core/src/connection_cookie.rs | Expands cookie/fingerprint security documentation and adds a realism-focused rejection test. |
| packages/test-helpers/src/configuration.rs | Updates ephemeral test config to include ipv6_v6only. |
| packages/http-core/src/event.rs | Adds client address labels to HTTP core event label set + unit tests. |
| packages/configuration/src/v2_0_0/udp_tracker.rs | Adds ipv6_v6only to UDP tracker config schema. |
| packages/configuration/src/v2_0_0/http_tracker.rs | Adds ipv6_v6only to HTTP tracker config schema. |
| packages/axum-http-server/tests/server/v1/contract.rs | Adds HTTP integration test covering ipv6_v6only on IPv6 binds. |
| packages/axum-http-server/src/testing/environment.rs | Plumbs ipv6_v6only into test server launcher creation. |
| packages/axum-http-server/src/server.rs | Switches TCP listener creation to socket2 to support IPV6_V6ONLY. |
| packages/axum-http-server/examples/http_only_public_tracker.rs | Updates example config with new ipv6_v6only field. |
| packages/axum-http-server/Cargo.toml | Adds socket2 dependency for HTTP server. |
| docs/issues/open/1671-ipv4-ipv6-client-metrics/research-dual-stack-portability.md | Adds cross-platform research on IPV6_V6ONLY defaults and implications. |
| docs/issues/open/1671-ipv4-ipv6-client-metrics/ISSUE.md | Adds issue spec document (scope, plan, acceptance criteria, verification). |
| docs/adrs/index.md | Adds ADR index entry for the ipv6_v6only decision. |
| docs/adrs/20260620000000_add_ipv6_v6only_config_option.md | New ADR documenting why ipv6_v6only is configurable and defaults remain unchanged. |
| contrib/dev-tools/experiments/dual-stack-sockets/README.md | New experiment doc showing dual-bind feasibility and metrics label validation. |
| contrib/dev-tools/experiments/dual-stack-sockets/config/tracker.dual-stack.toml | Adds experiment config using two sockets per protocol and ipv6_v6only. |
| Cargo.lock | Records dependency resolution updates (includes socket2). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix project-words.txt alphabetical order - Update issue spec paths and Task 1 scope - Correct OpenBSD platform note (no-op, not runtime error) - Fix typo in bound_socket.rs
- Fix OpenBSD notes in research doc (no-op, not runtime error) - Remove stale "next steps" from experiment README (config option implemented)
…Y behaviour Add platform table to create_socket/create_tcp_listener docs explaining how each OS handles IPV6_V6ONLY by default. Only call set_only_v6 when ipv6_v6only is true (avoids EINVAL on OpenBSD).
|
ACK 50da16b |
Description
Implements #1671 — IPv4/IPv6 client metrics: support per-client IP family labels and separate socket bindings.
Changes
Task 1 — Investigate separate socket bindings:
contrib/dev-tools/experiments/dual-stack-sockets/)IPV6_V6ONLY=1viasocket2allows0.0.0.0:<port>+[::]:<port>on same portTask 2 — Client address labels (primary fix for prometheus metrics):
client_address_ip_familylabel (inet/inet6) to all per-request metric countersclient_address_ip_typelabel (plain/v4_mapped_v6) to all per-request metric countersConnectionContexttypesTask 3 —
ipv6_v6onlyconfig option:ipv6_v6only: boolfield toUdpTrackerandHttpTrackerconfig structs (defaultfalse, preserving dual-stack behaviour)IPV6_V6ONLYsocket option only when config istrueAlso added:
docs/adrs/20260620000000_add_ipv6_v6only_config_option.mdChecklist
linter allpassesipv6_v6onlyconfig propagation (both UDP and HTTP)Related
docs/adrs/20260620000000_add_ipv6_v6only_config_option.mddocs/issues/open/1671-ipv4-ipv6-client-metrics/ISSUE.md