Introduce "session announcements" and session IDs used in LLMQ P2P messages#2726
Merged
Conversation
|
Side note: should probably update DIP7 too. |
Author
|
DIP7 needs to be rewritten in general when it comes to the P2P protocol. A lot has changed in the meantime... |
Author
|
FYI, test failures seem to be unrelated to this PR and should be fixed by #2728 |
Needed as CBatchedSigShares doesn't have the necessary info anymore
Stop relying on the information previously found in the CSigSharesInv and CBatchedSigShares messages and instead use the information found in the session refereced by the session id. This also updates a few LogPrintf calls. Previously, CSigSharesInv::ToString also included the signHash in the returned string, which is not the case anymore, so we have to add it manually.
We're now directly calling the Merge/Set methods on the inventory objects.
codablock
force-pushed
the
pr_llmq_sessionids
branch
from
February 27, 2019 16:34
5322fc3 to
6ac49da
Compare
Author
|
Rebased and force-pushed after merge of #2725 |
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.
Instead of transmitting all the necessary information belonging to a signing session in every
CBatchedSigSharesandCSigSharesInvmessages, we will now assign session IDs to individual signing sessions and send an announcement with the necessary information before sending the inventory and batched sigs messages. After the announcemetn, we use the session ID to refer to the session information.This reduces the overhead in
CBatchedSigSharesfrom 97 bytes to 1-10 bytes (it's a VARINT). The overhead forCSigSharesInvis reduced from 33 bytes to 1-10 bytes.I decided to implement this optimization after observing a lot of traffic being caused by
CSigSharesInvmessages while doing load testing with LLMQ based InstantSend.I assume that in the old system the overhead would get more and more when bandwidth is low while load is high. The reason is that the system reverts to sending smaller but more frequent batches when bandwidth is low, resulting in queues to fill up and slowing down the system even more.
That problem is probably still there even with this optimization, but it should be less severe. I'll handle the actual problem in another PR (avoid sending small batches when nodes send buffers are non-empty)