Skip to content
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

Fix peer connect race #121

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

orbitalturtle
Copy link
Collaborator

@orbitalturtle orbitalturtle commented Jun 17, 2024

This PR tackles an issue that has popped up in bolt12-playground when paying Eclair offers.

If we need to connect directly to the introduction node, LNDK's onion messenger receives a PeerConnected event to process this new connection. When we first look at that new peer, the features map is empty, and LNDK decides onion support must be "false". This messes up future payment attempts, because the onion messenger thinks that this peer doesn't support onion messaging, and shouldn't be considered in future payment paths. To fix this, the first commit adds a little wait loop that looks for a non-empty map.

Copy link

codecov bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (dcb7f38) to head (3eeb40f).

Additional details and impacted files
@@          Coverage Diff           @@
##           master    #121   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files           1       1           
  Lines          97      97           
======================================
  Misses         97      97           

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

@orbitalturtle
Copy link
Collaborator Author

orbitalturtle commented Jun 18, 2024

Looks like the cltv expiry change breaks our itests. But that might be because our fork of ldk-sample, which we use for the integration tests, is woefully behind

EDIT: I confirmed this is because our fork of ldk-sample is behind. I'm removing the CLTV expiry commit and moving it to the transient-keys branch instead. Once #119 is in, we can merge that bug fix as well.

If we need to connect directly to the introduction node provided by an offer,
LNDK's onion messenger will receive a PeerConnected event to process this new
connection. When we first look at that new peer, the features map is empty,
and LNDK decides onion support must be "false". This botches future payment
attempts, because the onion messenger thinks that this peer doesn't support
onion messaging, and shouldn't be considered in future payment paths. To fix
this, we add a little wait loop that looks for a non-empty map.
@orbitalturtle orbitalturtle merged commit 5535413 into lndk-org:master Jul 18, 2024
10 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.

1 participant