@qvac/sdk 0.10.1 → 0.10.2
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.
|
@@ -136,14 +136,16 @@ async function ensureRPCConnection(publicKey, timeout, healthCheckTimeout) {
|
|
|
136
136
|
let conn;
|
|
137
137
|
try {
|
|
138
138
|
logger.info(`🔗 Establishing direct DHT connection to peer: ${publicKey}${timeout ? `, timeout: ${timeout}ms` : ""}`);
|
|
139
|
-
//
|
|
140
|
-
//
|
|
141
|
-
//
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
139
|
+
// We deliberately do NOT `await swarm.dht.fullyBootstrapped()` here. The
|
|
140
|
+
// earlier guard (added with #1729 to side-step a theoretical PEER_NOT_FOUND
|
|
141
|
+
// on a fully-cold swarm) added a serial 1-3s wait on every first delegated
|
|
142
|
+
// call — measurably regressing `loadModel.delegation.connection` vs 0.9.0
|
|
143
|
+
// (≈3.2× slower in local benches). `getSwarm()` is invoked early during
|
|
144
|
+
// SDK init (registry/runtime), so by the time the consumer reaches this
|
|
145
|
+
// path the routing table is already warm enough; `dht.connect()` also
|
|
146
|
+
// bootstraps on demand if it isn't, so we lose nothing by skipping the
|
|
147
|
+
// explicit await.
|
|
148
|
+
getSwarm();
|
|
147
149
|
conn = openDhtConnection(publicKey);
|
|
148
150
|
await waitForOpen(conn, getRemainingTimeout());
|
|
149
151
|
logger.info(`🍺 Peer connection opened: ${publicKey}`);
|