You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
yarn workspace @dashevo/wasm-sdk test:functional should pass against the
local dashmate network started by ./.github/actions/local-network. This job
runs as Packages functional tests / Run functional tests in CI whenever version-changed=true (release bumps + any PR touching root Cargo.toml).
Current Behavior
Every WASM SDK functional test fails with the same root error:
grpc error: code: 'Unknown error', message: "protocol error: missing
grpc-status trailer, stream was terminated without a final status
(possible truncation by a proxy or load balancer)"
84 tests fail; 18 raw trailer errors and 74 downstream "no available
addresses to use" / 10 "expected null to exist" cascades — all from the
same underlying issue.
Wallet + SDK functional tests (yarn workspace @dashevo/wallet-lib test:functional and yarn workspace dash test:functional) pass against
the same gateway endpoint (https://127.0.0.1:2443) in the same job, just
before the WASM SDK suite runs.
Possible Solution
The WASM SDK uses tonic_web_wasm_client::Client (see packages/rs-dapi-client/src/transport/wasm_channel.rs:16), which speaks gRPC-Web over fetch and expects trailers encoded as a final 0x80-prefixed body frame. JS Wallet/SDK functional tests use native gRPC
over HTTP/2 (real HTTP trailers) and work fine.
Most likely the dashmate local gateway either:
Doesn't apply envoy's grpc_web filter at the 2443 listener, so
responses come back as native gRPC with HTTP/2 trailers (invisible to fetch).
Has middleware between dapi and the gateway that strips the body-frame
trailer.
Possible fix paths (any one):
Server: enable/repair envoy grpc_web filter on the local-network
gateway so trailers are emitted as the body frame tonic-web-wasm-client
expects.
Client: switch the WASM SDK's transport to a non-fetch-based path
when running under Node (e.g. tonic over native HTTP/2 in cfg(not(target_arch = "wasm32")) mode, which the rs-dapi-client crate
already has — extend it to cover the Node-mocha + WASM build).
CI: scope the WASM SDK functional run to a nightly-only job and
unblock release-bump PRs. Least preferred — defeats the test.
Steps to Reproduce (for bugs)
Check out any commit where Packages functional tests is triggered
(any release-bump on v3.1-dev, or a PR that bumps the workspace Cargo.toml version).
CI runs Packages functional tests / Run functional tests.
The Run WASM SDK functional tests step fails with the trailer error
above; the local network is already up at this point (Start local network succeeded; Run Wallet functional tests and Run SDK functional tests both passed against the same gateway).
Confirmed-reproducing CI runs:
v3.1-dev 2e6fc3270e (CHANGELOG-only release-bump) — run 26205709462
This is a pre-existing issue that surfaces on every release-bump CI
run and any PR that bumps a workspace Cargo.toml version. It blocks
release-bump checks from going green.
Cascade detail: dashmate local has a single dapi seed at 127.0.0.1:2443.
The first WASM SDK call fails with the trailer error, rs-dapi-client bans
the seed in its retry pool, and every subsequent test in the same WasmSdk instance fails immediately with "no available addresses to
use". Tests with their own before all create-ops then produce a
secondary "expected null to exist" cascade.
Cross-network sanity check (not yet done — would isolate client vs
server): point the WASM SDK functional tests at testnet via prefetchTestnet() to see whether the same client code works against a
gateway known to handle gRPC-Web framing correctly.
Your Environment
Branch: v3.1-dev (tip 2e6fc3270e at filing time)
CI workflow: .github/workflows/tests-packges-functional.yml → step Run WASM SDK functional tests
Local network: dashmate composite action .github/actions/local-network/action.yaml
Transport: packages/rs-dapi-client/src/transport/wasm_channel.rs uses tonic_web_wasm_client::Client (gRPC-Web over fetch)
Test entry: packages/wasm-sdk/tests/functional/**/*.spec.ts,
invoked via mocha + ts-node/esm, gateway URL https://127.0.0.1:2443 (from default_local_addresses() in packages/wasm-sdk/src/sdk.rs:22)
Tracking branch already created for the fix attempt: fix/wasm-sdk-functional-grpc-web-trailer
Expected Behavior
yarn workspace @dashevo/wasm-sdk test:functionalshould pass against thelocal dashmate network started by
./.github/actions/local-network. This jobruns as Packages functional tests / Run functional tests in CI whenever
version-changed=true(release bumps + any PR touching rootCargo.toml).Current Behavior
Every WASM SDK functional test fails with the same root error:
84 tests fail; 18 raw trailer errors and 74 downstream "no available
addresses to use" / 10 "expected null to exist" cascades — all from the
same underlying issue.
Wallet + SDK functional tests (
yarn workspace @dashevo/wallet-lib test:functionalandyarn workspace dash test:functional) pass againstthe same gateway endpoint (
https://127.0.0.1:2443) in the same job, justbefore the WASM SDK suite runs.
Possible Solution
The WASM SDK uses
tonic_web_wasm_client::Client(seepackages/rs-dapi-client/src/transport/wasm_channel.rs:16), which speaksgRPC-Web over
fetchand expects trailers encoded as a final0x80-prefixed body frame. JS Wallet/SDK functional tests use native gRPCover HTTP/2 (real HTTP trailers) and work fine.
Most likely the dashmate local gateway either:
grpc_webfilter at the2443listener, soresponses come back as native gRPC with HTTP/2 trailers (invisible to
fetch).trailer.
Possible fix paths (any one):
grpc_webfilter on the local-networkgateway so trailers are emitted as the body frame
tonic-web-wasm-clientexpects.
fetch-based pathwhen running under Node (e.g. tonic over native HTTP/2 in
cfg(not(target_arch = "wasm32"))mode, which the rs-dapi-client cratealready has — extend it to cover the Node-mocha + WASM build).
unblock release-bump PRs. Least preferred — defeats the test.
Steps to Reproduce (for bugs)
Packages functional testsis triggered(any release-bump on
v3.1-dev, or a PR that bumps the workspaceCargo.tomlversion).Packages functional tests / Run functional tests.Run WASM SDK functional testsstep fails with the trailer errorabove; the local network is already up at this point (
Start local networksucceeded;Run Wallet functional testsandRun SDK functional testsboth passed against the same gateway).Confirmed-reproducing CI runs:
2e6fc3270e(CHANGELOG-only release-bump) — run 26205709462Context
run and any PR that bumps a workspace
Cargo.tomlversion. It blocksrelease-bump checks from going green.
test(wasm-sdk): fix flaky functional tests during local network warmup) addressed a warmup race inprefetchLocalReady()butnot this trailer issue.
127.0.0.1:2443.The first WASM SDK call fails with the trailer error, rs-dapi-client bans
the seed in its retry pool, and every subsequent test in the same
WasmSdkinstance fails immediately with "no available addresses touse". Tests with their own
before allcreate-ops then produce asecondary "expected null to exist" cascade.
server): point the WASM SDK functional tests at testnet via
prefetchTestnet()to see whether the same client code works against agateway known to handle gRPC-Web framing correctly.
Your Environment
v3.1-dev(tip2e6fc3270eat filing time).github/workflows/tests-packges-functional.yml→ stepRun WASM SDK functional tests.github/actions/local-network/action.yamlpackages/rs-dapi-client/src/transport/wasm_channel.rsusestonic_web_wasm_client::Client(gRPC-Web overfetch)packages/wasm-sdk/tests/functional/**/*.spec.ts,invoked via mocha +
ts-node/esm, gateway URLhttps://127.0.0.1:2443(fromdefault_local_addresses()inpackages/wasm-sdk/src/sdk.rs:22)Tracking branch already created for the fix attempt:
fix/wasm-sdk-functional-grpc-web-trailer