{
 "number": 36717,
 "input_hash": "d072e0efe072c848",
 "model": "ledger",
 "prompt_hash": null,
 "created": "2026-11-02T01:10:18+00:00",
 "result": {
  "summary": "Rejects node startup with an initialization error if -port=65535 and the onion service bind port must be derived from it. The node now checks that default_bind_port is below UINT16_MAX before computing the default onion port, while continuing to allow -port=65535 when an explicit onion port is specified or when listening is disabled.",
  "problem": "Bitcoin Core derives the default Tor onion service bind port by adding 1 to -port. When -port is set to 65535, the uint16_t addition wraps to 0, causing the node to bind 127.0.0.1 on an arbitrary OS-assigned ephemeral port and point the automatic Tor onion service there.",
  "card": "Bitcoin Core calculates the default Tor onion service bind port as -port + 1. When -port is set to 65535, the uint16_t addition wraps to 0, causing the node to bind 127.0.0.1 to an arbitrary OS-assigned ephemeral port for its automatic onion service. This change fails initialization with a descriptive error when -port=65535 and an onion port needs to be derived. Explicit onion bind configurations (-bind=<addr>:<port>=onion) and disabled listening (-listen=0) continue to work.",
  "evidence": [
   "Commit message and description explain the integer overflow: 'The default onion bind uses -port + 1. With -port=65535 this wraps to 0, so the node binds 127.0.0.1 to a random port and the automatic onion service points there.'"
  ],
  "scope_notes": "",
  "changed_since_previous": "Diff is now available; the implementation and functional test coverage match the earlier description.",
  "thread": {
   "last_event_at": null,
   "events": 0,
   "head_sha": "8ce077866d387370ad8de56f19f04938eb018440",
   "schema_floor": 2,
   "schema": 2
  },
  "waiting_on": [],
  "risk": {
   "level": "low",
   "touches": [
    "p2p"
   ],
   "why": "A flaw would cause node initialization to fail incorrectly on valid port configuration arguments."
  },
  "discussion": {
   "author_status": "no discussion",
   "open_concerns": [],
   "resolved_concerns": []
  },
  "reviewability": {
   "state": "Ready",
   "label": "Ready",
   "reason": "Nothing known that would invalidate a review now."
  },
  "agreement": {
   "state": "Crickets",
   "summary": "Crickets: no substantive comment either way",
   "reason": "Derived from the claims and support below; every entry links to the statement it came from.",
   "evidence": [],
   "objections": [],
   "support": [],
   "participants": [],
   "derivation": "no substantive comment either way",
   "model_state": null,
   "corrections": [],
   "notes": null
  },
  "dependencies": {
   "depends_on": [],
   "enables": []
  },
  "categories": [
   {
    "name": "utils",
    "member": true,
    "evidence": "Touches startup validation in src/init.cpp for node argument initialization and default port configuration.",
    "band": "P3",
    "reason_tag": "bug fix",
    "score": 0.35,
    "factors": {
     "bug_severity": 1,
     "leverage": 0,
     "performance": 0,
     "security_stability": 1,
     "user_value": 1
    },
    "rationale": "Prevents integer overflow on startup when calculating the default Tor onion port from -port=65535. When port 65535 is used without an explicit onion port, adding 1 wraps uint16_t to 0, causing the node to unintentionally bind to an arbitrary OS-assigned ephemeral port."
   }
  ],
  "confidence": "high",
  "uncertainties": [],
  "needs": []
 },
 "cost_usd": 0.0,
 "source": {
  "record": "2026-11-02T01:10:18+00:00",
  "code": "2026-11-02T01:14:57+00:00",
  "judgments": 1
 }
}