Skip to content

Sync with SagerNet/sing-box upstream (sagernet/testing) - #34

Open
hiddifydeveloper wants to merge 91 commits into
hiddify:v5from
hiddifydeveloper:v5-sagernet-sync
Open

Sync with SagerNet/sing-box upstream (sagernet/testing)#34
hiddifydeveloper wants to merge 91 commits into
hiddify:v5from
hiddifydeveloper:v5-sagernet-sync

Conversation

@hiddifydeveloper

Copy link
Copy Markdown

Summary

  • Merges ~89 upstream commits from sagernet/testing since the last sync point (1dc887264).
  • Brings in: JSON schema support, new DNS rule "evaluate" action, flow-dispatcher-based tun.Port/DirectRoute API, USBIP/OpenVPN/OpenConnect protocols, WARP/MASQUE improvements, and various upstream fixes.
  • All hiddify-specific (//H-tagged) additions preserved throughout conflict resolution.

Notable follow-ups beyond textual conflicts

  • adapter.DNSTransport/DNSClient gained ExchangeAsync; added sync-to-async wrappers to hiddify's multi/sdns DNS transports and test fakes.
  • option.DialerOptions/DNSRouteActionOptions restructured fields under Abstract*Options embeds; fixed call sites in transport/awg, protocol/wireguard, and test literals.
  • protocol/group/balancer's sticky session used a freelru API (NewSharded) not present in the pinned sagernet/sing version; ported to the unified freelru.New(..., sharded=true) constructor.
  • Added filippo.io/age dependency and ported the "age support for report export" commit to experimental/libbox/log.go (auto-merge had silently dropped it since it landed after this fork's last sync point).
  • transport/wireguard/endpoint.go's UDP egress-pool feature is disabled: hiddify's wireguard-go fork (replace/wireguard-go) has not been rebased onto sagernet/wireguard-go@6f5e8b1 ("Add EgressProvider") yet. Left a TODO comment; needs that fork updated separately as a follow-up.
  • option/v2ray_transport.go's new DescribeSchema doesn't list a UnionVariant for XHTTP transport (hiddify-specific), even though marshal/unmarshal code handles it — schema generation may need a follow-up.

Test plan

  • go build ./... — clean
  • go vet ./... — identical to pre-sync baseline (same 4 pre-existing build-tagged test-only failures: common/geosite, common/tlsspoof, dns/transport/local, protocol/masque — all unrelated, confirmed present before this sync too)
  • go test ./dns/... — pass
  • go test ./... — pass except the same 4 baseline packages + Docker-dependent integration tests (no Docker daemon in this environment)
  • go test -tags with_quic -run TestTrustTunnel ./... (in test/) — TestTrustTunnelSelf and TestTrustTunnelQUICSelf both PASS

nekohasekai and others added 30 commits July 21, 2026 13:08
Since b0c6762, every rule inside a referenced rule-set was evaluated
as if merged into the outer rule, which required tracking per-branch
group states and let outer rules and rule-set rules satisfy each
other's grouped conditions in both directions.

Restrict merging to the only designed case: a rule-set containing
exactly one non-inverted default rule is merged into the outer rule as
before. Any other rule-set now matches as an ordinary condition of the
outer rule: it matches when any of its rules matches on its own, and
its rules no longer exchange grouped match state with the outer rule
in either direction. Multiple referenced rule-sets keep OR semantics.

Flat address rule-sets such as generated geosite/geoip sets contain a
single default rule, so their behavior is unchanged. The group-state
set machinery is replaced by a single required/satisfied mask pair.

Also update the route and DNS rule docs.
DHCP option 119/15 and resolved link domains are not rooted, so appending
them to the query name produced a non-FQDN name, failing to pack with
"domain must be fully qualified".
Merges ~89 upstream commits since the last sync point (1dc8872),
bringing in: JSON schema support, new DNS rule "evaluate" action,
flow-dispatcher-based tun.Port/DirectRoute API, USBIP/OpenVPN/
OpenConnect protocols, WARP/MASQUE improvements, and various fixes.

Conflict resolution kept all hiddify-specific (//H-tagged) additions
alongside upstream's changes. Notable follow-ups needed beyond textual
conflicts:
- adapter.DNSTransport/DNSClient gained ExchangeAsync; added sync-to-
  async wrappers to hiddify's multi/sdns DNS transports and test fakes.
- option.DialerOptions/DNSRouteActionOptions restructured fields under
  Abstract*Options embeds; fixed call sites in transport/awg,
  protocol/wireguard, and test literals.
- protocol/group/balancer's sticky session used a freelru API
  (NewSharded) not present in the pinned sagernet/sing version; ported
  to the unified freelru.New(..., sharded=true) constructor.
- Added filippo.io/age dependency and ported the "age support for
  report export" commit to experimental/libbox/log.go (auto-merge had
  dropped it since it landed after this fork's last sync).
- transport/wireguard/endpoint.go's UDP egress-pool feature
  (StdNetBind.SetEgressProvider/SetSinglePeerMode) is disabled: hiddify's
  wireguard-go fork (replace/wireguard-go) has not been rebased onto
  SagerNet/wireguard-go@6f5e8b1 ("Add EgressProvider") yet. Left a TODO;
  needs that fork updated separately.
- option/v2ray_transport.go's new DescribeSchema doesn't list a
  UnionVariant for XHTTP transport (hiddify-specific), even though the
  marshal/unmarshal code handles it — schema generation may need a
  follow-up.

Verified: go build ./... and go vet ./... clean (same 4 pre-existing
build-tagged test packages fail as on pre-sync baseline: common/geosite,
common/tlsspoof, dns/transport/local, protocol/masque — unrelated).
dns package tests pass. TestTrustTunnelSelf and TestTrustTunnelQUICSelf
(-tags with_quic) both pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants