Skip to content

Prepare USDT fixtures and Paykit peer for E2E journeys - #276

Merged
piotr-iohk merged 8 commits into
mainfrom
feat/usdt-e2e-fixture
Oct 12, 2026
Merged

piotr-iohk merged 8 commits into
mainfrom
feat/usdt-e2e-fixture

Conversation

@ben-kaufman

@ben-kaufman ben-kaufman commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Prepare USDT journeys for the existing Appium suite. USDT_INFRA_REVISION pins the Docker Compose fixture from synonymdev/bitkit-docker#25, including the gateway built from merged synonymdev/bitkit-usdt-service#4. The launcher fetches that exact revision and builds the images. The Shop profile includes the matching seller-setup fix in pubky/pubky-marketplace#167 and per-rail verifier in pubky/locks#75. Existing staging VSS, Pubky and rate services remain in use.

The pinned fixture works within Alchemy Free capabilities: paced/cached archive reads, throttling retries and local-only payment history. It skips pre-fork mainnet logs; the provider monthly quota still applies.

The iOS build helper embeds the fixture endpoints. Shared test helpers validate the selected fixture, reverse Android's gateway port, fund wallets, control inclusion/failures and drive bridge scenarios. The real SDK peer supports USDT-only or mixed endpoints, fixed/per-period quotes, deadlines, request claim/acceptance, proof submission and authenticated evidence export.

README and docs/usdt-e2e.md contain setup, selectors and the journey matrix. Use USDT-enabled builds from iOS #884 and Android #1432 or their descendants. No mobile or Core source change is required for the test setup.

Validation:

  • TypeScript, changed-file ESLint/Prettier and shell syntax passed. The exact-commit launcher built the pinned merged-service stack; the TypeScript helper validated its endpoints, funded a local wallet, checked its exact balance and mined blocks.
  • The pinned infrastructure passed fixture lint/eight tests, direct payment/proof/incoming-history/fresh-database recovery and bridge/refund smoke suites. Earlier checks covered lifecycle isolation and private Shop RPC connectivity.
  • Cold startup and both smoke suites passed under enforced free-tier limits (300 CU/s, 10-block log requests, no paid-only APIs), including 429 retries. Cache reuse and the exact-pin launcher/funding/mining helpers passed. This used the existing endpoint behind a validation guard, not an actual Free account.
  • The unchanged SDK peer previously passed Rust fmt/clippy and seven tests. Disposable staging peers exchanged an encrypted request, acceptance and proof verified against the local Core receipt, plus recurring request acceptance and period-quote delivery.
  • Android was exercised locally for direct receive/send/details, restart and incoming Polygon bridge states.
  • Local Shop seller setup, authenticated readiness, content-lock creation and Android test funding passed. Paid checkout/content unlock remains untested after skipping listing image upload; a clean full-stack Shop rebuild also needs more than the current 8 GB Docker memory.
  • Full-repository lint still reports 260 errors in 20 files, and formatting reports three files. Every affected file is byte-identical to the PR base; there are no introduced lint/format findings.

This provides infrastructure, peer commands and controls. Piotr still needs to author/run the full Android/iOS wallet, contact/request/subscription, VSS recovery, paid Shop and bridge UI journeys and wire them into Docker-capable CI. Contracts execute locally; Pimlico pricing/signing and external Orchestra/LayerZero delivery are simulated. Production provider behavior needs separate live acceptance.

@ben-kaufman
ben-kaufman force-pushed the feat/usdt-e2e-fixture branch from fcf2914 to 14d77d2 Compare October 11, 2026 02:45
@ben-kaufman
ben-kaufman marked this pull request as ready for review October 11, 2026 05:19

@talosmachina talosmachina left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings. Pins the bitkit-docker USDT fixture by commit and adds a launcher that fetches it. Adds TypeScript helpers for funding, inclusion, provider and bridge controls, and has the iOS build embed the USDT_* endpoints. The Paykit fixture peer gains USDT and mixed endpoints, recurrence, per-period quotes, payment deadlines, accept/proof/quote commands and evidence export. Reviewed d2eb0e0, full tier.

What I checked, and 5 candidates I ruled out

Read in full: scripts/usdt-fixture, test/helpers/usdt.ts, the scripts/build-ios-sim.sh hunk, tools/paykit-fixture-sender/src/main.rs. Lockfile not reviewed.
Ran here: cargo test --locked for the fixture peer (7/7 pass, including the two new USDT/recurrence tests against the real rc71 SDK), with a stripped environment.
Not run: the helpers against a live fixture (needs the archive RPC), and any Appium spec (none added).
CI: no checks reported on this branch.

Ruled out

  • The pinned USDT_INFRA_REVISION disappears when synonymdev/bitkit-docker#25 is squash-merged: GitHub still serves a fetch by SHA through refs/pull/25/head.
  • prepareUsdtFixture rejects valid env: status.urls.gateway uses the same USDT_GATEWAY_PORT that Compose passes to the fixture and that env prints.
  • evidence output is not parseable JSON: the issuer line moved to eprintln!, so stdout carries only the JSON.
  • A preset combined with --per-period silently keeps fixed rates: it fails loudly at per-period quotes cannot have fixed request rates.
  • send publishes only the Bitcoin endpoint: it now syncs every endpoint in the validated terms.

Merge confidence: 4/5, the helpers and launcher were not exercised against a live fixture here, and no CI runs on this branch.

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the fixture peer and pushed a fix in 6f9ea08: the USDT endpoint payload was missing chain_id and token, which both native apps require. Added those fields and test assertions, and updated the Docker revision pin to include the image-tag fix.

Peer tests and TypeScript checks passed, and the corrected payload was verified in the offline preview. Android/iOS testing against the running stack is still pending.

@ben-kaufman

Copy link
Copy Markdown
Collaborator Author

@piotr-iohk I've updated this and Docker #25 so the normal USDT setup doesn't need paid Alchemy features.

We now skip mainnet logs from before the fork, keep all payments made locally, and pace/cache the RPC reads. I tested sends, receives, proofs, history recovery and the bridge scenarios with free-tier limits enforced, including rate-limit retries. Everything passed. This used our existing key with those limits enforced, rather than an actual free account.

No setup changes for you beyond pulling the latest revisions and rebuilding. A Free Arbitrum RPC URL should be enough within its quota. Your app flows and helpers stay the same; testing old mainnet wallet history is outside this local setup.

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA review

Scope: Full review of the complete pull request diff against merge base 492dbfcc, at 3b2db84. There is no inherited baseline.

No new actionable code findings.

The pinned fixture 9e32a22 fetches with the launcher's git fetch --depth 1 origin <sha>. prepareUsdtFixture() compares the four app routes to status.urls.gateway (http://127.0.0.1:$USDT_GATEWAY_PORT), which matches usdt-fixture env, and reverses that published gateway port on Android. The sender's USDT endpoint (usdt-arbitrum-address, string chain_id 42161, token 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9) matches the draft parsers on bitkit-android#1432 (56e1c321) and bitkit-ios#884 (554f116). Evidence payer/payee values strip a normal pubky + 52-character key the same way as PaykitPublicKeys.raw in paykit-rs e4e58d3. Those drafts were checked only for this contract.

Validation: The full diff and the pinned fixture control API were inspected. bash -n passed for scripts/usdt-fixture and scripts/build-ios-sim.sh. This PR adds no Appium specs. The Docker fixture, sender cargo test, and devices were not run. Local Rust is 1.83; the sender asks for 1.91.1. This branch has no GitHub checks. App wallet, contact, Shop, and bridge UI journeys remain the follow-up described in the PR. Build those draft apps with BACKEND=regtest after eval "$(./scripts/usdt-fixture env)".

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved as USDT test setup and helpers, following the current-head QA review. The pinned local fixture passed checks, payment smoke and bridge smoke. Mobile/Appium, VSS restore and paid Shop acceptance remain follow-up work.

@piotr-iohk
piotr-iohk merged commit d1b68bb into main Oct 12, 2026
@piotr-iohk
piotr-iohk deleted the feat/usdt-e2e-fixture branch October 12, 2026 15:54
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.

3 participants