Stricter batching of commit_sig
messages on the wire
#3083
Merged
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.
There has been a lot of discussion on the spec about how we should batch
commit_sig
messages during splices. We reached an agreement to guarantee that the messages are sent together, without any other message in-between. See lightning/bolts@b5b5572 for more details.Since our experimental splice version does not guarantee this, we start by:
commit_sig
messages, which is transparent for our peerscommit_sig
messages that may have other messages in-between, to support the current experimental version while preparing a world where we always batchstart_batch
message (but we keep backwards-compatibility support)This PR can be integrated right now, since it doesn't introduce any new spec messages or TLVs. I recommend reviewing it commit-by-commit (and read the commit messages). The first commit simply refactors the
TransportHandler
, because I initially hoped that we could support the batching there: but it turns out that because of our buffered reads of encrypted streams, this would be very complex, so I ended up handling batching inPeerConnection
, but I thought the refactoring was still useful. Let me know if I should just drop that first commit.