splice: prevent splice going to onchaind & race prevention - #6564
Merged
rustyrussell merged 2 commits intoAug 16, 2023
Conversation
ddustin
force-pushed
the
ddustin/splice_close_fix
branch
from
August 14, 2023 17:03
8b76aff to
5869458
Compare
Contributor
|
This broke everything? test_splice.py is now timing out on every run. You need to write some real tests. |
ddustin
force-pushed
the
ddustin/splice_close_fix
branch
3 times, most recently
from
August 15, 2023 01:36
ce20c0c to
0917e8e
Compare
Collaborator
Author
ddustin
force-pushed
the
ddustin/splice_close_fix
branch
2 times, most recently
from
August 15, 2023 02:38
15949ba to
6cd14d4
Compare
Don’t send the funding spend to onchaind if we detect it in inflights (aka. a splice). While we already prevented onchaind_funding_spent from being called directly, the call to wallet_channeltxs_add meant onchaind_funding_spent would be called *anyway* on restart. This is now fixed. Additionally there was a potential for a race problem depending on the firing order of the channel depth and and funding spent events. Instead of requiring these events fire in a specific order, we make a special “memory only” inflight object to prevent the race regardless of firing order. Changelog-Fixed: Splice: bugfix for restart related race condition interacting with adversarial close detection.
Add a regression check for Issue ElementsProject#6533
ddustin
force-pushed
the
ddustin/splice_close_fix
branch
from
August 15, 2023 04:39
6cd14d4 to
7d54716
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Don’t send the funding spend to onchaind if we detect it in inflights (aka. a splice). While we already prevented onchaind_funding_spent from being called directly, the call to wallet_channeltxs_add meant onchaind_funding_spent would be called anyway on restart. This is now fixed.
Additionally there was a potential for a race problem depending on the firing order of the channel depth and and funding spent events.
Instead of requiring these events fire in a specific order, we make a special “memory only” inflight object to prevent the race regardless of firing order.
Fixes #6533