upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/relay/btfrv.cpp
AgeCommit message (Collapse)Author
2026-08-02rendezvous: let a node park more than one registration (#113)Bitflash
A registration was consumed by the first caller and registering again replaced the previous one, so a node was reachable to one peer at a time and unreachable for the gap between being paired and registering again. Measured on a live node: descriptors resolved 53/54, our own registrations paired 11/12, nothing paired and went silent -- and half of every outbound dial failed, 15 of 30 in eleven minutes. The relay keeps a queue per pubkey capped at four, pairs with the oldest still-alive registration and discards the dead; the node runs three accept threads, each holding its own registration. The wire protocol does not change, so either side can be deployed first. Bench with both relays built from source and waves of concurrent dialers: old+1 65%, new+1 58%, old+3 68%, new+3 98%. Each half alone lands within noise of doing nothing.
2026-07-31relay: drop registrations whose far end is gone (#65)Bitflash
A service registers at the relay and its socket sits in the waiting map until a client dials it. Nothing ever checked whether that service was still there. A node that went away left its registration behind, and the next client to ask for that key got paired with a corpse: both sides were told the pairing succeeded, then the tunnel failed with nothing to explain it. That is the "tunnel to X failed" line the dialling node reports. A reaper walks the waiting map every 60 seconds and drops registrations whose far end is provably gone, and the pairing path checks the same thing before handing a registration over, so a client gets a clean refusal instead of a broken tunnel. Provably gone means: the socket became readable and recv returned 0 or an error. A registered service sends nothing while it waits, so readable is already abnormal; recv distinguishes a closed peer from anything else. Sockets that are simply idle are left alone. select() rather than MSG_DONTWAIT so this compiles on Windows and never touches the socket's blocking mode. Deliberately no expiry by age. Nodes older than v1.2.7 register once and block forever waiting to be dialled -- they never re-register, so a clock based rule would quietly make every one of them unreachable, and being blocked in recv they would never find out. Only provable death counts. Known limit: this catches a peer that closed or reset, not one whose path died silently with no FIN. Detecting that needs a probe, and there is no byte the relay can send to a waiting service without corrupting the protocol it is waiting on. Verified on the VPS on a spare port: a node registered, was killed with SIGKILL, and the next reaper pass logged "reaper: dropped 1 dead registration(s), 0 waiting".
2026-07-24Bitflash: fair-launch releaseBitflash-sh
Satoshi's bitcoin-0.1.0 reborn with RandomX CPU proof of work, anonymous .btf addressing over Nostr with CGNAT rendezvous, automatic peer discovery, a headless Linux node, and Windows GUI wallet. Fair launch, no premine, 21M cap.