Skip to content

Introduce "session announcements" and session IDs used in LLMQ P2P messages#2726

Merged
UdjinM6 merged 7 commits into
dashpay:developfrom
codablock:pr_llmq_sessionids
Feb 27, 2019
Merged

Introduce "session announcements" and session IDs used in LLMQ P2P messages#2726
UdjinM6 merged 7 commits into
dashpay:developfrom
codablock:pr_llmq_sessionids

Conversation

@codablock

Copy link
Copy Markdown

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

@UdjinM6 UdjinM6 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

utACK

@UdjinM6

UdjinM6 commented Feb 27, 2019

Copy link
Copy Markdown

Side note: should probably update DIP7 too.

@codablock

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Author

Rebased and force-pushed after merge of #2725

@UdjinM6 UdjinM6 left a comment

Copy link
Copy Markdown

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