Skip to content

Require directional updates for a DirectionalChannelInfo #1815

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

We currently construct DirectedChannelInfos for routing before
checking if the given direction has its directional info filled in.
We then always check for directional info before actually deciding
to route over a channel, as otherwise we assume the channel is not
online.

This makes for somewhat redundant checks, and DirectedCHannelInfo
isn't, by itself, a very useful API. Because fetching the HTLC-max
or effective channel capacity gives spurious data if no directional
info is available, there's little reason to have that data
available, and so we here check for directional info first. This
effectively merges DirectionalChannelInfo and
DirectionalChannelInfoWithUpdate.

@codecov-commenter
Copy link

codecov-commenter commented Oct 29, 2022

Codecov Report

Base: 90.72% // Head: 90.74% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (4df0ff7) compared to base (6957fb6).
Patch coverage: 91.66% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1815      +/-   ##
==========================================
+ Coverage   90.72%   90.74%   +0.02%     
==========================================
  Files          87       87              
  Lines       47361    47336      -25     
  Branches    47361    47336      -25     
==========================================
- Hits        42968    42957      -11     
+ Misses       4393     4379      -14     
Impacted Files Coverage Δ
lightning/src/routing/router.rs 91.71% <75.00%> (+0.09%) ⬆️
lightning/src/routing/gossip.rs 92.44% <91.66%> (+0.28%) ⬆️
lightning/src/routing/scoring.rs 96.61% <100.00%> (ø)
lightning/src/ln/functional_tests.rs 97.03% <0.00%> (+0.02%) ⬆️
lightning/src/ln/peer_channel_encryptor.rs 93.62% <0.00%> (+0.24%) ⬆️
lightning/src/util/events.rs 38.40% <0.00%> (+0.26%) ⬆️
lightning-net-tokio/src/lib.rs 77.03% <0.00%> (+0.30%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@TheBlueMatt TheBlueMatt changed the title Require both directional updates for a DirectionalChannelInfo Require directional updates for a DirectionalChannelInfo Oct 29, 2022
We currently construct `DirectedChannelInfo`s for routing before
checking if the given direction has its directional info filled in.
We then always check for directional info before actually deciding
to route over a channel, as otherwise we assume the channel is not
online.

This makes for somewhat redundant checks, and `DirectedCHannelInfo`
isn't, by itself, a very useful API. Because fetching the HTLC-max
or effective channel capacity gives spurious data if no directional
info is available, there's little reason to have that data
available, and so we here check for directional info first. This
effectively merges `DirectionalChannelInfo` and
`DirectionalChannelInfoWithUpdate`.
Because we now never generate an `EffectiveCapacity` with an
`htlc_maximum_msat` set to `None`, making it non-`Option`al
effectively removes dead code, which we do here.
@TheBlueMatt TheBlueMatt force-pushed the 2022-10-dead-gossip-code branch from 064bfe2 to 4df0ff7 Compare October 29, 2022 20:39
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