-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Introduce "session announcements" and session IDs used in LLMQ P2P messages #2726
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
Side note: should probably update DIP7 too. |
DIP7 needs to be rewritten in general when it comes to the P2P protocol. A lot has changed in the meantime... |
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.
5322fc3
to
6ac49da
Compare
Rebased and force-pushed after merge of #2725 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-utACK
Instead of transmitting all the necessary information belonging to a signing session in every
CBatchedSigShares
andCSigSharesInv
messages, 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
CBatchedSigShares
from 97 bytes to 1-10 bytes (it's a VARINT). The overhead forCSigSharesInv
is reduced from 33 bytes to 1-10 bytes.I decided to implement this optimization after observing a lot of traffic being caused by
CSigSharesInv
messages 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)