Skip to content

Resolve tester feedback: live /nodes metadata, protocol selection, +1d grace docs#16

Open
Sentinel-Bluebuilder wants to merge 1 commit into
masterfrom
fix/tester-feedback-protocol-nodes-metadata
Open

Resolve tester feedback: live /nodes metadata, protocol selection, +1d grace docs#16
Sentinel-Bluebuilder wants to merge 1 commit into
masterfrom
fix/tester-feedback-protocol-nodes-metadata

Conversation

@Sentinel-Bluebuilder

Copy link
Copy Markdown
Owner

Resolves the issues + recommendations from the x402 Sentinel dVPN end-to-end test report (2026-06-22, RESULT: PASS).

Issue #1/nodes returned empty metadata in production

The live endpoint reported online: 0, protocol: null for all 726 nodes, and byCountry: {}. Traced to 4 compounding bugs in the node status probe (server/src/sentinel.ts):

Bug Fix
new URL("host:port") threw / misparsed bare addresses new normalizeRemoteAddrToUrl() helper (mirrors the SDK's resolveNodeUrl)
probed /status → 404 on v3 nodes probe the v3 root path /
read numeric status.type for protocol (v3 uses a string) read service_type string
read status.max_peers read qos.max_peers

Now probes all remote_addrs (first reachable wins) and surfaces real address, online, protocol, country, city, moniker, peers, maxPeers, version, lastSeen per node, with byCountry and byProtocol summaries.

Issue #2 — protocol mismatch (v2ray instructions on a WireGuard node)

Implemented protocol selection end-to-end:

  • request body protocol: "v2ray" | "wireguard" pins the tunnel type
  • pre-payment validation (INVALID_PROTOCOL / PROTOCOL_UNAVAILABLE) so no USDC is spent on a guaranteed-fail request
  • node matching honors the requested protocol
  • 200 response returns the node's actual nodeProtocol + full node metadata
  • instructions are generated from the selected node's real protocol
  • GET /nodes gains ?protocol= and ?country= filters

Issue #7 — 1-day grant granting ~48h

Confirmed intentional: the +1 day is a deliberate fee-grant grace buffer so the grant outlives the paid window (a session started at the very end can still pay gas). Now documented and surfaced as a distinct expiresAtPaid alongside expiresAt.

Docs (recs #5 / #6)

  • docs/llms.txt: added a no-root V2Ray worked example and a Linux WireGuard full-tunnel example using the splitIPs: ["0.0.0.0/0", "::/0"] workaround.
  • docs/index.html: mirrored the new request/response fields and /nodes filters in the JSON-LD spec.

Not in this PR

  • Issue WIP #3 / rec WIP #4 (blue-js-sdk duplicate WireGuard interface on Linux full-tunnel) is an SDK-side fix and lands as a separate PR against blue-js-sdk.

⚠️ Deploy note

The /manifest + provisioning changes are server code and require an operator Docker redeploy to take effect on x402.sentinel.co. The docs/ changes go live on the next GitHub Pages publish.

…d grace docs

Addresses the x402 dVPN end-to-end test report (2026-06-22).

Issue #1 — /nodes returned empty metadata in production (online: 0,
protocol: null, byCountry: {}). Root cause was 4 compounding bugs in the
node status probe (server/src/sentinel.ts):
  - new URL() on a bare host:port threw / misparsed -> normalizeRemoteAddrToUrl()
  - probed /status (404) instead of the v3 root path /
  - read numeric status.type instead of v3 string service_type for protocol
  - read status.max_peers instead of qos.max_peers
Now probes all remote_addrs (first reachable wins) and surfaces real
address, online, protocol, country, city, moniker, peers, maxPeers,
version and lastSeen per node, with byCountry + byProtocol summaries.

Issue #2 — provisioning could instruct a protocol the selected node did
not speak (v2ray instructions on a WireGuard node). Implemented protocol
selection end-to-end:
  - request body `protocol: "v2ray" | "wireguard"` pinned before payment
  - pre-payment validation (INVALID_PROTOCOL / PROTOCOL_UNAVAILABLE) so no
    USDC is spent on a guaranteed-fail request
  - node matching honors the requested protocol
  - 200 response returns the node's ACTUAL nodeProtocol + full node metadata
  - instructions are generated from the selected node's real protocol
  - GET /nodes gains ?protocol= and ?country= filters

Issue #7 — clarified the 1-day-grant-grants-~48h behavior: the +1 day is a
deliberate fee-grant grace buffer (the grant must outlive the paid window so
a session started at the very end can still pay gas). Documented and now
surfaced as a distinct expiresAtPaid alongside expiresAt.

Docs (recs #5/#6): added a no-root V2Ray worked example and a Linux
WireGuard full-tunnel example using the splitIPs: ["0.0.0.0/0","::/0"]
workaround in docs/llms.txt; mirrored the new request/response fields and
/nodes filters in docs/index.html JSON-LD.

NOTE: the /manifest + provisioning changes are server code and require an
operator Docker redeploy to take effect on x402.sentinel.co; the docs/
changes go live on the next GitHub Pages publish.
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.

1 participant