Skip to content

fix(regtest): wait for LDK BOLT12 readiness#2152

Closed
thesimplekid wants to merge 2 commits into
cashubtc:mainfrom
thesimplekid:bolt12_regtest_fix
Closed

fix(regtest): wait for LDK BOLT12 readiness#2152
thesimplekid wants to merge 2 commits into
cashubtc:mainfrom
thesimplekid:bolt12_regtest_fix

Conversation

@thesimplekid

Copy link
Copy Markdown
Collaborator

Gate LN regtest startup on an actual LDK BOLT12 quote payment before\nrunning the test suite. Reconnect CLN to the restarted LDK mint node
avoid dropping the stopped setup node, which can panic in ldk-node 0.7.

Keep CLN fetchinvoice bounded with a Tokio timeout instead of sending the\nRPC timeout field, which CLN rejects when serialized as a float.

Description


Notes to the reviewers


Suggested CHANGELOG Updates

CHANGED

ADDED

REMOVED

FIXED


Checklist

  • I followed the code style guidelines
  • I ran just quick-check before committing
  • If the Wallet API was modified (added/removed/changed), I have reflected those changes in the FFI bindings (crates/cdk-ffi)

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c89f0f7403

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/cdk-integration-tests/src/ln_regtest/ln_client/cln_client.rs
Comment thread crates/cdk-integration-tests/src/bin/start_regtest_mints.rs Outdated
Comment thread crates/cdk-integration-tests/src/bin/start_regtest_mints.rs Outdated
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 365 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.56%. Comparing base (08fde41) to head (c3cd0d6).

Files with missing lines Patch % Lines
...k-integration-tests/src/bin/start_regtest_mints.rs 0.00% 116 Missing ⚠️
crates/cdk-integration-tests/src/init_regtest.rs 0.00% 105 Missing ⚠️
...ation-tests/src/ln_regtest/ln_client/cln_client.rs 0.00% 77 Missing ⚠️
...ation-tests/src/ln_regtest/ln_client/lnd_client.rs 0.00% 64 Missing ⚠️
...tes/cdk-integration-tests/src/bin/start_regtest.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2152      +/-   ##
==========================================
- Coverage   71.88%   71.56%   -0.32%     
==========================================
  Files         356      356              
  Lines       74532    74857     +325     
==========================================
- Hits        53574    53570       -4     
- Misses      20958    21287     +329     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Gate LN regtest startup on an actual LDK BOLT12 quote payment before\nrunning the test suite.
Reconnect CLN to the restarted LDK mint node
avoid dropping the stopped setup node, which can panic in ldk-node 0.7.

Keep CLN fetchinvoice bounded with a Tokio timeout instead of sending the\nRPC timeout field, which CLN rejects when serialized as a float.
@thesimplekid thesimplekid force-pushed the bolt12_regtest_fix branch 2 times, most recently from 59705c9 to 66b3fab Compare June 28, 2026 13:51
Retry the LDK-to-LND channel open until both sides report the expected active/usable channel. Validate the full LDK/CLN/LND topology before signaling regtest readiness, and include channel summaries when setup fails.

Retry CLN peer reconnect during BOLT12 readiness, reconnect CLN RPC after fetchinvoice timeouts, derive the LDK P2P port from the configured mint port, and preserve early regtest process exit status in the integration test wrapper.

For the LDK mint BOLT12 melt integration test, retry the melt with a fresh CLN single-use offer if the first outgoing BOLT12 payment attempt fails.
@thesimplekid thesimplekid deleted the bolt12_regtest_fix branch June 28, 2026 16:31
@github-project-automation github-project-automation Bot moved this from Backlog to Done in CDK Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant