Skip to content

Ignore repeated invalid tx_signatures#3328

Merged
t-bast merged 2 commits into
masterfrom
perf-improvements
Jul 17, 2026
Merged

Ignore repeated invalid tx_signatures#3328
t-bast merged 2 commits into
masterfrom
perf-improvements

Conversation

@t-bast

@t-bast t-bast commented Jul 17, 2026

Copy link
Copy Markdown
Member

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 shutdown must be retransmitted on reconnection, it didn't make sense to write it to the DB so often.

t-bast added 2 commits July 17, 2026 15:16
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.
@t-bast
t-bast requested a review from pm47 July 17, 2026 13:36

@pm47 pm47 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@t-bast
t-bast merged commit 823341e into master Jul 17, 2026
1 check passed
@t-bast
t-bast deleted the perf-improvements branch July 17, 2026 13:49
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.

2 participants