@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
- // Ensure the DHT routing table is populated before attempting to look up
140
- // the peer. On a cold swarm the table is nearly empty and findPeer can
141
- // return PEER_NOT_FOUND immediately even when the provider is reachable.
142
- const bootstrapStart = nowMs();
143
- const swarm = getSwarm();
144
- logger.info(`⏳ Waiting for DHT to fully bootstrap before connect...`);
145
- await withTimeout(swarm.dht.fullyBootstrapped(), getRemainingTimeout());
146
- logger.info(`✅ DHT bootstrapped in ${(nowMs() - bootstrapStart).toFixed(0)}ms`);
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}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qvac/sdk",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",