-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
htlcswitch: log fixes #4107
htlcswitch: log fixes #4107
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great series of bug fixes! The diff looks pretty good to me, only comments pertain to populating the commit messages of each of the commits as bit more, as the PR body won't be committed to our git history.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM barring roasbeef's comments, could also use a squash 👍
96dcf55
to
be2fbc5
Compare
This commit changes the fallback in NextLocalHtlcIndex to RemoteCommitment since the LocalHtlcIndex field lags behind on the LocalCommitment. Without this bug fix, open circuits would get prematurely trimmed, resulting in more erroneous logs. A test case is included to check that the fix works.
This commit modifies updateCommitTx to error with ErrLinkShuttingDown when we try to send a ContractUpdate on the htlcUpdates chan and the link has closed the quit chan. It also changes the order of the call to ackDownStreamPackets and contract update call for consistency since the packets should be acknowledged before the link goes down.
This commit changes the switch to only log an error if update_fail_htlc comes in and closeCircuit returns ErrUnknownCircuit. Rationale being that only settles should hit this code path, anything else is a result of a link flap and should be treated as an error.
be2fbc5
to
8c0c53e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🦋
This PR fixes the error log intro'd in #3143 when pipelining settles to the switch, and makes logging less spammy and more informative. The PR breakdown is as follows:
NextLocalHtlcIndex
toRemoteCommitment
sinceLocalCommitment
lags behind for theLocalHtlcIndex
field. Without this bug fix, open circuits could get prematurely trimmed, resulting in more error logs. A test case is included to check that the fix works.ErrLinkShuttingDown
so that the link logs when it's getting shut down. Also changes the order of theackDownStreamPackets
and check-if-link-quit call for consistency since the packets should be ACKed before going down.update_fail_htlc
comes in andcloseCircuit
returnsErrUnknownCircuit
. Rationale being that only settles should hit this code path, anything else is a result of a link flap.Closes #3656