Skip to content

Add interop integration test harness for LND, CLN, and Eclair#839

Open
febyeji wants to merge 1 commit intolightningdevkit:mainfrom
febyeji:interop-test-harness
Open

Add interop integration test harness for LND, CLN, and Eclair#839
febyeji wants to merge 1 commit intolightningdevkit:mainfrom
febyeji:interop-test-harness

Conversation

@febyeji
Copy link
Copy Markdown
Contributor

@febyeji febyeji commented Mar 24, 2026

Summary

Closes #766

Add a interop test harness for testing LDK-Node against external Lightning implementations (LND, CLN, Eclair).

What changed

  • ExternalNode trait (tests/common/external_node.rs): common interface for all external Lightning implementations (get_node_id, open_channel, create_invoice, close_channel, force_close, send_to_route, etc.)
  • Reusable scenario functions (tests/common/scenarios/): channel lifecycle, payments (bolt11, keysend, bidirectional, concurrent), disconnect/reconnect, expired invoice, fee-change close — plus a combo orchestrator that runs 16 disconnect×payment×close permutations
  • Refactored CLN/LND tests: replaced ~380 lines of duplicated inline logic with interop_tests!(setup_clients) macro that runs the full shared suite
  • New Eclair support: TestEclairNode impl, Dockerfile, docker-compose, CI workflow
  • Event macro timeouts: all expect_*_event! macros now timeout after 60s with a message identifying which event was expected, instead of hanging indefinitely
Implementation Image Version
CLN elementsproject/lightningd v25.12.1
LND lightninglabs/lnd v0.20.1-beta
Eclair acinq/eclair latest (0.14.0-SNAPSHOT)

Known issues

@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented Mar 24, 2026

🎉 This PR is now ready for review!
Please choose at least one reviewer by assigning them on the right bar.
If no reviewers are assigned within 10 minutes, I'll automatically assign one.
Once the first reviewer has submitted a review, a second will be assigned if required.

@tnull tnull self-requested a review March 24, 2026 15:55
@febyeji febyeji force-pushed the interop-test-harness branch 4 times, most recently from 8c1e94f to a50c9d0 Compare March 26, 2026 15:49
@ldk-reviews-bot
Copy link
Copy Markdown

🔔 1st Reminder

Hey @tnull! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

@febyeji febyeji force-pushed the interop-test-harness branch from a50c9d0 to 433515c Compare March 26, 2026 17:36
@febyeji febyeji marked this pull request as ready for review March 26, 2026 17:54
Copy link
Copy Markdown
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

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

Thanks, this already looks great on the first pass! I think we should get some minor things out of the way and then move forward with this so we can take advantage of the additional test coverage for our upcoming release already.

Some comments def. can be addressed in a follow-up (e.g. adding BOLT12 test coverage would be great).

febyeji added a commit to febyeji/ldk-node that referenced this pull request Mar 28, 2026
…setup

Address review feedback on PR lightningdevkit#839:
- Replace reqwest dependency with bitreq for Eclair REST client
- Replace curl shell calls with bitreq async HTTP requests
- Remove per-test docker container recreation (reuse single
  Eclair instance, unlock UTXOs between tests instead)
- Fix chmod -R 755 to u+rwX,go+rX in CLN/LND CI workflows
- Add --fail flag to curl readiness check in Eclair CI
@febyeji febyeji force-pushed the interop-test-harness branch from 433515c to 2613a3f Compare March 28, 2026 16:00
febyeji added a commit to febyeji/ldk-node that referenced this pull request Mar 28, 2026
…setup

Address review feedback on PR lightningdevkit#839:
- Replace reqwest dependency with bitreq for Eclair REST client
- Replace curl shell calls with bitreq async HTTP requests
- Remove per-test docker container recreation (reuse single
  Eclair instance, unlock UTXOs between tests instead)
- Fix chmod -R 755 to u+rwX,go+rX in CLN/LND CI workflows
- Add --fail flag to curl readiness check in Eclair CI
@febyeji febyeji force-pushed the interop-test-harness branch from 2613a3f to 9c2fbdc Compare March 28, 2026 16:06
febyeji added a commit to febyeji/ldk-node that referenced this pull request Mar 28, 2026
…setup

Address review feedback on PR lightningdevkit#839:
- Replace reqwest dependency with bitreq for Eclair REST client
- Replace curl shell calls with bitreq async HTTP requests
- Remove per-test docker container recreation (reuse single
  Eclair instance, unlock UTXOs between tests instead)
- Fix chmod -R 755 to u+rwX,go+rX in CLN/LND CI workflows
- Add --fail flag to curl readiness check in Eclair CI
@febyeji febyeji force-pushed the interop-test-harness branch from 9c2fbdc to 7420893 Compare March 28, 2026 16:21
@febyeji
Copy link
Copy Markdown
Contributor Author

febyeji commented Mar 28, 2026

Thanks for the review! Pushed an update addressing the feedback. Will address in follow-ups:

  • Move docker files to tests/docker/
  • Add BOLT12 scenario coverage

@tnull
Copy link
Copy Markdown
Collaborator

tnull commented Mar 30, 2026

Thanks for the review! Pushed an update addressing the feedback. Will address in follow-ups:

  • Move docker files to tests/docker/
  • Add BOLT12 scenario coverage

Thanks! Mind opening tracking issues for these so we don't forget?

Copy link
Copy Markdown
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

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

CI is failing right now:

thread 'test_eclair_cooperative_close_after_fee_change' (16127) panicked at tests/common/scenarios/channel.rs:275:55:
called `Result::unwrap()` on an `Err` value: ChannelClosingFailed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    test_eclair_cooperative_close_after_fee_change

@febyeji
Copy link
Copy Markdown
Contributor Author

febyeji commented Mar 30, 2026

@tnull Fixed the test_eclair_cooperative_close_after_fee_change CI failure! The remaining channel_full_cycle_with_vss_store failure is from VSS tests, and I believe a rerun could clear it. Also I opened the tracking issues for the follow-ups.

Copy link
Copy Markdown
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the feedback! Here are some more comments.

What stands out to me is that:

  1. This PR/the code is very verbose. It would be good to simplify and DRY up where possible to improve maintainability going forward.
  2. We currently ignore a lot of test cases, often for reasons that aren't conclusive to me (or seem outdated). Can we double-check whether we really can't make them work?

}

/// CLN v24.08+ includes a `payment_secret` in outbound keysend HTLCs.
/// LDK treats any inbound HTLC with `payment_secret` as a BOLT11 payment and
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.

Hmm, I'm not positive this is true? Could you un-ignore this so we can see what the error actually is? Is it related to the checks here?: https://github.com/lightningdevkit/rust-lightning/blob/db42ad6ba053d54f98f360f05afad5fee896ed69/lightning/src/ln/channelmanager.rs#L8479

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the keysend test, not force close. CLN's keysend plugin hardcodes min_final_cltv_expiry=22 (plugins/keysend.c:230), but LDK requires at least 42 (HTLC_FAIL_BACK_BUFFER(39) + 3). CLN's keysend RPC has no parameter to override this. Keeping ignored until CLN adds a final_cltv parameter.

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.

This is the keysend test, not force close.

I'm confused what you mean by that?

CLN's keysend plugin hardcodes min_final_cltv_expiry=22 (plugins/keysend.c:230), but LDK requires at least 42 (HTLC_FAIL_BACK_BUFFER(39) + 3). CLN's keysend RPC has no parameter to override this. Keeping ignored until CLN adds a final_cltv parameter.

Okay, interesting, but that seems an entirely different issue than originally described in the comment / PR description? Or am I confused? The comment now says "needs CLN upstream fix", but are they even aware of the issue and agreed it should be fixed?

Copy link
Copy Markdown
Contributor Author

@febyeji febyeji Apr 6, 2026

Choose a reason for hiding this comment

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

This is the keysend test, not force close.

Sorry for the confusing wording, I think I misread your original comment as asking about a different test.
You're right that there's no upstream CLN issue filed for this.

The min_final_cltv_expiry=22 hardcoding in plugins/keysend.c is something I found by reading CLN source, but I haven't confirmed whether the CLN team considers it a bug. will un-ignored the test so we can see the actual error in CI.

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.

febyeji added a commit to febyeji/ldk-node that referenced this pull request Apr 2, 2026
…setup

Address review feedback on PR lightningdevkit#839:
- Replace reqwest dependency with bitreq for Eclair REST client
- Replace curl shell calls with bitreq async HTTP requests
- Remove per-test docker container recreation (reuse single
  Eclair instance, unlock UTXOs between tests instead)
- Fix chmod -R 755 to u+rwX,go+rX in CLN/LND CI workflows
- Add --fail flag to curl readiness check in Eclair CI
febyeji added a commit to febyeji/ldk-node that referenced this pull request Apr 2, 2026
Update test infrastructure to Bitcoin Core 29.0:
- corepc-node feature: 27_2 → 29_0
- electrsd feature: corepc-node_27_2 → corepc-node_29_0
- download script: bitcoind 27.2 → 29.0 with updated SHA256 hashes

Prerequisite for lightningdevkit#839 (interop test harness)
which needs bitcoind 29.0 for compatibility with updated Docker images.
febyeji added a commit to febyeji/ldk-node that referenced this pull request Apr 2, 2026
Update test infrastructure to Bitcoin Core 29.0:
- corepc-node: 0.10.0 → 0.10.1, feature 27_2 → 29_0
- electrsd feature: corepc-node_27_2 → corepc-node_29_0
- download script: bitcoind 27.2 → 29.0 with updated SHA256 hashes

Prerequisite for lightningdevkit#839 (interop test harness).
febyeji added a commit to febyeji/ldk-node that referenced this pull request Apr 3, 2026
…setup

Address review feedback on PR lightningdevkit#839:
- Replace reqwest dependency with bitreq for Eclair REST client
- Replace curl shell calls with bitreq async HTTP requests
- Remove per-test docker container recreation (reuse single
  Eclair instance, unlock UTXOs between tests instead)
- Fix chmod -R 755 to u+rwX,go+rX in CLN/LND CI workflows
- Add --fail flag to curl readiness check in Eclair CI
@febyeji febyeji force-pushed the interop-test-harness branch 2 times, most recently from f039418 to 96517d1 Compare April 6, 2026 08:08
@febyeji
Copy link
Copy Markdown
Contributor Author

febyeji commented Apr 6, 2026

Pushed an update addressing all review feedback. I've replied with details on each change. While I was writing comments, GitHub seems to have posted some duplicate ones. I've since deleted them, so please ignore any notifications from those.

@febyeji febyeji force-pushed the interop-test-harness branch 2 times, most recently from 1bc1de3 to 54fc858 Compare April 7, 2026 07:04
Bump test dependencies, reorganize Docker files, and add interop
integration test infrastructure with shared scenario runner for CLN,
LND, and Eclair.
@febyeji febyeji force-pushed the interop-test-harness branch from 54fc858 to 10d4cd8 Compare April 7, 2026 07:22
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.

Rewrite integration test harness ensuring interop with CLN, Eclair, and LND

3 participants