Skip to content

tests: Add interoperability tests for BOLT12 (Offers) with CLN#905

Open
alexgrad42 wants to merge 1 commit into
lightningdevkit:mainfrom
alexgrad42:feature/add_bolt12_scenario_coverage_to_interop_tests
Open

tests: Add interoperability tests for BOLT12 (Offers) with CLN#905
alexgrad42 wants to merge 1 commit into
lightningdevkit:mainfrom
alexgrad42:feature/add_bolt12_scenario_coverage_to_interop_tests

Conversation

@alexgrad42
Copy link
Copy Markdown

Activates scenarios for BOLT12 offer payments between ldk-node and Core Lightning (CLN) inside integration tests

Fix #856

@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented May 17, 2026

I've assigned @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@ldk-reviews-bot ldk-reviews-bot requested a review from tnull May 17, 2026 09:54
@alexgrad42 alexgrad42 force-pushed the feature/add_bolt12_scenario_coverage_to_interop_tests branch 2 times, most recently from bf29202 to bd238f7 Compare May 17, 2026 10:22
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 looking into this! Some comments.

Comment thread tests/common/scenarios/mod.rs Outdated

/// Blocks execution until the channel with the specified peer becomes active (`is_usable == true`).
/// Maximum wait time is 15 seconds (30 attempts with a 500ms interval).
pub(crate) async fn wait_for_channel_usable(node: &Node, counterparty_node_id: PublicKey) {
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.

We shouldn't use this manual sleep, we have events for that.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed

Comment thread tests/common/scenarios/mod.rs Outdated

/// Specialized version of `force_close_after_payment_scenario` for BOLT11 payments.
/// See [`force_close_after_payment_scenario`] for details.
pub(crate) async fn force_close_after_payment_bolt11_scenario<E: ElectrumApi>(
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.

I don't understand why we need all this additional boilerplate.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed. Note that BOLT11/BOLT12 scenarios are almost identical now. We can extract 11/12 step and run as prepayment->payment(this one id different)->postpayment chain on integration_tests_cln if you want.

Comment thread tests/common/scenarios/mod.rs Outdated
payment::send_bolt11_to_peer(node, peer, 5_000_000, "post-splice-bolt11").await;
},
PaymentProtocol::Bolt12 => {
// Wait for Onion Message router updates the channel to usable state.
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.

I don't think I understand what "Wait for Onion Message router updates the channel to usable state." means. Can you expand?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sorry, I think I've confused both of you and myself. My test were unstable, so I decided this is timing issue due to asynchronous nature of the peer-to-payer invoice delivery via messaging. In fact this seems to be my local WSL setup issue, and if it breaks splicing test, it does it for bolt11 too. Removed, please ignore

Comment thread tests/common/scenarios/mod.rs Outdated

/// Specialized version of `splice_in_scenario` for BOLT11 payments.
/// See [`splice_in_scenario`] for details.
pub(crate) async fn splice_in_bolt11_scenario<E: ElectrumApi>(
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.

Please avoid adding helper methods that are less than 5 lines of code.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed

@alexgrad42 alexgrad42 force-pushed the feature/add_bolt12_scenario_coverage_to_interop_tests branch 3 times, most recently from a41fc0a to bb198e7 Compare May 19, 2026 16:21
Activates scenarios for BOLT12 offer payments between
ldk-node and Core Lightning (CLN) inside integration tests

Fix lightningdevkit#856
@alexgrad42 alexgrad42 force-pushed the feature/add_bolt12_scenario_coverage_to_interop_tests branch from bb198e7 to a6eddd4 Compare May 19, 2026 17:35
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.

Add BOLT12 scenario coverage to interop test harness

3 participants