Skip to content

Stop relying on a Cloneable NetworkGraph ref in DefaultRouter #3236

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

TheBlueMatt
Copy link
Collaborator

While there's not really much harm in requiring a Cloneable reference (they almost always are), it does make our bindings struggle a bit as they don't support multi-trait bounds (as it would require synthesizing a new C trait, which the bindings don't do automatically). Luckily, there's really no reason for it, and we can just call the DefaultMessageRouter directly when we want to route a message.

We've carried this patch for a while on the bindings branch, but there's not a strong reason it can't go upstream.

While there's not really much harm in requiring a `Clone`able
reference (they almost always are), it does make our bindings
struggle a bit as they don't support multi-trait bounds (as it
would require synthesizing a new C trait, which the bindings don't
do automatically). Luckily, there's really no reason for it, and we
can just call the `DefaultMessageRouter` directly when we want to
route a message.

We've carried this patch for a while on the bindings branch, but
there's not a strong reason it can't go upstream.
@TheBlueMatt TheBlueMatt added this to the 0.0.124 milestone Aug 12, 2024
Copy link

codecov bot commented Aug 12, 2024

Codecov Report

Attention: Patch coverage is 92.10526% with 3 lines in your changes missing coverage. Please review.

Project coverage is 89.73%. Comparing base (4950f3c) to head (9de7c1d).

Files Patch % Lines
lightning/src/onion_message/messenger.rs 94.11% 2 Missing ⚠️
lightning/src/routing/router.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3236      +/-   ##
==========================================
- Coverage   89.74%   89.73%   -0.01%     
==========================================
  Files         122      122              
  Lines      101903   101921      +18     
  Branches   101903   101921      +18     
==========================================
+ Hits        91455    91463       +8     
- Misses       7766     7770       +4     
- Partials     2682     2688       +6     

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

Copy link
Contributor

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

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

Yeah make sense! LGTM

@TheBlueMatt TheBlueMatt merged commit e4017c4 into lightningdevkit:main Aug 12, 2024
15 of 19 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.

3 participants