@serfab/cadre-core 1.6.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/README.md +8 -6
  2. package/dist/cadre-node.d.ts +548 -137
  3. package/dist/cadre-node.js +1208 -383
  4. package/dist/cadre-node.js.map +1 -1
  5. package/dist/control-authorization.d.ts +2 -2
  6. package/dist/control-authorization.js +1 -0
  7. package/dist/control-authorization.js.map +1 -1
  8. package/dist/control-cohort.d.ts +6 -0
  9. package/dist/control-cohort.js +6 -0
  10. package/dist/control-cohort.js.map +1 -1
  11. package/dist/control-database.d.ts +46 -8
  12. package/dist/control-database.js +97 -18
  13. package/dist/control-database.js.map +1 -1
  14. package/dist/control-formation-recorder.d.ts +37 -14
  15. package/dist/control-formation-recorder.js +60 -10
  16. package/dist/control-formation-recorder.js.map +1 -1
  17. package/dist/control-read-retry.d.ts +13 -12
  18. package/dist/control-read-retry.js +14 -12
  19. package/dist/control-read-retry.js.map +1 -1
  20. package/dist/control-schema.d.ts +1 -1
  21. package/dist/control-schema.js +67 -5
  22. package/dist/control-schema.js.map +1 -1
  23. package/dist/control-stream.d.ts +9 -1
  24. package/dist/control-stream.js +24 -1
  25. package/dist/control-stream.js.map +1 -1
  26. package/dist/control-write-retry.d.ts +12 -2
  27. package/dist/control-write-retry.js +13 -2
  28. package/dist/control-write-retry.js.map +1 -1
  29. package/dist/delegate-admission.d.ts +11 -8
  30. package/dist/delegate-admission.js +19 -11
  31. package/dist/delegate-admission.js.map +1 -1
  32. package/dist/diagnostics/connection-path.d.ts +0 -7
  33. package/dist/diagnostics/connection-path.js +0 -7
  34. package/dist/diagnostics/connection-path.js.map +1 -1
  35. package/dist/formation-approval.d.ts +7 -0
  36. package/dist/formation-approval.js +9 -3
  37. package/dist/formation-approval.js.map +1 -1
  38. package/dist/fs-atomic.d.ts +11 -2
  39. package/dist/fs-atomic.js +13 -3
  40. package/dist/fs-atomic.js.map +1 -1
  41. package/dist/hibernation-manager.d.ts +111 -8
  42. package/dist/hibernation-manager.js +234 -49
  43. package/dist/hibernation-manager.js.map +1 -1
  44. package/dist/index.d.ts +13 -6
  45. package/dist/index.js +27 -5
  46. package/dist/index.js.map +1 -1
  47. package/dist/joined-strand-store.d.ts +177 -0
  48. package/dist/joined-strand-store.js +431 -0
  49. package/dist/joined-strand-store.js.map +1 -0
  50. package/dist/key-store-file.js +14 -5
  51. package/dist/key-store-file.js.map +1 -1
  52. package/dist/key-store.d.ts +6 -0
  53. package/dist/key-store.js.map +1 -1
  54. package/dist/link-budget.d.ts +367 -69
  55. package/dist/link-budget.js +375 -72
  56. package/dist/link-budget.js.map +1 -1
  57. package/dist/membership-connection-gater.d.ts +30 -43
  58. package/dist/membership-connection-gater.js +31 -42
  59. package/dist/membership-connection-gater.js.map +1 -1
  60. package/dist/node-local-snapshot.d.ts +5 -4
  61. package/dist/node-local-snapshot.js +6 -3
  62. package/dist/node-local-snapshot.js.map +1 -1
  63. package/dist/peer-dial.d.ts +24 -4
  64. package/dist/peer-dial.js +74 -5
  65. package/dist/peer-dial.js.map +1 -1
  66. package/dist/peer-join-backfill.d.ts +35 -15
  67. package/dist/peer-join-backfill.js +115 -55
  68. package/dist/peer-join-backfill.js.map +1 -1
  69. package/dist/push-fanout.d.ts +6 -0
  70. package/dist/push-fanout.js +6 -0
  71. package/dist/push-fanout.js.map +1 -1
  72. package/dist/relay-reservation.d.ts +3 -1
  73. package/dist/relay-reservation.js +3 -1
  74. package/dist/relay-reservation.js.map +1 -1
  75. package/dist/relay-server.d.ts +79 -0
  76. package/dist/relay-server.js +74 -0
  77. package/dist/relay-server.js.map +1 -0
  78. package/dist/seed-bootstrap.d.ts +57 -4
  79. package/dist/seed-bootstrap.js +107 -83
  80. package/dist/seed-bootstrap.js.map +1 -1
  81. package/dist/storage-scope.d.ts +33 -17
  82. package/dist/storage-scope.js +44 -23
  83. package/dist/storage-scope.js.map +1 -1
  84. package/dist/strand-addr-protocol.d.ts +58 -21
  85. package/dist/strand-addr-protocol.js +133 -85
  86. package/dist/strand-addr-protocol.js.map +1 -1
  87. package/dist/strand-database.d.ts +20 -2
  88. package/dist/strand-database.js +42 -5
  89. package/dist/strand-database.js.map +1 -1
  90. package/dist/strand-first-sync-gate.d.ts +59 -21
  91. package/dist/strand-first-sync-gate.js +58 -19
  92. package/dist/strand-first-sync-gate.js.map +1 -1
  93. package/dist/strand-formation-deadlines.d.ts +151 -0
  94. package/dist/strand-formation-deadlines.js +171 -0
  95. package/dist/strand-formation-deadlines.js.map +1 -0
  96. package/dist/strand-formation-manager.d.ts +63 -30
  97. package/dist/strand-formation-manager.js +67 -41
  98. package/dist/strand-formation-manager.js.map +1 -1
  99. package/dist/strand-formation-protocol.d.ts +45 -35
  100. package/dist/strand-formation-protocol.js +59 -122
  101. package/dist/strand-formation-protocol.js.map +1 -1
  102. package/dist/strand-instance-manager.d.ts +152 -6
  103. package/dist/strand-instance-manager.js +331 -42
  104. package/dist/strand-instance-manager.js.map +1 -1
  105. package/dist/strand-membership-writer.d.ts +6 -0
  106. package/dist/strand-membership-writer.js +11 -0
  107. package/dist/strand-membership-writer.js.map +1 -1
  108. package/dist/strand-peer-book-file.d.ts +12 -0
  109. package/dist/strand-peer-book-file.js +37 -0
  110. package/dist/strand-peer-book-file.js.map +1 -0
  111. package/dist/strand-peer-book-protocol.d.ts +168 -0
  112. package/dist/strand-peer-book-protocol.js +356 -0
  113. package/dist/strand-peer-book-protocol.js.map +1 -0
  114. package/dist/strand-peer-book-swap.d.ts +104 -0
  115. package/dist/strand-peer-book-swap.js +284 -0
  116. package/dist/strand-peer-book-swap.js.map +1 -0
  117. package/dist/strand-peer-book.d.ts +159 -0
  118. package/dist/strand-peer-book.js +361 -0
  119. package/dist/strand-peer-book.js.map +1 -0
  120. package/dist/strand-peer-observer.d.ts +88 -0
  121. package/dist/strand-peer-observer.js +180 -0
  122. package/dist/strand-peer-observer.js.map +1 -0
  123. package/dist/strand-revocation-enforcer.js +2 -1
  124. package/dist/strand-revocation-enforcer.js.map +1 -1
  125. package/dist/strand-solicitation.d.ts +36 -20
  126. package/dist/strand-solicitation.js +4 -4
  127. package/dist/strand-solicitation.js.map +1 -1
  128. package/dist/strand-wake-protocol.d.ts +80 -23
  129. package/dist/strand-wake-protocol.js +89 -64
  130. package/dist/strand-wake-protocol.js.map +1 -1
  131. package/dist/types.d.ts +181 -33
  132. package/dist/types.js +4 -3
  133. package/dist/types.js.map +1 -1
  134. package/package.json +11 -7
  135. package/src/cadre-node.ts +1316 -398
  136. package/src/control-authorization.ts +2 -1
  137. package/src/control-cohort.ts +6 -0
  138. package/src/control-database.ts +122 -18
  139. package/src/control-formation-recorder.ts +354 -305
  140. package/src/control-read-retry.ts +14 -12
  141. package/src/control-schema.ts +67 -5
  142. package/src/control-stream.ts +25 -1
  143. package/src/control-write-retry.ts +13 -2
  144. package/src/delegate-admission.ts +23 -13
  145. package/src/diagnostics/connection-path.ts +0 -7
  146. package/src/formation-approval.ts +610 -604
  147. package/src/fs-atomic.ts +14 -4
  148. package/src/hibernation-manager.ts +638 -437
  149. package/src/index.ts +91 -6
  150. package/src/joined-strand-store.ts +498 -0
  151. package/src/key-store-file.ts +14 -5
  152. package/src/key-store.ts +6 -0
  153. package/src/link-budget.ts +393 -74
  154. package/src/membership-connection-gater.ts +31 -45
  155. package/src/node-local-snapshot.ts +293 -289
  156. package/src/peer-dial.ts +81 -7
  157. package/src/peer-join-backfill.ts +120 -57
  158. package/src/push-fanout.ts +6 -0
  159. package/src/relay-reservation.ts +3 -1
  160. package/src/relay-server.ts +98 -0
  161. package/src/seed-bootstrap.ts +133 -91
  162. package/src/storage-scope.ts +44 -23
  163. package/src/strand-addr-protocol.ts +547 -458
  164. package/src/strand-database.ts +287 -242
  165. package/src/strand-first-sync-gate.ts +58 -19
  166. package/src/strand-formation-deadlines.ts +227 -0
  167. package/src/strand-formation-manager.ts +700 -647
  168. package/src/strand-formation-protocol.ts +103 -150
  169. package/src/strand-instance-manager.ts +387 -45
  170. package/src/strand-membership-writer.ts +12 -0
  171. package/src/strand-peer-book-file.ts +39 -0
  172. package/src/strand-peer-book-protocol.ts +466 -0
  173. package/src/strand-peer-book-swap.ts +338 -0
  174. package/src/strand-peer-book.ts +475 -0
  175. package/src/strand-peer-observer.ts +235 -0
  176. package/src/strand-revocation-enforcer.ts +2 -1
  177. package/src/strand-solicitation.ts +519 -500
  178. package/src/strand-wake-protocol.ts +401 -355
  179. package/src/types.ts +185 -33
@@ -8,6 +8,15 @@ import { BlockTransferClient, type IRawStorage } from '@optimystic/db-p2p';
8
8
  * changes it or starts exporting it.
9
9
  */
10
10
  export declare const MAX_BLOCK_MESSAGE_BYTES: number;
11
+ /**
12
+ * Whether an identified peer's protocol list names this network's own block-transfer
13
+ * protocol — the one gate that decides whether {@link PeerJoinBackfill} schedules a peer at
14
+ * all. A peer that lacks it (a bare circuit relay, a bootstrap node, a stranger the control
15
+ * network's inbound gate admitted without membership) cannot receive a push no matter how
16
+ * long it is dialed, since the protocol id is namespaced per network. Exported because a
17
+ * later strand peer-address ticket's identify-driven observation needs the identical test.
18
+ */
19
+ export declare function speaksBlockTransfer(protocols: readonly string[], protocolPrefix: string): boolean;
11
20
  /**
12
21
  * Consecutive failed catch-up runs against ONE peer before the module says so on
13
22
  * `console.warn` rather than only in its DEBUG log. At the default backoff that is reached
@@ -29,7 +38,8 @@ export interface PeerJoinBackfillConfig {
29
38
  maxChunkBlocks?: number;
30
39
  /**
31
40
  * Per-push dial deadline, ms. Default {@link peerJoinPushBudget}'s `dialTimeoutMs` — four link
32
- * round trips at the declared link, 14 000 ms as shipped. NOT a fixed number: a relayed dial
41
+ * round trips at the declared link plus the called machine's admission decision, 16 000 ms as
42
+ * shipped. NOT a fixed number: a relayed dial
33
43
  * costs a fixed number of exchanges, so a host on a slower link moves this (and every other
34
44
  * cadre dial budget) by declaring `NetworkConfig.linkRoundTripMs`. Naming it here still wins
35
45
  * over the derived value — `link-budget.ts` has the counts and the measurement.
@@ -109,7 +119,7 @@ export interface PeerJoinBackfillResult {
109
119
  * Best-effort throughout: nothing here throws into a libp2p event handler or into a
110
120
  * runtime bring-up; a failed chunk is logged and the run continues. A peer is marked
111
121
  * fully caught up ONLY after a run with no thrown chunk and an empty `missing` list, so
112
- * the next `connection:open` from a peer whose catch-up failed retries it.
122
+ * the next `peer:identify` from a peer whose catch-up failed retries it.
113
123
  */
114
124
  export declare class PeerJoinBackfill {
115
125
  private readonly deps;
@@ -136,30 +146,40 @@ export declare class PeerJoinBackfill {
136
146
  private readonly failures;
137
147
  /**
138
148
  * Epoch ms before which a peer's catch-up must not be re-run, set alongside a backoff timer
139
- * that will run it. Its presence is what makes `connection:open` churn free: a schedule
149
+ * that will run it. Its presence is what makes `peer:identify` churn free: a schedule
140
150
  * arriving inside the wait is dropped, rather than collapsing the backoff to the debounce.
141
151
  */
142
152
  private readonly retryAfter;
143
153
  /** Peers already reported on `console.warn`; reset when a run finally lands cleanly. */
144
154
  private readonly warned;
145
- private readonly onConnectionOpen;
155
+ private readonly onPeerIdentify;
146
156
  private loggedNoListBlockIds;
147
157
  constructor(deps: PeerJoinBackfillDeps, config?: PeerJoinBackfillConfig);
148
- /** Subscribe to connection:open AND schedule a catch-up for peers already connected. */
158
+ /**
159
+ * Subscribe to `peer:identify` AND schedule a catch-up for already-connected peers whose
160
+ * stored protocols already name this network's block-transfer protocol — a peer that does
161
+ * not speak it (a bare circuit relay, a bootstrap node) is never scheduled at all. See
162
+ * {@link speaksBlockTransfer} and the module comment.
163
+ */
149
164
  start(): void;
150
165
  /** Unsubscribe, clear timers; in-flight runs observe the stopped flag and bail. */
151
166
  stop(): void;
152
167
  /**
153
- * (Re-)schedule a debounced catch-up for every currently-connected peer not yet caught
154
- * up. Idempotent and cheap (caught-up peers are skipped before any timer is set, and a
155
- * peer whose run is in flight is deferred to the end of that run rather than dropped).
156
- * Driven by {@link start}, and — on a gated network — by the embedder whenever
157
- * membership changes, so a peer whose first pass was denied (connected before it was
158
- * authorized: the production join order) is retried without waiting for a reconnect.
159
- * Returns how many distinct peers were considered (for the start() log) — a peer holding
160
- * several connections is one peer, and is scheduled once.
168
+ * (Re-)schedule a debounced catch-up for every currently-connected peer whose protocols, as
169
+ * already stored in the libp2p peer store, name this network's block-transfer protocol. A
170
+ * peer not yet in the peer store — its identify has not finished — is left to the
171
+ * `peer:identify` handler rather than dialed blind; one whose stored protocols are known
172
+ * and lack ours is skipped outright. Idempotent and cheap otherwise (caught-up peers are
173
+ * skipped before any timer is set, and a peer whose run is in flight is deferred to the end
174
+ * of that run rather than dropped). Driven by {@link start}, and — on a gated network — by
175
+ * the embedder whenever membership changes, so a peer whose first pass was denied (connected
176
+ * before it was authorized: the production join order) is retried without waiting for a
177
+ * reconnect. Returns how many distinct peers were considered (for the start() log) — a peer
178
+ * holding several connections is one peer, and is scheduled once.
161
179
  */
162
- scheduleConnectedPeers(): number;
180
+ scheduleConnectedPeers(): Promise<number>;
181
+ /** Schedules `peerId` only if the peer store already knows it speaks this network's protocol. */
182
+ private scheduleIfKnownToSpeak;
163
183
  /** Debounced entry point for connection churn: one run per peer per settle window. */
164
184
  private schedulePeer;
165
185
  /**
@@ -173,7 +193,7 @@ export declare class PeerJoinBackfill {
173
193
  /**
174
194
  * Re-arm one peer's catch-up after a run whose push failed, on a wait that doubles
175
195
  * per consecutive failure up to `maxRetryBackoffMs`. Sets {@link retryAfter} alongside the
176
- * timer, which is what makes `connection:open` churn inside the wait free.
196
+ * timer, which is what makes `peer:identify` churn inside the wait free.
177
197
  */
178
198
  private scheduleRetryWithBackoff;
179
199
  /**
@@ -1,14 +1,25 @@
1
1
  import debug from 'debug';
2
- import { BlockTransferClient } from '@optimystic/db-p2p';
2
+ import { BlockTransferClient, buildBlockTransferProtocol } from '@optimystic/db-p2p';
3
3
  import { peerJoinPushBudget } from './link-budget.js';
4
4
  // Peer-join whole-store block catch-up, shared by the STRAND networks and the CONTROL
5
- // network. On `connection:open` (debounced) it pushes every committed, materialized block
6
- // in the local raw store to the new peer, so a machine that joined after blocks were
5
+ // network. On a new peer's `peer:identify` result — libp2p's identify protocol runs once per
6
+ // connection and reports the protocols the remote supports — naming this network's own
7
+ // block-transfer protocol, it schedules a debounced push of every committed, materialized
8
+ // block in the local raw store to that peer, so a machine that joined after blocks were
7
9
  // committed still ends up physically holding them. Optimystic has no cohort-join catch-up
8
10
  // of its own; a block committed while its writer was alone has exactly one holder forever
9
11
  // without this (named collection-header blocks are written once, at collection creation,
10
12
  // and their revision never moves again — so no later commit ever carries them anywhere).
11
13
  //
14
+ // A peer whose identify does not name the protocol — a bare circuit relay, a bootstrap node,
15
+ // or (on the control network) a stranger the inbound gate admits without membership — is
16
+ // never scheduled at all: it cannot receive anything, since the protocol id is namespaced per
17
+ // network and the dial would simply fail. Before this filter existed, such a peer WAS
18
+ // scheduled, failed every dial, and after `PEER_JOIN_BACKFILL_WARN_AFTER_FAILURES` produced a
19
+ // `console.warn` naming it — gotchoices/sereus#18 is two relay-only parties restarting and
20
+ // printing exactly that warning about their own relay, forever, on every reconnect. See
21
+ // {@link speaksBlockTransfer}.
22
+ //
12
23
  // NOTE: this copies the WHOLE local store to every newly connected peer, which is right
13
24
  // while a network is one party's handful of machines (see docs/architecture.md →
14
25
  // Replication cluster size — the control network replicates to the whole party by intent,
@@ -23,12 +34,10 @@ import { peerJoinPushBudget } from './link-budget.js';
23
34
  // Membership — the one place the two networks differ, expressed as the optional
24
35
  // `authorizePeer` dep:
25
36
  //
26
- // - STRAND networks pass none. Anything connected on a strand's own libp2p network already
27
- // receives cohort replicas of new commits, so pushing older blocks to it exposes nothing
28
- // new; adding a gate would diverge from what ordinary replication already does there. A
29
- // peer that does NOT speak the strand's block-transfer protocol (a bare circuit relay or
30
- // bootstrap node the strand node also connects to) cannot receive anything: the protocol
31
- // id is namespaced per strand, so the dial fails and the push is dropped.
37
+ // - STRAND networks pass none. Anything that speaks the strand's own block-transfer protocol
38
+ // already receives cohort replicas of new commits, so pushing older blocks to it exposes
39
+ // nothing new; adding a gate would diverge from what ordinary replication already does
40
+ // there.
32
41
  // - The CONTROL network MUST pass one, because that argument does not carry over: its
33
42
  // inbound connection gate deliberately admits non-members in several states (an
34
43
  // un-enrolled node taking its seed, an open enrollment window, an outstanding
@@ -37,8 +46,8 @@ import { peerJoinPushBudget } from './link-budget.js';
37
46
  // peer would hand a stranger the party's entire membership, addresses and strand list.
38
47
  // `CadreNode` passes `isAuthorizedMember`; the gate is consulted at PUSH time, not at
39
48
  // schedule time, and fails closed on a thrown check. A denied run is not memoized, so
40
- // the peer is retried on its next `connection:open` — or sooner, via
41
- // `scheduleConnectedPeers()` on a membership change (the production join order is
49
+ // the peer is retried on its next `peer:identify` (a reconnect re-runs identify) — or
50
+ // sooner, via `scheduleConnectedPeers()` on a membership change (the production join order is
42
51
  // connect-then-authorize, so the denial at dial time is the expected first pass).
43
52
  //
44
53
  // Both per-push deadlines are DERIVED from the declared link round trip
@@ -51,22 +60,23 @@ import { peerJoinPushBudget } from './link-budget.js';
51
60
  // `packages/integration-tests/src/scenarios/relayed-dial-cost-by-latency.integration.ts`.
52
61
  //
53
62
  // It does NOT work at every speed. Above the declared link, libp2p's own dial and
54
- // inbound-upgrade limits — derived from the same declaration — abandon the connection before
55
- // any deadline here is consulted, and the listener's one makes that failure look like an absent
56
- // peer rather than a timeout. That is also what happens when the machine being caught up
57
- // declared a FASTER link than this one, since its limit is the listener's. See
58
- // `link-budget.ts` ("libp2p's own two limits", "What still fails at the supported link").
63
+ // inbound-upgrade limits — which Optimystic derives from the same declaration — abandon the
64
+ // connection before any deadline here is consulted, and the listener's one makes that failure
65
+ // look like an absent peer rather than a timeout. That is also what happens when the machine
66
+ // being caught up declared a FASTER link than this one, since its limit is the listener's. See
67
+ // `link-budget.ts` ("Optimystic's deadlines, from the same declaration", "What still fails at
68
+ // the supported link").
59
69
  //
60
70
  // RETRY, and why it backs off. A run whose PUSH FAILED — the transport threw, which is what
61
71
  // a dial or response deadline expiring looks like here — re-arms on a doubling backoff
62
- // (`retryBackoffMs` to `maxRetryBackoffMs`), and a `connection:open` arriving while that wait
72
+ // (`retryBackoffMs` to `maxRetryBackoffMs`), and a `peer:identify` arriving while that wait
63
73
  // is outstanding is DROPPED rather than collapsing it back to the debounce. Both halves are
64
74
  // load-bearing:
65
75
  //
66
76
  // - Without the re-arm, a transient push failure over a stable connection left the peer
67
77
  // partially copied until its next reconnect (read repair still covered reads meanwhile).
68
78
  // - Without dropping churn inside the wait, a peer that cannot be reached at all is
69
- // re-dialled on every `connection:open` forever. That is not hypothetical: the 2026-09-26
79
+ // re-dialled on every `peer:identify` forever. That is not hypothetical: the 2026-09-26
70
80
  // relayed reproduction shows one peer re-opening a connection about every 14.5 s for a
71
81
  // 200-second run, each event starting a catch-up whose dial could not possibly finish.
72
82
  // The connection kept re-appearing because Optimystic's own block-transfer push path
@@ -84,13 +94,13 @@ import { peerJoinPushBudget } from './link-budget.js';
84
94
  // {@link Chunk.proofs}). Re-arming on those would re-push the WHOLE store to that peer every
85
95
  // `maxRetryBackoffMs` for as long as the node runs, and report the failure below as a link
86
96
  // budget problem when nothing about the link is wrong. All three still leave the peer
87
- // un-memoized, so its next `connection:open` retries — the behaviour that predates the
97
+ // un-memoized, so its next `peer:identify` retries — the behaviour that predates the
88
98
  // backoff, and the right one for a verdict rather than a timeout. Denial in particular is
89
99
  // re-driven on purpose by `scheduleConnectedPeers()` the moment the membership commit lands,
90
100
  // because the control network's join order is connect-then-authorize.
91
101
  //
92
102
  // A re-arm is also skipped when the peer is no longer CONNECTED. This module's trigger is
93
- // `connection:open`, so a peer that went away already has one: re-arming instead would leave
103
+ // `peer:identify`, so a peer that went away already has one: re-arming instead would leave
94
104
  // a machine dialing a peer it cannot see once a minute for the rest of its uptime.
95
105
  //
96
106
  // After `PEER_JOIN_BACKFILL_WARN_AFTER_FAILURES` consecutive failures one `console.warn`
@@ -98,16 +108,25 @@ import { peerJoinPushBudget } from './link-budget.js';
98
108
  // nothing at all: the connection simply never appears and only a DEBUG log mentions a dial
99
109
  // timeout.
100
110
  //
101
- // NOTE: a failing dial to a non-speaking peer costs one dial timeout per attempt, and is
102
- // never memoized (only clean runs are). Bounded by the backoff above plus the
103
- // unreachable-peer bail in `runCatchUp` — one dial per attempt, not one per chunk. If a node
104
- // ever holds many such connections, or the enumeration ahead of the first chunk gets
105
- // expensive, pre-check `libp2p.peerStore` for this network's block-transfer protocol before
106
- // enumerating.
111
+ // NOTE: the protocol check happens once — either when a connection's `peer:identify` fires,
112
+ // or, for a peer already connected when this instance starts, when `scheduleConnectedPeers()`
113
+ // reads its protocols back from the peer store — and is never repeated once a peer is
114
+ // scheduled. A peer that stops speaking the protocol after being scheduled (should that ever
115
+ // happen) is not de-scheduled; `runCatchUp`'s own unreachable-peer bail is what would catch
116
+ // that case instead. `peer:identify` also fires on every identify-push from a connected peer
117
+ // (address or protocol changes), which only re-enters the debounce — cheap, and dropped
118
+ // outright for caught-up peers and peers inside a backoff wait.
119
+ //
120
+ // NOTE: a same-network peer whose identify never completes on a connection (the identify
121
+ // stream times out over a slow relayed link, say) is not caught up until a later identify
122
+ // succeeds — a reconnect, an identify-push, or on the control network a membership-change
123
+ // re-drive. Accepted: every db-p2p node runs identify, and read repair still covers reads
124
+ // meanwhile; if relayed links ever routinely outlast identify's timeout, raise that timeout
125
+ // in the node builder rather than scheduling unidentified peers here.
107
126
  //
108
127
  // NOTE: a peer that disconnects INSIDE a backoff wait still costs the one attempt that wait
109
128
  // was already armed for — the connectivity check is made when the re-arm is decided, not when
110
- // the timer fires, and this module subscribes to `connection:open` only. One dial, not a
129
+ // the timer fires, and this module subscribes to `peer:identify` only. One dial, not a
111
130
  // recurring one; if a node ever holds many transient peers, subscribe to `connection:close`
112
131
  // and clear the pending timer there.
113
132
  const log = debug('sereus:cadre:peer-join-backfill');
@@ -118,6 +137,17 @@ const log = debug('sereus:cadre:peer-join-backfill');
118
137
  * changes it or starts exporting it.
119
138
  */
120
139
  export const MAX_BLOCK_MESSAGE_BYTES = 8 * 1024 * 1024;
140
+ /**
141
+ * Whether an identified peer's protocol list names this network's own block-transfer
142
+ * protocol — the one gate that decides whether {@link PeerJoinBackfill} schedules a peer at
143
+ * all. A peer that lacks it (a bare circuit relay, a bootstrap node, a stranger the control
144
+ * network's inbound gate admitted without membership) cannot receive a push no matter how
145
+ * long it is dialed, since the protocol id is namespaced per network. Exported because a
146
+ * later strand peer-address ticket's identify-driven observation needs the identical test.
147
+ */
148
+ export function speaksBlockTransfer(protocols, protocolPrefix) {
149
+ return protocols.includes(buildBlockTransferProtocol(protocolPrefix));
150
+ }
121
151
  /**
122
152
  * Consecutive failed catch-up runs against ONE peer before the module says so on
123
153
  * `console.warn` rather than only in its DEBUG log. At the default backoff that is reached
@@ -159,7 +189,7 @@ function base64WireBytes(rawBytes) {
159
189
  * Best-effort throughout: nothing here throws into a libp2p event handler or into a
160
190
  * runtime bring-up; a failed chunk is logged and the run continues. A peer is marked
161
191
  * fully caught up ONLY after a run with no thrown chunk and an empty `missing` list, so
162
- * the next `connection:open` from a peer whose catch-up failed retries it.
192
+ * the next `peer:identify` from a peer whose catch-up failed retries it.
163
193
  */
164
194
  export class PeerJoinBackfill {
165
195
  constructor(deps, config) {
@@ -185,7 +215,7 @@ export class PeerJoinBackfill {
185
215
  this.failures = new Map();
186
216
  /**
187
217
  * Epoch ms before which a peer's catch-up must not be re-run, set alongside a backoff timer
188
- * that will run it. Its presence is what makes `connection:open` churn free: a schedule
218
+ * that will run it. Its presence is what makes `peer:identify` churn free: a schedule
189
219
  * arriving inside the wait is dropped, rather than collapsing the backoff to the debounce.
190
220
  */
191
221
  this.retryAfter = new Map();
@@ -195,18 +225,30 @@ export class PeerJoinBackfill {
195
225
  this.config = { ...DEFAULT_PEER_JOIN_BACKFILL, ...config };
196
226
  this.createPushClient = deps.createPushClient
197
227
  ?? ((peerId) => new BlockTransferClient(peerId, deps.peerNetwork, deps.protocolPrefix));
198
- this.onConnectionOpen = (evt) => this.schedulePeer(evt.detail.remotePeer);
228
+ this.onPeerIdentify = (evt) => {
229
+ const { peerId, protocols } = evt.detail;
230
+ if (speaksBlockTransfer(protocols, this.deps.protocolPrefix)) {
231
+ this.schedulePeer(peerId);
232
+ }
233
+ };
199
234
  }
200
- /** Subscribe to connection:open AND schedule a catch-up for peers already connected. */
235
+ /**
236
+ * Subscribe to `peer:identify` AND schedule a catch-up for already-connected peers whose
237
+ * stored protocols already name this network's block-transfer protocol — a peer that does
238
+ * not speak it (a bare circuit relay, a bootstrap node) is never scheduled at all. See
239
+ * {@link speaksBlockTransfer} and the module comment.
240
+ */
201
241
  start() {
202
242
  if (this.started || this.stopped || !this.config.enabled)
203
243
  return;
204
244
  this.started = true;
205
- this.deps.libp2p.addEventListener('connection:open', this.onConnectionOpen);
206
- // A runtime rebuilt over live connections (resumeStrand) never sees their
207
- // connection:open, so walk what is already connected once.
208
- const scheduled = this.scheduleConnectedPeers();
209
- log('[%s] started (%d peer(s) already connected)', this.deps.label, scheduled);
245
+ this.deps.libp2p.addEventListener('peer:identify', this.onPeerIdentify);
246
+ // A runtime rebuilt over live connections (resumeStrand) never sees their peer:identify —
247
+ // it already fired before this instance existed, but its result is persisted in the peer
248
+ // store — so walk what is already connected once.
249
+ void this.scheduleConnectedPeers().then((scheduled) => {
250
+ log('[%s] started (%d peer(s) already connected)', this.deps.label, scheduled);
251
+ });
210
252
  }
211
253
  /** Unsubscribe, clear timers; in-flight runs observe the stopped flag and bail. */
212
254
  stop() {
@@ -214,7 +256,7 @@ export class PeerJoinBackfill {
214
256
  return;
215
257
  this.stopped = true;
216
258
  if (this.started) {
217
- this.deps.libp2p.removeEventListener('connection:open', this.onConnectionOpen);
259
+ this.deps.libp2p.removeEventListener('peer:identify', this.onPeerIdentify);
218
260
  }
219
261
  for (const timer of this.timers.values()) {
220
262
  clearTimeout(timer);
@@ -225,28 +267,46 @@ export class PeerJoinBackfill {
225
267
  log('[%s] stopped', this.deps.label);
226
268
  }
227
269
  /**
228
- * (Re-)schedule a debounced catch-up for every currently-connected peer not yet caught
229
- * up. Idempotent and cheap (caught-up peers are skipped before any timer is set, and a
230
- * peer whose run is in flight is deferred to the end of that run rather than dropped).
231
- * Driven by {@link start}, and — on a gated network — by the embedder whenever
232
- * membership changes, so a peer whose first pass was denied (connected before it was
233
- * authorized: the production join order) is retried without waiting for a reconnect.
234
- * Returns how many distinct peers were considered (for the start() log) — a peer holding
235
- * several connections is one peer, and is scheduled once.
270
+ * (Re-)schedule a debounced catch-up for every currently-connected peer whose protocols, as
271
+ * already stored in the libp2p peer store, name this network's block-transfer protocol. A
272
+ * peer not yet in the peer store — its identify has not finished — is left to the
273
+ * `peer:identify` handler rather than dialed blind; one whose stored protocols are known
274
+ * and lack ours is skipped outright. Idempotent and cheap otherwise (caught-up peers are
275
+ * skipped before any timer is set, and a peer whose run is in flight is deferred to the end
276
+ * of that run rather than dropped). Driven by {@link start}, and — on a gated network — by
277
+ * the embedder whenever membership changes, so a peer whose first pass was denied (connected
278
+ * before it was authorized: the production join order) is retried without waiting for a
279
+ * reconnect. Returns how many distinct peers were considered (for the start() log) — a peer
280
+ * holding several connections is one peer, and is scheduled once.
236
281
  */
237
- scheduleConnectedPeers() {
282
+ async scheduleConnectedPeers() {
238
283
  if (this.stopped)
239
284
  return 0;
240
- const peers = new Set();
285
+ const peers = new Map();
241
286
  for (const connection of this.deps.libp2p.getConnections()) {
242
- const key = connection.remotePeer.toString();
243
- if (peers.has(key))
244
- continue;
245
- peers.add(key);
246
- this.schedulePeer(connection.remotePeer);
287
+ peers.set(connection.remotePeer.toString(), connection.remotePeer);
247
288
  }
289
+ await Promise.all([...peers.values()].map((peerId) => this.scheduleIfKnownToSpeak(peerId)));
248
290
  return peers.size;
249
291
  }
292
+ /** Schedules `peerId` only if the peer store already knows it speaks this network's protocol. */
293
+ async scheduleIfKnownToSpeak(peerId) {
294
+ let protocols;
295
+ try {
296
+ ({ protocols } = await this.deps.libp2p.peerStore.get(peerId));
297
+ }
298
+ catch (error) {
299
+ // NotFoundError: identify has not finished. Leave it to the `peer:identify` handler
300
+ // rather than dialing blind. Anything else is unexpected — log it and skip the peer.
301
+ if (error.name !== 'NotFoundError') {
302
+ log('[%s] peer store read for %s failed — not scheduling: %o', this.deps.label, peerId.toString(), error);
303
+ }
304
+ return;
305
+ }
306
+ if (speaksBlockTransfer(protocols, this.deps.protocolPrefix)) {
307
+ this.schedulePeer(peerId);
308
+ }
309
+ }
250
310
  /** Debounced entry point for connection churn: one run per peer per settle window. */
251
311
  schedulePeer(peerId) {
252
312
  const key = peerId.toString();
@@ -260,7 +320,7 @@ export class PeerJoinBackfill {
260
320
  }
261
321
  // A peer whose last run failed is already re-armed on a backoff timer that will run it, so
262
322
  // DROP this schedule instead of shortening the wait — otherwise a peer that cannot be
263
- // reached is re-dialled on every connection:open forever (see the module comment's retry
323
+ // reached is re-dialled on every peer:identify forever (see the module comment's retry
264
324
  // paragraph). A denied run never gets here: it does not set a backoff.
265
325
  const retryAt = this.retryAfter.get(key);
266
326
  if (retryAt !== undefined && Date.now() < retryAt)
@@ -302,7 +362,7 @@ export class PeerJoinBackfill {
302
362
  // rejection are all verdicts a retry cannot change, and re-arming on them would
303
363
  // re-push the whole store to that peer forever. See the module comment.
304
364
  //
305
- // Gated on `started` too: the re-arm exists to REPLACE a connection:open-driven retry,
365
+ // Gated on `started` too: the re-arm exists to REPLACE a peer:identify-driven retry,
306
366
  // so a caller driving `catchUpPeer` by hand against a backfill that was never started
307
367
  // owns its own retry policy and must not be left holding a background timer.
308
368
  this.scheduleRetryWithBackoff(peerId);
@@ -332,7 +392,7 @@ export class PeerJoinBackfill {
332
392
  /**
333
393
  * Re-arm one peer's catch-up after a run whose push failed, on a wait that doubles
334
394
  * per consecutive failure up to `maxRetryBackoffMs`. Sets {@link retryAfter} alongside the
335
- * timer, which is what makes `connection:open` churn inside the wait free.
395
+ * timer, which is what makes `peer:identify` churn inside the wait free.
336
396
  */
337
397
  scheduleRetryWithBackoff(peerId) {
338
398
  const key = peerId.toString();
@@ -1 +1 @@
1
- {"version":3,"file":"peer-join-backfill.js","sourceRoot":"","sources":["../src/peer-join-backfill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,mBAAmB,EAA2C,MAAM,oBAAoB,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,sFAAsF;AACtF,0FAA0F;AAC1F,qFAAqF;AACrF,0FAA0F;AAC1F,0FAA0F;AAC1F,yFAAyF;AACzF,yFAAyF;AACzF,EAAE;AACF,wFAAwF;AACxF,iFAAiF;AACjF,0FAA0F;AAC1F,uFAAuF;AACvF,0FAA0F;AAC1F,sBAAsB;AACtB,EAAE;AACF,2FAA2F;AAC3F,wFAAwF;AACxF,oBAAoB;AACpB,EAAE;AACF,gFAAgF;AAChF,uBAAuB;AACvB,EAAE;AACF,2FAA2F;AAC3F,2FAA2F;AAC3F,0FAA0F;AAC1F,2FAA2F;AAC3F,2FAA2F;AAC3F,4EAA4E;AAC5E,sFAAsF;AACtF,kFAAkF;AAClF,gFAAgF;AAChF,iFAAiF;AACjF,wFAAwF;AACxF,yFAAyF;AACzF,wFAAwF;AACxF,wFAAwF;AACxF,uEAAuE;AACvE,oFAAoF;AACpF,oFAAoF;AACpF,EAAE;AACF,wEAAwE;AACxE,yFAAyF;AACzF,wFAAwF;AACxF,wFAAwF;AACxF,0FAA0F;AAC1F,0FAA0F;AAC1F,+EAA+E;AAC/E,0FAA0F;AAC1F,EAAE;AACF,kFAAkF;AAClF,6FAA6F;AAC7F,gGAAgG;AAChG,yFAAyF;AACzF,+EAA+E;AAC/E,0FAA0F;AAC1F,EAAE;AACF,4FAA4F;AAC5F,uFAAuF;AACvF,8FAA8F;AAC9F,4FAA4F;AAC5F,gBAAgB;AAChB,EAAE;AACF,wFAAwF;AACxF,2FAA2F;AAC3F,oFAAoF;AACpF,4FAA4F;AAC5F,yFAAyF;AACzF,yFAAyF;AACzF,uFAAuF;AACvF,wFAA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E,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9E,CAAC;QAED,MAAM,KAAK,GAAG,CAAC,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC;QAC3D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;IACpD,CAAC;CACF"}
1
+ {"version":3,"file":"peer-join-backfill.js","sourceRoot":"","sources":["../src/peer-join-backfill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAA2C,MAAM,oBAAoB,CAAC;AAC9H,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,sFAAsF;AACtF,6FAA6F;AAC7F,uFAAuF;AACvF,0FAA0F;AAC1F,wFAAwF;AACxF,0FAA0F;AAC1F,0FAA0F;AAC1F,yFAAyF;AACzF,yFAAyF;AACzF,EAAE;AACF,6FAA6F;AAC7F,yFAAyF;AACzF,8FAA8F;AAC9F,sFAAsF;AACtF,8FAA8F;AAC9F,2FAA2F;AAC3F,wFAAwF;AACxF,+BAA+B;AAC/B,EAAE;AACF,wFAAwF;AACxF,iFAAiF;AACjF,0FAA0F;AAC1F,uFAAuF;AACvF,0FAA0F;AAC1F,sBAAsB;AACtB,EAAE;AACF,2FAA2F;AAC3F,wFAAwF;AACxF,oBAAoB;AACpB,EAAE;AACF,gFAAgF;AAChF,uBAAuB;AACvB,EAAE;AACF,6FAA6F;AAC7F,2FAA2F;AAC3F,yFAAyF;AACzF,WAAW;AACX,sFAAsF;AACtF,kFAAkF;AAClF,gFAAgF;AAChF,iFAAiF;AACjF,wFAAwF;AACxF,yFAAyF;AACzF,wFAAwF;AACxF,wFAAwF;AACxF,wFAAwF;AACxF,gGAAgG;AAChG,oFAAoF;AACpF,EAAE;AACF,wEAAwE;AACxE,yF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AAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;YAChC,CAAC;YACD,KAAK,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC;YAC7B,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC;QACtB,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC;YACxC,MAAM,KAAK,EAAE,CAAC;QAChB,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,GAAG,CAAC,yEAAyE,EAC3E,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9E,CAAC;QAED,MAAM,KAAK,GAAG,CAAC,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC;QAC3D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;IACpD,CAAC;CACF"}
@@ -122,6 +122,12 @@ export declare class PushFanoutService {
122
122
  * double-wake). Only a dial/transport REJECTION means the phone is suspended
123
123
  * and unreachable over the control network, which is the one case that falls
124
124
  * through to FCM/APNs.
125
+ *
126
+ * NOTE: the platform push waits for the whole direct dial to fail, up to
127
+ * `DEFAULT_WAKE_DIAL_BUDGET_MS` (46 s at the default declared link). A suspended
128
+ * phone typically fails its relay address fast and spends the rest on its direct
129
+ * one. If that delay shows up, start the platform push in parallel with the dial,
130
+ * or after its first attempt.
125
131
  */
126
132
  private wakePeer;
127
133
  /**
@@ -132,6 +132,12 @@ export class PushFanoutService {
132
132
  * double-wake). Only a dial/transport REJECTION means the phone is suspended
133
133
  * and unreachable over the control network, which is the one case that falls
134
134
  * through to FCM/APNs.
135
+ *
136
+ * NOTE: the platform push waits for the whole direct dial to fail, up to
137
+ * `DEFAULT_WAKE_DIAL_BUDGET_MS` (46 s at the default declared link). A suspended
138
+ * phone typically fails its relay address fast and spends the rest on its direct
139
+ * one. If that delay shows up, start the platform push in parallel with the dial,
140
+ * or after its first attempt.
135
141
  */
136
142
  async wakePeer(peerId, strandId, reason) {
137
143
  // A wake of either kind is now being attempted → arm the cooldown up front.
@@ -1 +1 @@
1
- {"version":3,"file":"push-fanout.js","sourceRoot":"","sources":["../src/push-fanout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,GAAG,GAAG,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAE9C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,GAAG,KAAM,CAAC;AACnD,kDAAkD;AAClD,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAM,CAAC;AAiD/C;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IAmB5B,YAAY,OAA0B;QAbtC,4EAA4E;QAC3D,iBAAY,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC1D,sFAAsF;QACrE,aAAQ,GAAG,IAAI,GAAG,EAAyB,CAAC;QAC7D,8EAA8E;QAC7D,eAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;QACxD;;;;WAIG;QACc,eAAU,GAAG,IAAI,GAAG,EAAU,CAAC;QAG9C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;QACpB,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,wBAAwB,CAAC;QACjE,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,wBAAwB,CAAC;IACnE,CAAC;IAED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AAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;QAChE,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;IACnE,CAAC;IAED,uEAAuE;IAC/D,YAAY,CAAC,MAAc,EAAE,QAAgB;QACnD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IACjE,CAAC;CACF;AAED,+DAA+D;AAC/D,SAAS,WAAW,CAAC,MAAc,EAAE,QAAgB;IACnD,OAAO,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC;AACjC,CAAC"}
@@ -132,7 +132,9 @@ export interface RelayReservationState {
132
132
  /**
133
133
  * How long {@link driveRelayReservation} waits for a reservation to appear, at the DEFAULT
134
134
  * declared link round trip: `RELAY_RESERVATION_ROUND_TRIPS` (4) x `DECLARED_LINK_ROUND_TRIP_MS`
135
- * (3500 ms) = 14 000 ms, where it was a fixed 10_000 before it was derived.
135
+ * (3500 ms), plus 2 x `ADMISSION_DECISION_TIMEOUT_MS` (2000 ms) for a party-run relay's
136
+ * connection and reservation decisions, = 18 000 ms (`relayReservationBudgetMs`), where it was a
137
+ * fixed 10_000 before it was derived.
136
138
  *
137
139
  * Counted rather than chosen because this one deadline bounds the whole drive — dial the relay,
138
140
  * request the reservation, wait — and each of those costs a fixed number of exchanges, not a
@@ -109,7 +109,9 @@ const log = debug('sereus:cadre:relay-reservation');
109
109
  /**
110
110
  * How long {@link driveRelayReservation} waits for a reservation to appear, at the DEFAULT
111
111
  * declared link round trip: `RELAY_RESERVATION_ROUND_TRIPS` (4) x `DECLARED_LINK_ROUND_TRIP_MS`
112
- * (3500 ms) = 14 000 ms, where it was a fixed 10_000 before it was derived.
112
+ * (3500 ms), plus 2 x `ADMISSION_DECISION_TIMEOUT_MS` (2000 ms) for a party-run relay's
113
+ * connection and reservation decisions, = 18 000 ms (`relayReservationBudgetMs`), where it was a
114
+ * fixed 10_000 before it was derived.
113
115
  *
114
116
  * Counted rather than chosen because this one deadline bounds the whole drive — dial the relay,
115
117
  * request the reservation, wait — and each of those costs a fixed number of exchanges, not a