dual_open_control: check dualopend liveness before validating PSBT signatures#8979
Open
vincenzopalazzo wants to merge 2 commits intoElementsProject:masterfrom
Open
dual_open_control: check dualopend liveness before validating PSBT signatures#8979vincenzopalazzo wants to merge 2 commits intoElementsProject:masterfrom
vincenzopalazzo wants to merge 2 commits intoElementsProject:masterfrom
Conversation
9795d81 to
0575e36
Compare
…gnatures When the peer disconnects during the openchannel2_sign hook, the disconnect notification can race with the hook in plugins (e.g. funder), causing them to clean up state and return the PSBT unsigned. Previously the signature check ran first, logging a spurious BROKEN message before discovering that dualopend had already died. Move the dualopend liveness check before the PSBT validation: if the daemon is gone there is no point checking signatures since we cannot send them anyway. Fixes: ElementsProject#8902
…ect BROKEN Add test_inflight_dbload which triggers a disconnect at +WIRE_COMMITMENT_SIGNED during a dual-funded lease open. Before the fix in the previous commit, the disconnect notification race would cause a spurious 'Plugin must return a psbt with signatures' BROKEN log. Now only the expected 'dualopend daemon died' BROKEN appears.
0575e36 to
3a2f1a3
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.
Summary
openchannel2_signhook, the disconnect notification races with the hook in the funder plugin, causing it to clean up state and return the PSBT unsignedtest_inflight_dbloadregression test that triggers the race conditionFixes #8902
Changelog-None
Test plan
test_inflight_dbloadtriggers the disconnect race and verifies no spurious BROKEN from the signature check (only the expected daemon-death BROKEN)