Skip to content

Pass supported_protocols to LSPS0 (fix ListProtocols support) #3785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

martinsaposnic
Copy link
Contributor

This PR fixes an issue where LSPS0 was always receiving an empty vector instead of the actual supported_protocols list. Now, LSPS0 gets the correct supported_protocols, so it can properly handle ListProtocols requests.

It also adds an integration test to verify that LSPS0::ListProtocols works as expected.

(Not sure if the empty vector was intentional or just overlooked? cc @tnull)

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented May 19, 2025

👋 Thanks for assigning @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.

Copy link

codecov bot commented May 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.77%. Comparing base (18eb30b) to head (822fa89).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3785      +/-   ##
==========================================
- Coverage   89.79%   89.77%   -0.02%     
==========================================
  Files         159      159              
  Lines      128672   128672              
  Branches   128672   128672              
==========================================
- Hits       115540   115519      -21     
- Misses      10463    10468       +5     
- Partials     2669     2685      +16     

☔ View full report in Codecov by Sentry.
📢 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.

@ldk-reviews-bot ldk-reviews-bot requested a review from wpaulino May 19, 2025 22:51
@wpaulino wpaulino requested review from tnull and removed request for wpaulino May 20, 2025 00:13
Copy link
Contributor

@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.

Good catch, thank you!

One comment, otherwise LGTM

protocols,
}) => {
assert_eq!(counterparty_node_id, client_node_id);
assert_eq!(protocols, vec![2]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, note that you'll account for cfg(lsps1_service) here, too.

@ldk-reviews-bot
Copy link

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

@ldk-reviews-bot ldk-reviews-bot requested a review from wpaulino May 20, 2025 09:30
@ldk-reviews-bot
Copy link

✅ Added second reviewer: @wpaulino

@martinsaposnic martinsaposnic force-pushed the lsps0-supported-protocols branch from edc4688 to 88c2ea0 Compare May 20, 2025 11:33
let lsps1_service_config = LSPS1ServiceConfig { supported_options: None, token: None };
let service_config = LiquidityServiceConfig {
#[cfg(lsps1_service)]
lsps1_service_config,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is also still slightly off, having CI fail:

error[E0308]: mismatched types
  --> lightning-liquidity/tests/lsps0_integration_tests.rs:27:3
   |
27 |         lsps1_service_config,
   |         ^^^^^^^^^^^^^^^^^^^^ expected `Option<LSPS1ServiceConfig>`, found `LSPS1ServiceConfig`
   |
   = note: expected enum `std::option::Option<LSPS1ServiceConfig>`
            found struct `LSPS1ServiceConfig`
help: try wrapping the expression in `Some`
   |
27 |         lsps1_service_config: Some(lsps1_service_config),
   |         +++++++++++++++++++++++++++                    +

For more information about this error, try `rustc --explain E0308`.
error: could not compile `lightning-liquidity` (test "lsps0_integration_tests") due to 1 previous error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@martinsaposnic martinsaposnic force-pushed the lsps0-supported-protocols branch from 88c2ea0 to 822fa89 Compare May 20, 2025 15:15
@tnull tnull merged commit 22908ab into lightningdevkit:main May 21, 2025
28 checks passed
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.

4 participants