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
manual-test-swap-roundtrip.sh (Scenario A) fails on master with ASSERT FAIL (proposal-ingest-timeout) — bob does not receive alice's swap proposal within the 90s budget. The same soak script, against the same testnet+escrow, passes green end-to-end when sphere-cli loads a pre-#534/#536 sphere-sdk (commit 8c7d93d).
Surfaced while validating trader-service#29 (PR vrogojin/trader-service#32). Independent of #29; my code changes are confined to trader-service.
A/B test result
Two consecutive runs of bash manual-test-swap-roundtrip.sh SCENARIO=A KEEP=1 differing only in which sphere-sdk checkout sphere-cli/node_modules/@unicitylabs/sphere-sdk symlinks to:
current master (post-#534/#536) with freshly-built dist
FAIL — proposal-ingest-timeout; bob saw No swaps found for the full 90s window; reproduced twice
The diff between the two checkouts is exclusively #534 (fix(oracle,soak): payments.validate() always reported invalid + stale swap-soak escrow) + #536 (fix(swap)(sphere-sdk#535): use state-transition-sdk primitives for verifyPayout) — see git diff 8c7d93d HEAD -- '*.ts' (12 files, +1074/-127).
This contradicts the assertion in vrogojin/trader-service#29 that the swap-CLI soak validated #536 end-to-end. Either that validation was incomplete (e.g. did not include the cross-process Nostr-DM ingest step of manual-test-swap-roundtrip.sh), or something has regressed since.
Failure mode is divergent between daemon and CLI consumers
Same SDK delta, different observed symptom depending on consumer:
So pre-#534/#536 the CLI's sphere swap wait --state completed reaches completed successfully, while the daemon's auto-verify loop hangs. The two consumers exercise the validation gate differently:
daemon = long-running, drives verifyPayout directly via its auto-retry loop
The wait command may bypass or short-circuit the validation gate that the daemon's polling loop hits. Worth understanding both paths before locking in either #534 or #536's behavior.
Repro
# Working tree assumed: sphere-cli/node_modules/@unicitylabs/sphere-sdk is a symlink# to whichever sphere-sdk checkout you want to test.# Pin to pre-#534/#536:
ln -sfn /path/to/sphere-sdk-at-8c7d93d sphere-cli/node_modules/@unicitylabs/sphere-sdk
( cd /path/to/sphere-sdk-at-8c7d93d && npm run build )
rm -rf /tmp/swap-soak && SWAP_TEST_DIR=/tmp/swap-soak SCENARIO=A KEEP=1 \
bash manual-test-swap-roundtrip.sh
# → ALL GREEN — swap round-trip succeeded (Scenario A)# Pin to master (post-#534/#536):
ln -sfn /path/to/sphere-sdk-at-master sphere-cli/node_modules/@unicitylabs/sphere-sdk
( cd /path/to/sphere-sdk-at-master && npm run build )
rm -rf /tmp/swap-soak && SWAP_TEST_DIR=/tmp/swap-soak SCENARIO=A KEEP=1 \
bash manual-test-swap-roundtrip.sh
# → ASSERT FAIL (proposal-ingest-timeout) after 90s
Workspace preserved at /tmp/swap-soak for log inspection.
Pin sphere-cli's @unicitylabs/sphere-sdk symlink to commit 8c7d93d (pre-#534/#536). Trader-service's daemon is not currently green against any sphere-sdk version, so the workaround restores the swap-CLI soak only.
Summary
manual-test-swap-roundtrip.sh(Scenario A) fails on master withASSERT FAIL (proposal-ingest-timeout)— bob does not receive alice's swap proposal within the 90s budget. The same soak script, against the same testnet+escrow, passes green end-to-end when sphere-cli loads a pre-#534/#536 sphere-sdk (commit8c7d93d).Surfaced while validating trader-service#29 (PR vrogojin/trader-service#32). Independent of #29; my code changes are confined to trader-service.
A/B test result
Two consecutive runs of
bash manual-test-swap-roundtrip.sh SCENARIO=A KEEP=1differing only in which sphere-sdk checkoutsphere-cli/node_modules/@unicitylabs/sphere-sdksymlinks to:8c7d93d(pre-#534, pre-#536)completed, poison-pill scan cleanproposal-ingest-timeout; bob sawNo swaps foundfor the full 90s window; reproduced twiceThe diff between the two checkouts is exclusively #534 (
fix(oracle,soak): payments.validate() always reported invalid + stale swap-soak escrow) + #536 (fix(swap)(sphere-sdk#535): use state-transition-sdk primitives for verifyPayout) — seegit diff 8c7d93d HEAD -- '*.ts'(12 files, +1074/-127).This contradicts the assertion in vrogojin/trader-service#29 that the swap-CLI soak validated #536 end-to-end. Either that validation was incomplete (e.g. did not include the cross-process Nostr-DM ingest step of
manual-test-swap-roundtrip.sh), or something has regressed since.Failure mode is divergent between daemon and CLI consumers
Same SDK delta, different observed symptom depending on consumer:
sphere-cli(CLI, short-lived processes) with post-fix(oracle,soak): payments.validate() always reported invalid; stale swap-soak escrow #534/fix(swap)(sphere-sdk#535): use state-transition-sdk primitives for verifyPayout #536: dies at PROPOSAL DELIVERY. Bob'ssphere swap list --role acceptorreturns empty for 90s. The swap never reachesverifyPayoutbecause bob never sees the proposal.trader-service(daemon, long-lived process) with pre-fix(oracle,soak): payments.validate() always reported invalid; stale swap-soak escrow #534/fix(swap)(sphere-sdk#535): use state-transition-sdk primitives for verifyPayout #536: dies at PAYOUT VERIFICATION. The deal accepts, the swap executes, the escrow pays out, butverifyPayoutloops on"L3 validation found N invalid token(s) covering this payout invoice — retry after wallet sync"for the full 900s budget. (Observed when I rebuilt trader image against the pre-fix(oracle,soak): payments.validate() always reported invalid; stale swap-soak escrow #534/fix(swap)(sphere-sdk#535): use state-transition-sdk primitives for verifyPayout #536 sibling sphere-sdk; pre-existing failure mode fix(swap)(sphere-sdk#535): use state-transition-sdk primitives for verifyPayout #536 was meant to eliminate.)sphere-cli(CLI) with pre-fix(oracle,soak): payments.validate() always reported invalid; stale swap-soak escrow #534/fix(swap)(sphere-sdk#535): use state-transition-sdk primitives for verifyPayout #536: passes green — the verifyPayout retry loop documented inpayout-verifier.ts's file header does NOT fire here.So pre-#534/#536 the CLI's
sphere swap wait --state completedreachescompletedsuccessfully, while the daemon's auto-verify loop hangs. The two consumers exercise the validation gate differently:verifyPayoutdirectly via its auto-retry loopsphere swap waitThe wait command may bypass or short-circuit the validation gate that the daemon's polling loop hits. Worth understanding both paths before locking in either #534 or #536's behavior.
Repro
Workspace preserved at
/tmp/swap-soakfor log inspection.Investigation candidates
a063d4b7) and re-run; apply fix(swap)(sphere-sdk#535): use state-transition-sdk primitives for verifyPayout #536 alone (8b1955a9) and re-run. Quickly narrows which one introduced the proposal-delivery regression.sphere swap waitskip validation that the daemon hits? Compare the verify-trigger sequence in both consumers. The CLI's pre-fix(oracle,soak): payments.validate() always reported invalid; stale swap-soak escrow #534/fix(swap)(sphere-sdk#535): use state-transition-sdk primitives for verifyPayout #536 green-completion suggests the wait command isn't running the samepayments.validate()invariant the daemon's auto-verify loop is. If true, fix(oracle,soak): payments.validate() always reported invalid; stale swap-soak escrow #534's validate() fix has different blast radius across consumers.Workaround (until root cause lands)
Pin sphere-cli's
@unicitylabs/sphere-sdksymlink to commit8c7d93d(pre-#534/#536). Trader-service's daemon is not currently green against any sphere-sdk version, so the workaround restores the swap-CLI soak only.Related