upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index 37f335e..59a8028 100644
--- a/src/net.h
+++ b/src/net.h
@@ -54,6 +54,12 @@ static const int64 PEX_MIN_INTERVAL = 60;
54// traffic is nothing: one per relay per five minutes. 54// traffic is nothing: one per relay per five minutes.
55static const int BTF_RENDEZVOUS_WAIT_SECS = 300; 55static const int BTF_RENDEZVOUS_WAIT_SECS = 300;
56 56
57// Registrations this node parks at a rendezvous at once. One is what the
58// protocol needs; more is what keeps the node reachable while one of them is
59// being paired, since pairing consumes the registration it used. Four matches
60// the relay's ceiling per node.
61static const int BTF_ACCEPT_THREADS = 3;
62
57// Liveness of an established peer connection. BTF_RENDEZVOUS_WAIT_SECS bounds 63// Liveness of an established peer connection. BTF_RENDEZVOUS_WAIT_SECS bounds
58// the wait for a dial to arrive; these bound the connection that comes out of 64// the wait for a dial to arrive; these bound the connection that comes out of
59// it, which has the same failure mode once it goes quiet. 65// it, which has the same failure mode once it goes quiet.
@@ -139,6 +145,18 @@ extern int nBestHeight;
139// absurd height cannot move it. 145// absurd height cannot move it.
140int GetPeerMedianHeight(); 146int GetPeerMedianHeight();
141 147
148// Lightweight .btf churn accounting. These counters are diagnostics only: they
149// let an operator tell stale descriptors, relay pairing failures, and paired
150// tunnels that never speak apart before changing behaviour.
151void BtfChurnNoteResolveAttempt();
152void BtfChurnNoteResolveResult(bool fOk);
153void BtfChurnNoteDialAttempt(const string& strBtfAddr, const string& strMeeting);
154void BtfChurnNoteDialResult(const string& strBtfAddr, const string& strMeeting, bool fOk);
155void BtfChurnNoteRegisterResult(const string& strMeeting, bool fOk);
156void BtfChurnNotePairResult(const string& strMeeting, bool fOk);
157void BtfChurnNoteHandshakeTimeout(const string& strBtfAddr, const string& strMeeting,
158 bool fRecv, bool fSend);
159
142// Descriptors to hand a peer: ours first, then peers that answered us. 160// Descriptors to hand a peer: ours first, then peers that answered us.
143void BtfPexCollect(std::vector<std::string>& vDescOut); 161void BtfPexCollect(std::vector<std::string>& vDescOut);
144// Verify descriptors a peer sent and remember the good ones. Returns how many. 162// Verify descriptors a peer sent and remember the good ones. Returns how many.
@@ -606,6 +624,8 @@ public:
606 int64 nIncompleteMessageStart; 624 int64 nIncompleteMessageStart;
607 unsigned int nIncompleteMessageSize; 625 unsigned int nIncompleteMessageSize;
608 string strIncompleteMessageCommand; 626 string strIncompleteMessageCommand;
627 string strBtfAddr;
628 string strBtfMeeting;
609 629
610 // Height this peer announced in its version message, or -1 if it sent a 630 // Height this peer announced in its version message, or -1 if it sent a
611 // version message that predates the field. Knowing how far along everyone 631 // version message that predates the field. Knowing how far along everyone
@@ -639,6 +659,8 @@ public:
639 nIncompleteMessageStart = 0; 659 nIncompleteMessageStart = 0;
640 nIncompleteMessageSize = 0; 660 nIncompleteMessageSize = 0;
641 strIncompleteMessageCommand.clear(); 661 strIncompleteMessageCommand.clear();
662 strBtfAddr.clear();
663 strBtfMeeting.clear();
642 nStartingHeight = -1; 664 nStartingHeight = -1;
643 vfSubscribe.assign(256, false); 665 vfSubscribe.assign(256, false);
644 666