Repository navigation
Complete a handshake upon channel stop. - #1233
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A handshake protocol must invoke its handler one time, but
protocol_electrum_version,protocol_bitcoind_versionandprotocol_stratum_v2_setupdo so only fromfinished, which returns if the channel is stopped. A channel that stops before its opener never completes its handshake, so the session never unpends it, and it is retained with its request buffer until shutdown. This affects electrum, sparrow, bitcoind, btcd and stratum v2.protocol_version_106completes fromstopping. This does the same.Regtest on the November 25 masters, 200 connections closed before sending, per service: 7.65 MB retained per connection on electrum, sparrow, bitcoind and btcd, 24 KB on stratum v2, and none on esplora (no handshake). With this change growth stops within the first 100 connections on electrum and sparrow, and there is none on the others.
Depends on libbitcoin/libbitcoin-network#1065. Otherwise the second stop, by
session::handle_handshake, resets a client that is still sending when a pending handshake is stopped with an answer (e.g. 413).