Skip to content
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

Merged
merged 7 commits into from
Feb 27, 2019

Conversation

codablock
Copy link

Instead of transmitting all the necessary information belonging to a signing session in every CBatchedSigShares and CSigSharesInv 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 for CSigSharesInv 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)

@UdjinM6 UdjinM6 added this to the 14.0 milestone Feb 26, 2019
UdjinM6
UdjinM6 previously approved these changes Feb 26, 2019
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@UdjinM6
Copy link

UdjinM6 commented Feb 27, 2019

Side note: should probably update DIP7 too.

@codablock
Copy link
Author

DIP7 needs to be rewritten in general when it comes to the P2P protocol. A lot has changed in the meantime...

@codablock
Copy link
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
Copy link
Author

Rebased and force-pushed after merge of #2725

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-utACK

@UdjinM6 UdjinM6 merged commit 5a61f7b into dashpay:develop Feb 27, 2019
@UdjinM6 UdjinM6 added the P2P Some notable changes on p2p level label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2P Some notable changes on p2p level
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants