@serfab/cadre-core 1.7.0 → 1.9.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 (188) hide show
  1. package/README.md +8 -6
  2. package/dist/cadre-node.d.ts +527 -206
  3. package/dist/cadre-node.js +1084 -528
  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 +10 -10
  45. package/dist/index.js +25 -20
  46. package/dist/index.js.map +1 -1
  47. package/dist/joined-strand-store.d.ts +90 -25
  48. package/dist/joined-strand-store.js +223 -55
  49. package/dist/joined-strand-store.js.map +1 -1
  50. package/dist/key-store-file.js +14 -5
  51. package/dist/key-store-file.js.map +1 -1
  52. package/dist/link-budget.d.ts +367 -69
  53. package/dist/link-budget.js +375 -72
  54. package/dist/link-budget.js.map +1 -1
  55. package/dist/membership-connection-gater.d.ts +30 -43
  56. package/dist/membership-connection-gater.js +31 -42
  57. package/dist/membership-connection-gater.js.map +1 -1
  58. package/dist/node-local-snapshot.d.ts +6 -4
  59. package/dist/node-local-snapshot.js +7 -3
  60. package/dist/node-local-snapshot.js.map +1 -1
  61. package/dist/peer-dial.d.ts +24 -4
  62. package/dist/peer-dial.js +74 -5
  63. package/dist/peer-dial.js.map +1 -1
  64. package/dist/peer-join-backfill.d.ts +2 -10
  65. package/dist/peer-join-backfill.js +8 -8
  66. package/dist/peer-join-backfill.js.map +1 -1
  67. package/dist/push-fanout.d.ts +6 -0
  68. package/dist/push-fanout.js +6 -0
  69. package/dist/push-fanout.js.map +1 -1
  70. package/dist/relay-reservation.d.ts +3 -1
  71. package/dist/relay-reservation.js +3 -1
  72. package/dist/relay-reservation.js.map +1 -1
  73. package/dist/relay-server.d.ts +79 -0
  74. package/dist/relay-server.js +74 -0
  75. package/dist/relay-server.js.map +1 -0
  76. package/dist/seed-bootstrap.d.ts +57 -4
  77. package/dist/seed-bootstrap.js +107 -83
  78. package/dist/seed-bootstrap.js.map +1 -1
  79. package/dist/storage-scope.d.ts +33 -17
  80. package/dist/storage-scope.js +44 -23
  81. package/dist/storage-scope.js.map +1 -1
  82. package/dist/strand-addr-protocol.d.ts +58 -21
  83. package/dist/strand-addr-protocol.js +133 -85
  84. package/dist/strand-addr-protocol.js.map +1 -1
  85. package/dist/strand-database.d.ts +20 -2
  86. package/dist/strand-database.js +42 -5
  87. package/dist/strand-database.js.map +1 -1
  88. package/dist/strand-first-sync-gate.d.ts +59 -21
  89. package/dist/strand-first-sync-gate.js +58 -19
  90. package/dist/strand-first-sync-gate.js.map +1 -1
  91. package/dist/strand-formation-deadlines.d.ts +151 -0
  92. package/dist/strand-formation-deadlines.js +171 -0
  93. package/dist/strand-formation-deadlines.js.map +1 -0
  94. package/dist/strand-formation-manager.d.ts +63 -30
  95. package/dist/strand-formation-manager.js +67 -41
  96. package/dist/strand-formation-manager.js.map +1 -1
  97. package/dist/strand-formation-protocol.d.ts +45 -46
  98. package/dist/strand-formation-protocol.js +62 -126
  99. package/dist/strand-formation-protocol.js.map +1 -1
  100. package/dist/strand-fret-addrs.d.ts +54 -0
  101. package/dist/strand-fret-addrs.js +108 -0
  102. package/dist/strand-fret-addrs.js.map +1 -0
  103. package/dist/strand-instance-manager.d.ts +122 -44
  104. package/dist/strand-instance-manager.js +270 -114
  105. package/dist/strand-instance-manager.js.map +1 -1
  106. package/dist/strand-membership-writer.d.ts +6 -0
  107. package/dist/strand-membership-writer.js +11 -0
  108. package/dist/strand-membership-writer.js.map +1 -1
  109. package/dist/strand-network-state-file.d.ts +12 -0
  110. package/dist/strand-network-state-file.js +38 -0
  111. package/dist/strand-network-state-file.js.map +1 -0
  112. package/dist/strand-network-state.d.ts +111 -0
  113. package/dist/strand-network-state.js +191 -0
  114. package/dist/strand-network-state.js.map +1 -0
  115. package/dist/strand-revocation-enforcer.js +2 -1
  116. package/dist/strand-revocation-enforcer.js.map +1 -1
  117. package/dist/strand-solicitation.d.ts +36 -20
  118. package/dist/strand-solicitation.js +4 -4
  119. package/dist/strand-solicitation.js.map +1 -1
  120. package/dist/strand-wake-protocol.d.ts +80 -23
  121. package/dist/strand-wake-protocol.js +89 -64
  122. package/dist/strand-wake-protocol.js.map +1 -1
  123. package/dist/types.d.ts +148 -61
  124. package/dist/types.js +4 -3
  125. package/dist/types.js.map +1 -1
  126. package/package.json +11 -10
  127. package/src/cadre-node.ts +8400 -7776
  128. package/src/control-authorization.ts +2 -1
  129. package/src/control-cohort.ts +6 -0
  130. package/src/control-database.ts +122 -18
  131. package/src/control-formation-recorder.ts +354 -305
  132. package/src/control-read-retry.ts +14 -12
  133. package/src/control-schema.ts +67 -5
  134. package/src/control-stream.ts +25 -1
  135. package/src/control-write-retry.ts +13 -2
  136. package/src/delegate-admission.ts +23 -13
  137. package/src/diagnostics/connection-path.ts +0 -7
  138. package/src/formation-approval.ts +610 -604
  139. package/src/fs-atomic.ts +14 -4
  140. package/src/hibernation-manager.ts +638 -437
  141. package/src/index.ts +43 -65
  142. package/src/joined-strand-store.ts +247 -57
  143. package/src/key-store-file.ts +14 -5
  144. package/src/link-budget.ts +393 -74
  145. package/src/membership-connection-gater.ts +31 -45
  146. package/src/node-local-snapshot.ts +12 -7
  147. package/src/peer-dial.ts +81 -7
  148. package/src/peer-join-backfill.ts +10 -9
  149. package/src/push-fanout.ts +6 -0
  150. package/src/relay-reservation.ts +3 -1
  151. package/src/relay-server.ts +98 -0
  152. package/src/seed-bootstrap.ts +133 -91
  153. package/src/storage-scope.ts +44 -23
  154. package/src/strand-addr-protocol.ts +547 -458
  155. package/src/strand-database.ts +287 -242
  156. package/src/strand-first-sync-gate.ts +58 -19
  157. package/src/strand-formation-deadlines.ts +227 -0
  158. package/src/strand-formation-manager.ts +700 -647
  159. package/src/strand-formation-protocol.ts +106 -154
  160. package/src/strand-fret-addrs.ts +145 -0
  161. package/src/strand-instance-manager.ts +307 -140
  162. package/src/strand-membership-writer.ts +12 -0
  163. package/src/strand-network-state-file.ts +40 -0
  164. package/src/strand-network-state.ts +243 -0
  165. package/src/strand-revocation-enforcer.ts +2 -1
  166. package/src/strand-solicitation.ts +519 -500
  167. package/src/strand-wake-protocol.ts +401 -355
  168. package/src/types.ts +150 -61
  169. package/dist/strand-peer-book-file.d.ts +0 -12
  170. package/dist/strand-peer-book-file.js +0 -37
  171. package/dist/strand-peer-book-file.js.map +0 -1
  172. package/dist/strand-peer-book-protocol.d.ts +0 -159
  173. package/dist/strand-peer-book-protocol.js +0 -360
  174. package/dist/strand-peer-book-protocol.js.map +0 -1
  175. package/dist/strand-peer-book-swap.d.ts +0 -104
  176. package/dist/strand-peer-book-swap.js +0 -284
  177. package/dist/strand-peer-book-swap.js.map +0 -1
  178. package/dist/strand-peer-book.d.ts +0 -159
  179. package/dist/strand-peer-book.js +0 -354
  180. package/dist/strand-peer-book.js.map +0 -1
  181. package/dist/strand-peer-observer.d.ts +0 -88
  182. package/dist/strand-peer-observer.js +0 -180
  183. package/dist/strand-peer-observer.js.map +0 -1
  184. package/src/strand-peer-book-file.ts +0 -39
  185. package/src/strand-peer-book-protocol.ts +0 -463
  186. package/src/strand-peer-book-swap.ts +0 -338
  187. package/src/strand-peer-book.ts +0 -468
  188. package/src/strand-peer-observer.ts +0 -235
@@ -26,8 +26,9 @@
26
26
  */
27
27
  import debug from 'debug';
28
28
  import { decodeLengthPrefixedFrame } from './seed-bootstrap.js';
29
- import { writeFrame, exchangeFrame, readStreamToEnd } from './control-stream.js';
29
+ import { exchangeFrame, readStreamToEnd, replyAndClose } from './control-stream.js';
30
30
  import { tryAddrsInTurn } from './peer-dial.js';
31
+ import { relayedRequestBudgetMs } from './link-budget.js';
31
32
  const log = debug('sereus:cadre:strand-wake');
32
33
  /** Protocol id for control-network push-wake (parallel to `/sereus/seed/1.0.0`). */
33
34
  export const WAKE_PROTOCOL = '/sereus/strand-wake/1.0.0';
@@ -37,36 +38,57 @@ export const WAKE_PROTOCOL = '/sereus/strand-wake/1.0.0';
37
38
  * bytes a peer can make the receiver buffer per stream.
38
39
  */
39
40
  const MAX_WAKE_SIZE = 64 * 1024;
40
- /** Default time to wait for the ack before abandoning ONE wake dial attempt (ms). */
41
- const DEFAULT_WAKE_TIMEOUT_MS = 10000;
42
41
  /**
43
- * Default budget for a WHOLE {@link dialWake} call, in ms — every candidate
44
- * address together, not each one.
42
+ * Default deadline for ONE wake attempt — dial, request, ack — at the default declared link
43
+ * (ms): `relayedRequestBudgetMs` in `link-budget.ts`, because the target may be reachable
44
+ * only through a relay and the attempt has to open that connection before the exchange.
45
+ * {@link dialWake} derives it from {@link DialWakeOptions.linkRoundTripMs} instead when given.
46
+ *
47
+ * It holds only link work because the receiver acks as soon as it has DECIDED, before the
48
+ * wake itself runs ({@link StrandWakeService.processWakeRequest}).
49
+ *
50
+ * NOTE: the receiver's membership check (two live control reads) runs inside this deadline and
51
+ * is not counted. In steady state those reads touch only held blocks and do not consult the
52
+ * cohort. If a wake or address request is seen timing out while the receiver's membership read
53
+ * is consulting, count one membership decision in this deadline or answer the check from the
54
+ * materialized authorized-peer snapshot. See docs/cadre-consistency.md → "Deadlines Over
55
+ * Optimystic's Reads and Commits".
56
+ */
57
+ export const DEFAULT_WAKE_TIMEOUT_MS = relayedRequestBudgetMs();
58
+ /**
59
+ * Whole attempts one {@link dialWake} call budgets for: a stale signaling address, then the
60
+ * direct address that works.
61
+ */
62
+ export const WAKE_DIAL_ATTEMPTS = 2;
63
+ /**
64
+ * Default budget for a WHOLE {@link dialWake} call at the default declared link, in ms —
65
+ * every candidate address together, not each one: {@link WAKE_DIAL_ATTEMPTS} attempt
66
+ * deadlines.
45
67
  *
46
68
  * Without it the cost of a wake is (candidate count × {@link
47
69
  * DEFAULT_WAKE_TIMEOUT_MS}), a number nothing chooses or bounds. That is not
48
70
  * hypothetical: an address behind a dropped NAT mapping, or any host that
49
71
  * blackholes rather than sending a RST, burns its full attempt timeout instead
50
- * of failing in milliseconds, so a two-address peer costs 20 s and a
51
- * five-address one costs 50 s.
72
+ * of failing in milliseconds, so a five-address peer would cost five attempts.
52
73
  *
53
74
  * This makes the TARGET PEER the unit rather than the address — the same
54
75
  * decision, for the same reason, as
55
76
  * `DEFAULT_CONTROL_COHORT_DIAL_TIMEOUT_MS` in `peer-dial.ts`, though not the same
56
- * number: that one is sized to fit several dead addresses ahead of a working one,
77
+ * count: that one is sized to fit several dead addresses ahead of a working one,
57
78
  * while a wake target is expected to be awake and reachable on its first or second
58
- * address. 20 s is deliberately wider than one attempt timeout so a
59
- * reachable peer whose signaling address is stale still gets a genuine try at
60
- * its direct one; a peer needing longer than that is not "asleep and reachable",
61
- * which is the only case a wake is for. The last attempt inside the budget gets
62
- * whatever remains of it, so the call returns at the budget, not past it.
79
+ * address. Two whole attempts so a reachable peer whose signaling address is stale
80
+ * still gets a genuine try at its direct one; a peer needing longer than that is
81
+ * not "asleep and reachable", which is the only case a wake is for. The last
82
+ * attempt inside the budget gets whatever remains of it, so the call returns at
83
+ * the budget, not past it.
63
84
  *
64
85
  * Override per call with {@link DialWakeOptions.budgetMs} — tests that drive
65
86
  * dead addresses on purpose set it low so a dial's duration is a chosen number
66
87
  * rather than a transitive libp2p default stretched by machine load.
67
88
  */
68
- export const DEFAULT_WAKE_DIAL_BUDGET_MS = 20000;
89
+ export const DEFAULT_WAKE_DIAL_BUDGET_MS = WAKE_DIAL_ATTEMPTS * DEFAULT_WAKE_TIMEOUT_MS;
69
90
  /** Default time the receiver waits for an inbound wake frame before aborting (ms). */
91
+ // eslint-disable-next-line no-restricted-syntax -- link-independent: a receiver cap on one small request frame on a stream the peer already opened; it bounds a peer that opens a stream and never sends, not the dial
70
92
  const DEFAULT_WAKE_READ_TIMEOUT_MS = 10000;
71
93
  /** Default cap on concurrent inbound wake streams a single peer can pin open. */
72
94
  const DEFAULT_MAX_CONCURRENT_WAKES = 100;
@@ -84,8 +106,8 @@ async function readFrame(stream, timeoutMs) {
84
106
  /**
85
107
  * Receiver side of the push-wake protocol. Registers a `WAKE_PROTOCOL` handler
86
108
  * on the control node and, for each inbound {@link WakeRequest}, gates on cadre
87
- * membership, then resumes the named strand if it is hibernating/idle and we
88
- * participate in it — replying with a {@link WakeAck}.
109
+ * membership, replies with a {@link WakeAck}, and starts resuming the named
110
+ * strand if it is hibernating/idle and we participate in it.
89
111
  */
90
112
  export class StrandWakeService {
91
113
  constructor(options) {
@@ -100,18 +122,22 @@ export class StrandWakeService {
100
122
  get activeCount() {
101
123
  return this.activeStreams;
102
124
  }
103
- /** Register the wake protocol handler on the control node. */
104
- initialize(node) {
105
- this.node = node;
125
+ /**
126
+ * Register the wake protocol handler on the control node. Rejects when libp2p
127
+ * refuses the registration; the node reference is kept only once the handler
128
+ * is in place.
129
+ */
130
+ async initialize(node) {
106
131
  // `runOnLimitedConnection: true` is REQUIRED for the relay path: a NAT'd
107
132
  // receiver is reached over a circuit-relay connection, which libp2p marks
108
133
  // "limited" (the relay caps its data/duration). Without this the receiver
109
134
  // would refuse the inbound wake stream on exactly the connection the
110
135
  // protocol is designed to use (see the relay note on `dialWake`).
111
- void node.handle(WAKE_PROTOCOL, async (rawStream, rawConnection) => {
136
+ await node.handle(WAKE_PROTOCOL, async (rawStream, rawConnection) => {
112
137
  const remotePeerId = rawConnection.remotePeer.toString();
113
138
  await this.handleStream(rawStream, remotePeerId);
114
139
  }, { runOnLimitedConnection: true });
140
+ this.node = node;
115
141
  log('StrandWakeService registered handler: %s', WAKE_PROTOCOL);
116
142
  }
117
143
  /** Unregister the handler and release the node reference. */
@@ -123,7 +149,7 @@ export class StrandWakeService {
123
149
  }
124
150
  }
125
151
  /**
126
- * Read the inbound request, decide + execute the wake, and write the ack.
152
+ * Read the inbound request, decide the wake, and write the ack.
127
153
  *
128
154
  * Three hardening layers, all reported as a non-accepting ack rather than a
129
155
  * dropped/hung stream: a concurrency cap (over {@link maxConcurrent}, reply
@@ -135,58 +161,41 @@ export class StrandWakeService {
135
161
  log('Incoming wake request from: %s', remotePeerId);
136
162
  if (this.activeStreams >= this.maxConcurrent) {
137
163
  log('Rejecting wake from %s: %d concurrent streams at cap %d', remotePeerId, this.activeStreams, this.maxConcurrent);
138
- const ack = { accepted: false, reason: 'Too many concurrent wake requests' };
139
- try {
140
- writeFrame(stream, ack);
141
- }
142
- catch {
143
- // Ignore send errors on the reject path.
144
- }
145
- try {
146
- await stream.close();
147
- }
148
- catch {
149
- // Ignore close errors.
150
- }
164
+ await replyAndClose(stream, { accepted: false, reason: 'Too many concurrent wake requests' }, 'Wake');
151
165
  return;
152
166
  }
153
167
  this.activeStreams++;
168
+ try {
169
+ await replyAndClose(stream, await this.answerStream(stream, remotePeerId), 'Wake');
170
+ }
171
+ finally {
172
+ this.activeStreams--;
173
+ }
174
+ }
175
+ /** Read and decide one inbound request; any failure becomes a non-accepting ack. */
176
+ async answerStream(stream, remotePeerId) {
154
177
  try {
155
178
  const request = await readFrame(stream, this.readTimeoutMs);
156
- const ack = await this.processWakeRequest(request, remotePeerId);
157
- writeFrame(stream, ack);
179
+ return await this.processWakeRequest(request, remotePeerId);
158
180
  }
159
181
  catch (err) {
160
182
  log('Error handling wake request from %s: %o', remotePeerId, err);
161
- const ack = {
162
- accepted: false,
163
- reason: err instanceof Error ? err.message : 'Unknown error',
164
- };
165
- try {
166
- writeFrame(stream, ack);
167
- }
168
- catch {
169
- // Ignore send errors on the error path.
170
- }
171
- }
172
- finally {
173
- this.activeStreams--;
174
- try {
175
- await stream.close();
176
- }
177
- catch {
178
- // Ignore close errors.
179
- }
183
+ return { accepted: false, reason: err instanceof Error ? err.message : 'Unknown error' };
180
184
  }
181
185
  }
182
186
  /**
183
- * Decide and execute the wake for a decoded request. Exposed (not private) so
187
+ * Decide the wake for a decoded request and start it. Exposed (not private) so
184
188
  * the decision matrix can be unit-tested directly.
185
189
  *
186
190
  * - Non-member sender → rejected (`accepted: false`).
187
191
  * - Unknown / not-participated strand → rejected.
188
- * - Hibernating or idle strand → resumed via the wake path, then `accepted`.
192
+ * - Hibernating or idle strand → `accepted` with that status, and a wake started.
189
193
  * - Already-live strand → no-op, `accepted` with current status.
194
+ *
195
+ * The wake is not awaited, so the ack means "a wake was started", not "the
196
+ * strand is up". Awaiting it would put the whole resume — a sibling address
197
+ * collection, a strand node build, a relay reservation drive — inside the
198
+ * sender's attempt deadline, coupling that deadline to this node's own budgets.
190
199
  */
191
200
  async processWakeRequest(request, remotePeerId) {
192
201
  // The injected membership predicate is the whole v1 authorization (CadreNode
@@ -200,15 +209,25 @@ export class StrandWakeService {
200
209
  log('Rejecting wake for unknown/unparticipated strand %s', request.strandId);
201
210
  return { accepted: false, reason: 'Strand not found or not participated in' };
202
211
  }
203
- if (instance.status === 'hibernating' || instance.status === 'idle') {
212
+ // Read before the wake starts: the wake path mutates the shared instance.
213
+ const status = instance.status;
214
+ if (status === 'hibernating' || status === 'idle') {
204
215
  log('Waking strand %s on push from %s (reason=%s)', request.strandId, remotePeerId, request.reason ?? 'unspecified');
205
- await this.options.wake(request.strandId);
216
+ this.startWake(request.strandId);
206
217
  }
207
218
  else {
208
- log('Strand %s already %s; push-wake is a no-op', request.strandId, instance.status);
219
+ log('Strand %s already %s; push-wake is a no-op', request.strandId, status);
209
220
  }
210
- // The wake path mutates the shared instance, so re-read its current status.
211
- return { accepted: true, status: instance.status };
221
+ return { accepted: true, status };
222
+ }
223
+ /**
224
+ * Start a wake without awaiting it — the same fire-and-forget an activity-driven
225
+ * local wake uses (`HibernationManager`), which also coalesces the two.
226
+ */
227
+ startWake(strandId) {
228
+ void this.options.wake(strandId).catch((err) => {
229
+ log('Push-wake of strand %s failed after it was accepted: %o', strandId, err);
230
+ });
212
231
  }
213
232
  }
214
233
  /**
@@ -235,15 +254,21 @@ export class StrandWakeService {
235
254
  * exactly the signaling address this ordering puts first — silently inverting
236
255
  * it, with no per-dial sorter override to opt out of. For the same reason this
237
256
  * does not use `dialPeerAddrs`, which puts relayed addresses last.
257
+ *
258
+ * NOTE: unlike `dialPeerAddrs`, this does not drop addresses that relay through this node, so a
259
+ * relay waking a peer that holds a reservation on it tries that address and gets `Can not dial
260
+ * self` (fast, then the next candidate). If wakes are ever sent from a relay to its own
261
+ * reservation holders routinely, share `dialPeerAddrs`'s filter here.
238
262
  */
239
263
  export async function dialWake(node, addrs, request, options = {}) {
240
264
  if (addrs.length === 0) {
241
265
  throw new Error('No dialable address for wake target');
242
266
  }
243
267
  const protocolId = options.protocolId ?? WAKE_PROTOCOL;
268
+ const perAddressMs = options.timeoutMs ?? relayedRequestBudgetMs(options.linkRoundTripMs);
244
269
  const budget = {
245
- perAddressMs: options.timeoutMs ?? DEFAULT_WAKE_TIMEOUT_MS,
246
- totalMs: options.budgetMs ?? DEFAULT_WAKE_DIAL_BUDGET_MS,
270
+ perAddressMs,
271
+ totalMs: options.budgetMs ?? WAKE_DIAL_ATTEMPTS * perAddressMs,
247
272
  };
248
273
  // The attempt's signal aborts the in-flight dialProtocol and resets the live
249
274
  // stream, so neither the connect nor the ack-read leaks.
@@ -1 +1 @@
1
- {"version":3,"file":"strand-wake-protocol.js","sourceRoot":"","sources":["../src/strand-wake-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAsB,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrG,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,GAAG,GAAG,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAE9C,oFAAoF;AACpF,MAAM,CAAC,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAEzD;;;;GAIG;AACH,MAAM,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhC,qFAAqF;AACrF,MAAM,uBAAuB,GAAG,KAAM,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAM,CAAC;AAElD,sFAAsF;AACtF,MAAM,4BAA4B,GAAG,KAAM,CAAC;AAE5C,iFAAiF;AACjF,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAEzC;;;;;GAKG;AACH,KAAK,UAAU,SAAS,CAAI,MAAqB,EA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