Commit Graph

8 Commits

Author SHA1 Message Date
Elle Mouton
c2923e2214
multi: remove PrefixLog
And instead use the new btclog Logger `WithPrefix` method.
2024-11-27 10:44:32 +02:00
Keagan McClelland
127e4fff28
htlcswitch: add logging to quiescer 2024-11-26 14:13:44 -07:00
Keagan McClelland
ac0c24aa7b
htlcswitch: don't pass pending update counts into quiescer
This change simplifies some of the quiescer responsibilities in
favor of making the link check whether or not it has a clean state
to be able to send or receive an stfu. This change was made on the
basis that the only use the quiescer makes of this information is
to assess that it is or is not zero. Further the difficulty of
checking this condition in the link is barely more burdensome than
selecting the proper information to pass to the quiescer anyway.
2024-11-26 14:13:43 -07:00
Keagan McClelland
a4c49a88f1
htlcswitch: add quiescence timeout that is aborted by Resume 2024-11-26 14:13:43 -07:00
Keagan McClelland
48ee643c0d
htlcswitch: implement noop quiescer
In this commit we implement a noop quiescer that we will use when
the feature hasn't been negotiated. This will make it far easier to
manage quiescence operations without having a number of if statements
in the link logic.
2024-11-26 13:52:54 -07:00
Keagan McClelland
4fbab45a5f
htlcswitch: defer processRemoteAdds when quiescent
In this commit we defer processRemoteAdds using a new mechanism on
the quiescer where we capture a closure that needs to be run. We
do this because we need to avoid the scenario where we send back
immediate resolutions to the newly added HTLCs when quiescent as
it is a protocol violation. It is not enough for us to simply defer
sending the messages since the purpose of quiescence itself is to
have well-defined and agreed upon channel state. If, for whatever
reason, the node (or connection) is restarted between when these
hooks are captured and when they are ultimately run, they will
be resolved by the resolveFwdPkgs logic when the link comes back
up.

In a future commit we will explicitly call the quiescer's resume
method when it is OK for htlc traffic to commence.
2024-11-26 13:52:53 -07:00
Keagan McClelland
7255b7357c
htlcswitch: implement InitStfu link operation 2024-11-26 13:51:57 -07:00
Keagan McClelland
f5b7866287
htlcswitch: define state machine for quiescence
htlcswitch: add sendOwedStfu method to quiescer
2024-11-26 13:51:46 -07:00