paritytech / paritytech/triangle-js-sdks

Wire regression between @novasamatech/host-api@0.8.3 and 0.8.4: silent handshake drop, misleading 'Host doesn't support it' log

Open
#200 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3
Forks
1
Avg merge
1d 14h
Merged PRs (30d)
8

Description

Wire regression between @novasamatech/host-api@0.8.3 and 0.8.4

@novasamatech/host-api@0.8.4 and @novasamatech/host-api-wrapper@0.8.4 are silently wire-incompatible with a host running 0.8.0. The product's host_handshake_request messages are dropped (or its response is dropped/decoded incorrectly), so transport.isReady() never resolves and every subsequent host call throws Error("Polkadot host is not ready") locally. The downstream effect on PAPI providers is particularly misleading — see below.

The v0.7 → v0.8 migration guide warns wire-compatibility breaks across the major bump, but nothing in the docs suggests intra-v0.8 patches can break the wire. We hit this against Polkadot Desktop 0.4.1 (which embeds host-api 0.8.0).

Bisection (June 2026)

Product side: @novasamatech/host-api + @novasamatech/host-api-wrapper at the same exact pinned version, talking to a host on 0.8.0.

Product version Result
0.8.0 ✅ handshake succeeds
0.8.2 ✅ handshake succeeds
0.8.3 ✅ handshake succeeds
0.8.4 ❌ handshake silently drops

Regression entered in the single 0.8.3 → 0.8.4 patch.

Symptom in product console

[surfaces] signerManager: status=connecting hasAccount=no
[surfaces] handshake: ERR — {
  "tag": "v1",
  "value": {
    "name": "HandshakeErr::Unknown",
    "payload": { "reason": "Polkadot host is not ready" }
  }
}
Provider for chain 0xbf0488… was not started because Host doesn't support it
Provider for chain 0x8cfe67… was not started because Host doesn't support it
Provider for chain 0xc5af18… was not started because Host doesn't support it

The "Polkadot host is not ready" string is the SDK's own local throw at @novasamatech/host-api/dist/transport.js:160-162. It is not a response from the host — the host never replied at all. isReady() retried host_handshake_request(v1, codecVersion=1) every 50ms for 10s (SCALE_CODEC_PROTOCOL_ID=1, HANDSHAKE_INTERVAL=50, HANDSHAKE_TIMEOUT=10000) and got zero host_handshake_response messages back.

Downstream misclassification in host-api-wrapper

papiProvider.js (checkIfReady, lines ~305-323) catches any error from host_feature_supported — including a local "Polkadot host is not ready" from isReady() — and treats the chain as unsupported:

.catch(e => {
  transport.provider.logger.error('Error checking chain support', e);
  return false;   // → installs a dead provider, logs "Host doesn't support it"
})

So the surface-level log is "Provider for chain 0x… was not started because Host doesn't support it", which led us first toward "wrong genesis hash in descriptors" / "Desktop doesn't bundle Paseo Next V2" — neither was true. The genesis hashes match live RPC; Desktop just never handshook. Even if the wire regression is fixed, distinguishing these three outcomes in checkIfReady would save users a long debug.

Repro

  1. Product app with "@novasamatech/host-api": "0.8.4" and "@novasamatech/host-api-wrapper": "0.8.4" (exact pins).
  2. Run inside a Polkadot host whose embedded host-api is 0.8.0 (e.g. Polkadot Desktop 0.4.1).
  3. Open product. Within 10s every host call fails with the symptoms above.
  4. Pin product to 0.8.3 → handshake succeeds, no other changes needed.

Asks

  1. Confirm whether wire-compatibility within v0.8.x is supposed to hold. If yes, this is a regression to revert/fix in 0.8.4. If not, please document the intra-v0.8 wire break.
  2. In host-api-wrapper/papiProvider.js#checkIfReady, distinguish "host returned ok(false) for this chain" (genuinely unsupported, dead provider is correct) from "host returned an error to feature_supported" (transient or version mismatch — at minimum log the underlying reason rather than the misleading "Host doesn't support it"). The current .catch flattens both into a dead provider with the same misleading log.

Versions

  • @novasamatech/host-api: 0.8.4 (broken) vs 0.8.3 (works)
  • @novasamatech/host-api-wrapper: 0.8.4 (broken) vs 0.8.3 (works)
  • Host: Polkadot Desktop 0.4.1 (embeds host-api 0.8.0)
  • Product: paritytech/playground-app (pnpm dev at localhost:5173)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the handshake with host-api and host-api-wrapper 0.8.4 against an embedded 0.8.0 host, then compare with 0.8.3. Read transport.js:160-162 and the retry settings, followed by host-api-wrapper/papiProvider.js checkIfReady around lines 305-323. Done means the supported version pairing handshakes correctly and feature-check errors are not reported as unsupported chains.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
api, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.