Skip to content

Accept Trailers-Only gRPC responses from lightwalletd - #7

Open
sqhell wants to merge 2 commits into
red-dev-inc:mainfrom
sqhell:fix/grpc-web-trailers-only
Open

sqhell wants to merge 2 commits into
red-dev-inc:mainfrom
sqhell:fix/grpc-web-trailers-only

Conversation

@sqhell

@sqhell sqhell commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Pins tonic-web-wasm-client to v0.8.0 plus upstream PR #113 (cherry-picked onto the 0.8.0 release on sqhell/tonic-web-wasm-client, branch fix/trailers-only-v0.8.0), which accepts an empty body with the grpc-status in the HTTP headers.

Why

Every new wallet failed its first sync with Error while communicating with lightwalletd server: ... "malformed response" during "Refreshing UTXOs". GetAddressUtxosStream returns no items for an account without transparent UTXOs, and lightwalletd behind Envoy's grpc-web filter sends that as a Trailers-Only response, which the grpc-web spec allows but 0.8.0 reported as malformed (upstream issue #99). 0.9.x carries the fix but needs newer wasm-bindgen pins than this workspace has.

Reproducible without a browser: curl -X POST https://zjs.zec.rocks/mainnet/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressUtxosStream -H 'content-type: application/grpc-web+proto' --data-binary @req.bin -D - answers 200 with grpc-status: 0 in the headers and content-length: 0.

Stack

Position 3 of 15 in the WebZjs release order, to be merged in this order into main. Independent of the feature PRs but rebased on #20 (chore/rust-checks) so its checks are green; the commits of this PR alone are here: sqhell/WebZjs@chore/rust-checks...fix/grpc-web-trailers-only

  1. Make rustfmt and clippy pass on main #20 chore/rust-checks
  2. Reuse one web worker for every sync instead of spawning per call #6 fix/reuse-sync-worker
  3. Accept Trailers-Only gRPC responses from lightwalletd #7 fix/grpc-web-trailers-only (this PR)
  4. Keep the Full Resync form usable during background syncs #8 fix/resync-dialog
  5. Send again from the transaction history, with a caution for new recipients #9 feat/send-again
  6. Surface PCZT parse and signer errors instead of trapping; readable transfer errors #10 fix/pczt-parse-error
  7. Sign the change-paired Orchard spends NU6.3 bundles require #11 fix/sign-change-paired-spends
  8. Stop a full resync from an old birthday exhausting the wasm heap #12 fix/historic-sync-oom
  9. Point to Full Resync from the end of the transaction history #13 feat/history-resync-hint
  10. Make wallet persistence refuse stale and silent overwrites #14 fix/wallet-store-epochs
  11. Spend and count the Ironwood (NU6.3) pool #15 feat/ironwood-pool
  12. Classify history by what the wallet spent, not only by what it received #16 fix/history-from-spends
  13. Wallet stats card on the account summary #17 feat/wallet-stats
  14. Bounded sync steps, instance ids, close and worker poisoning #18 feat/resumable-sync
  15. Resumable, checkpointed full resync driven by sync steps #19 feat/resync-resume

Rust pins reference sqhell/zcash_client_memory and sqhell/librustzcash by revision so CI builds exactly what was tested; once the zcash_client_memory stack (red-dev-inc/zcash_client_memory #16 to #21) merges, the memory pin goes back to red-dev-inc/zcash_client_memory feat/snap-nu63. The integration branch test/all-fixes on the fork merges all fourteen and is the build that was tested end to end.

Tests

just build

Rust-Checks has failed on main since the NU6.3 toolchain bump: rustfmt
differs in nine files, and clippy on nightly-2025-06-15 rejects ten
uninlined format arguments in webzjs-keys and one map iteration in
webzjs-requests under -D warnings. Apply rustfmt and clippy's own
suggestions; no behaviour changes.
Every new wallet failed to sync with:

    Syncing Error: Error while communicating with lightwalletd server:
    code: 'Unknown error', message: "malformed response"

during "Refreshing UTXOs". GetAddressUtxosStream returns no items for an
account without transparent UTXOs, and lightwalletd (grpc-go) behind
Envoy's grpc-web filter sends that as a Trailers-Only response: the
grpc-status lives in the HTTP headers and the body is empty. The
grpc-web spec allows it, but tonic-web-wasm-client 0.8.0 reports an
empty body as MalformedResponse (upstream issue #99, fixed by the
unreleased PR #113).

Pin tonic-web-wasm-client to v0.8.0 plus that fix, cherry-picked onto
the 0.8.0 release because 0.9.x needs newer wasm-bindgen pins than this
workspace carries. Reproducible without a browser:

    curl -X POST https://zjs.zec.rocks/mainnet/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressUtxosStream \
      -H 'content-type: application/grpc-web+proto' --data-binary @req.bin -D -

answers 200 with grpc-status: 0 in the headers and content-length: 0.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant