Skip to content

feat: gate mainnet probes on wallet readiness#167

Open
piotr-iohk wants to merge 3 commits into
mainfrom
feat/probe-readiness-support
Open

feat: gate mainnet probes on wallet readiness#167
piotr-iohk wants to merge 3 commits into
mainfrom
feat/probe-readiness-support

Conversation

@piotr-iohk
Copy link
Copy Markdown
Collaborator

@piotr-iohk piotr-iohk commented May 29, 2026

Part of synonymdev/bitkit-nightly#17

This PR gates the mainnet Lightning probe spec on real wallet readiness instead of a fixed stabilization delay. After restore, it polls the Android probeReadiness devtools command until the node is running, has a connected peer, a usable channel, healthy sync, and a non-thin network graph before probing. This addresses the ROUTE NOT FOUND / "Probe sending failed" failures caused by probing against an incomplete graph.

Summary

  • Adds waitForProbeReadiness() polling helper plus ProbeReadiness parsing/validation in test/helpers/probe.ts, surfacing device errors on timeout.
  • Wires the gate into test/specs/mainnet/probe.e2e.ts after the wallet-ready UI checks.
  • Records the readiness snapshot in probe-report.md and writes probe-readiness.json for diagnostics (consumed by the nightly Slack summary).
  • New tunables: PROBE_READINESS_TIMEOUT_MS, PROBE_READINESS_POLL_MS, PROBE_MIN_GRAPH_CHANNELS (default 10,000).

Test plan

  • Run @probe_mainnet against a mainnet build: readiness poll logs appear and probes start only once the graph is healthy.
  • Readiness snapshot appears in probe-report.md and probe-readiness.json.

Depends on the Android probeReadiness devtools command (synonymdev/bitkit-android).

Made with Cursor


Note

Low Risk
Test-only changes to E2E probe helpers and spec timing; no production app logic.

Overview
Mainnet Lightning probe E2E now waits for real node readiness after wallet restore instead of relying on a fixed stabilization delay. New helpers in test/helpers/probe.ts poll the Android devtools probeReadiness content call (override via PROBE_READINESS_METHOD) until peers, usable channels, sync health, and graph size meet thresholds—configurable via PROBE_READINESS_TIMEOUT_MS, PROBE_READINESS_POLL_MS, and PROBE_MIN_GRAPH_CHANNELS (default 10k channels).

The mainnet probe spec calls waitForProbeReadiness after waitForMainnetWalletReady and only then runs LNURL probes. Artifacts now include a readiness line in probe-report.md and optional probe-readiness.json for nightly diagnostics.

Reviewed by Cursor Bugbot for commit d1efef5. Bugbot is set up for automated code reviews on this repo. Configure here.

@piotr-iohk
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d1efef5. Configure here.

Comment thread test/helpers/probe.ts Outdated
cursoragent and others added 2 commits May 29, 2026 15:19
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
…t-fix-ef9f

Require positive value for PROBE_READINESS_TIMEOUT_MS
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.

2 participants