Ignore repeated invalid tx_signatures#3328
Merged
Merged
Conversation
When our peer sends us an invalid `tx_signatures`, we processed it and ignored the failure when we've already sent our own `tx_signatures`, because the transaction may be broadcast and may confirm anyway. We now stop processing those invalid `tx_signatures` repeatedly: if our peer sends us more than 3 invalid `tx_signatures` for a given funding transaction, they're definitely buggy so we'll just wait for the transaction to confirm without trying to obtain the fully signed one locally.
We don't need to write to the DB every time we receive `shutdown` from our peer, since the BOLTs require `shutdown` to be retransmitted on reconnection.
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.
This PR contains two completely unrelated commits, which add small performance improvements in cases where our peer is buggy or behaving strangely.
The first commit ensures that we stop unconditionally processing invalid
tx_signatures: after 3 invalid signatures, we simply ignore the next ones and wait for the corresponding transaction to eventually confirm.The second commit removes an unnecessary DB write during cooperative close: since
shutdownmust be retransmitted on reconnection, it didn't make sense to write it to the DB so often.