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

Drop PeerManager type bound on UtxoLookup entirely #2822

Merged
merged 1 commit into from Jan 11, 2024

Conversation

TheBlueMatt
Copy link
Collaborator

In 6765967 we relaxed the bounds set on UtxoLookup to enable those using RoutingMessageHandler other than P2PGossipSync to use UtxoLookup. Sadly, because this requires having a concrete PeerManager type which does not use UtxoLookup in the RoutingMessageHandler type, this broke users who were directly using P2PGossipSync.

We could split UtxoLookup into two, with different bounds, for the two use-cases, but instead here we simply switch to storing a reference to the PeerManager via a dyn Fn which allows us to wake the PeerManager when we need to.

Fixes #2813

In 6765967 we relaxed the bounds
set on `UtxoLookup` to enable those using `RoutingMessageHandler`
other than `P2PGossipSync` to use `UtxoLookup`. Sadly, because this
requires having a concrete `PeerManager` type which does *not* use
`UtxoLookup` in the `RoutingMessageHandler` type, this broke users
who were directly using `P2PGossipSync`.

We could split `UtxoLookup` into two, with different bounds, for
the two use-cases, but instead here we simply switch to storing a
reference to the `PeerManager` via a `dyn Fn` which allows us to
wake the `PeerManager` when we need to.

Fixes lightningdevkit#2813
@codecov-commenter
Copy link

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (4deb263) 88.49% compared to head (3703399) 89.19%.
Report is 41 commits behind head on main.

Files Patch % Lines
lightning-block-sync/src/gossip.rs 0.00% 7 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2822      +/-   ##
==========================================
+ Coverage   88.49%   89.19%   +0.69%     
==========================================
  Files         114      114              
  Lines       91935    98339    +6404     
  Branches    91935    98339    +6404     
==========================================
+ Hits        81359    87714    +6355     
- Misses       8097     8202     +105     
+ Partials     2479     2423      -56     

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

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.

LGTM, but we should document how we expect the callback to work.

lightning-block-sync/src/gossip.rs Show resolved Hide resolved
@tnull tnull merged commit cd5f09b into lightningdevkit:main Jan 11, 2024
14 of 15 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.

Cannot use SimpleArcPeerManager-GossipVerifier combo due to circular type dependency
4 participants