{"id":"XE-13285","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"430","source_url":"https://github.com/xeprotocol/xe/issues/430","reporter_id":2483,"title":"[net/netcheck.go] L14: verifyPeer() tidak handle timeout pada stream creation — blocking resource","area":"p2p-sync","claimed_tier":null,"assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:07.312961+00:00","updated_at":"2026-11-20T00:38:12.919555+00:00","source_created_at":"2026-11-12T02:50:12+00:00","told_at":"2026-11-20T00:34:55+00:00","status_changed_at":"2026-11-20T00:33:19.114640+00:00","url":"https://bounty.xe.network/XE-13285","body":"## Ringkasan\n`verifyPeer` pakai `netcheckTimeout = 5 * time.Second` untuk stream, tapi kalau stream creation gagal karena timeout, error hanya di-log dan peer di-close. Tidak ada retry.\n\n## Lokasi\n- File: `net/netcheck.go`\n- Lines: 418-471\n\n## Kode\n```go\nfunc (g *NetworkGater) verifyPeer(ctx context.Context, pid peer.ID) {\n    ...\n    s, err := g.h.NewStream(ctx, pid, NetcheckProtocolID)\n    if err != nil {\n        logging.Debugf(\"netcheck: failed to open stream to %s: %v\", pid, err)\n        _ = g.h.Network().ClosePeer(pid)\n        return\n    }\n    defer s.Close()\n    ...\n}\n```\n\n## Impact\nPeer yang gagal verify hanya di-close sekali. Kalau peer tersebut later connect lagi, tidak ada retry mechanism.\n\n## Suggested Fix\n```go\nfunc (g *NetworkGater) verifyPeer(ctx context.Context, pid peer.ID) {\n    ...\n    var lastErr error\n    for i := 0; i < 3; i++ {\n        s, err := g.h.NewStream(ctx, pid, NetcheckProtocolID)\n        if err == nil {\n            defer s.Close()\n            ...\n            return\n        }\n        lastErr = err\n        logging.Debugf(\"netcheck: failed to open stream to %s (attempt %d): %v\", pid, i+1, err)\n        time.Sleep(time.Second * time.Duration(i+1))\n    }\n    logging.Warnf(\"netcheck: failed to verify %s after 3 attempts: %v\", pid, lastErr)\n    _ = g.h.Network().ClosePeer(pid)\n}\n```","patch_refs":[],"thread":[{"id":13225,"source":"github","source_ref":"7026488877","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-13285 and says what differs; it is read like any other.","created_at":"2026-11-20T00:34:55+00:00"}]}