-
Notifications
You must be signed in to change notification settings - Fork 265
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
Add quiescence negotiation #2680
Commits on Jul 24, 2023
-
Configuration menu - View commit details
-
Copy full SHA for e7d08a7 - Browse repository at this point
Copy the full SHA e7d08a7View commit details -
Updated with suggested initial fixes
- only use quiescence if both nodes signal the feature - reduce timeout to 1 min - use message type 2 for `stfu` - Use feature bits 34/35 for option_quiesce a per spec
Configuration menu - View commit details
-
Copy full SHA for 9fa2135 - Browse repository at this point
Copy the full SHA 9fa2135View commit details -
It's not a prototype, it matches the official (in-progress) specification.
Configuration menu - View commit details
-
Copy full SHA for 98b3286 - Browse repository at this point
Copy the full SHA 98b3286View commit details -
Use a boolean for the `initiator` field.
Configuration menu - View commit details
-
Copy full SHA for 3e6e4e4 - Browse repository at this point
Copy the full SHA 3e6e4e4View commit details -
Rework forbidden splice messages
Add more traits to the `SpliceStatus` hierarchy, which lets us simplify some of the pattern matching used in the `Channel` actor. Send a `warning` and disconnect if we receive a forbidden message while we're splicing, which lets us gracefully deal with buggy peers without losing channels.
Configuration menu - View commit details
-
Copy full SHA for 491487c - Browse repository at this point
Copy the full SHA 491487cView commit details -
Include splicing in the quiescence timeout
Being quiescent for too long is dangerous, because HTLCs may timeout without giving the opportunity to our peer to send us a preimage. Splicing operations shouldn't take long to complete, so we include that in the quiescence timeout, and disconnect if the splice wasn't completed in time. This makes sure we replay pending commands and avoid getting the channel stuck if the interactive-tx isn't making progress.
Configuration menu - View commit details
-
Copy full SHA for 26ad317 - Browse repository at this point
Copy the full SHA 26ad317View commit details -
The spec says we must not send duplicate `stfu`, but doesn't have any requirement on the receiver. If we receive a duplicate `stfu`, it's perfectly fine to just ignore it: the protocol will either correctly complete or will be canceled by the quiescence timeout.
Configuration menu - View commit details
-
Copy full SHA for 8b233f7 - Browse repository at this point
Copy the full SHA 8b233f7View commit details -
This function was called in only one place, so it's not avoiding code duplication. It could make sense to isolate the logic, but in the case of event handlers in the highly critical channel FSM, we usually like to inline transition and state changes to make it easier to review the code linearly (no need to jump back and forth between function calls). I also renamed `isIdle` to `isQuiescent` to remove confusion.
Configuration menu - View commit details
-
Copy full SHA for b8cec0f - Browse repository at this point
Copy the full SHA b8cec0fView commit details -
Refactor
handleNewSplice
and a few nitsIn channel event handlers, we try to leave all the logic that updates the current state or data directly in the event handler instead of delegating it to helper functions, otherwise it's a bit hard to see all the state transitions that can happen when receiving a given message. I changed the `handleNewSplice` function to be a pure function instead that just creates the `splice_init` message (or returns an error). I also refactored some nits.
Configuration menu - View commit details
-
Copy full SHA for e7c16a9 - Browse repository at this point
Copy the full SHA e7c16a9View commit details -
Update handling of forbidden messages during a normal splice
- now returns a warning (and disconnects) instead of force closing
Configuration menu - View commit details
-
Copy full SHA for 464569b - Browse repository at this point
Copy the full SHA 464569bView commit details -
Change so non-initiator is quiescent once they send stfu
- initiator still remains in the negotiating state until they receive stfu from the non-initiator - also, simplify tests for forbidden messages
Configuration menu - View commit details
-
Copy full SHA for ec26dab - Browse repository at this point
Copy the full SHA ec26dabView commit details -
Remove redundant fail malformed htlc tests
- fail htlc tests are sufficient
Configuration menu - View commit details
-
Copy full SHA for a42f6cb - Browse repository at this point
Copy the full SHA a42f6cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for fce95c6 - Browse repository at this point
Copy the full SHA fce95c6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1fc1c9c - Browse repository at this point
Copy the full SHA 1fc1c9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b40fce - Browse repository at this point
Copy the full SHA 7b40fceView commit details -
Configuration menu - View commit details
-
Copy full SHA for d250f39 - Browse repository at this point
Copy the full SHA d250f39View commit details
Commits on Jul 26, 2023
-
Configuration menu - View commit details
-
Copy full SHA for a31a96f - Browse repository at this point
Copy the full SHA a31a96fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 316f770 - Browse repository at this point
Copy the full SHA 316f770View commit details
Commits on Jul 27, 2023
-
Group tests and remove unused functions
This commit contains almost no functional changes, we just group together and reorder tests, remove unused code and remove the default value for `sendInitialStfu` (which makes tests matrixes easier to read).
Configuration menu - View commit details
-
Copy full SHA for be10434 - Browse repository at this point
Copy the full SHA be10434View commit details -
Test quiescence requested state
We were missing a test for the case where we request quiescence when we still have pending changes to apply.
Configuration menu - View commit details
-
Copy full SHA for 5704162 - Browse repository at this point
Copy the full SHA 5704162View commit details -
Configuration menu - View commit details
-
Copy full SHA for 38115be - Browse repository at this point
Copy the full SHA 38115beView commit details -
Configuration menu - View commit details
-
Copy full SHA for a5747be - Browse repository at this point
Copy the full SHA a5747beView commit details -
There are two scenarios to test: - one of our outgoing HTLC times out - one of our incoming HTLC is close to timing out and we have the preimage
Configuration menu - View commit details
-
Copy full SHA for 1f6af5d - Browse repository at this point
Copy the full SHA 1f6af5dView commit details -
Configuration menu - View commit details
-
Copy full SHA for f51710e - Browse repository at this point
Copy the full SHA f51710eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7082c4a - Browse repository at this point
Copy the full SHA 7082c4aView commit details