-
Notifications
You must be signed in to change notification settings - Fork 424
Follow-ups to #4227 (Part 1) #4289
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
base: main
Are you sure you want to change the base?
Follow-ups to #4227 (Part 1) #4289
Conversation
We recently began reconstructing ChannelManager::decode_update_add_htlcs on startup, using data present in the Channels. However, we failed to prune HTLCs from this rebuilt map if a given HTLC was already forwarded to the outbound edge (we pruned correctly if the outbound edge was a closed channel, but not otherwise). Here we fix this bug that would have caused us to double-forward inbound HTLC forwards.
No need to iterate through all entries in the map, we can instead pull out the specific entry that we want.
We are working on removing the requirement of regularly persisting the ChannelManager, and as a result began reconstructing the manager's decode_update_add_htlcs map from Channel data on startup in a recent PR. At the time, we implemented ChannelManager::read to prefer to use the newly reconstructed map, partly to ensure we have test coverage of the new map's usage. This resulted in a lot of code that would deduplicate HTLCs that were present in the old maps, adding extra complexity. Instead, prefer to use the old maps if they are present (which will always be the case in prod), but avoid writing the legacy maps in test mode so tests will always exercise the new paths.
|
👋 Hi! I see this is a draft PR. |
|
Going to take another look at this tomorrow before un-drafting it |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4289 +/- ##
==========================================
- Coverage 89.37% 89.33% -0.04%
==========================================
Files 180 180
Lines 139847 139821 -26
Branches 139847 139821 -26
==========================================
- Hits 124983 124910 -73
- Misses 12269 12333 +64
+ Partials 2595 2578 -17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Addresses a chunk of the feedback from #4227 (review) (#4280). Splitting it out for ease of review.