-
Notifications
You must be signed in to change notification settings - Fork 281
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
GossipSub v1.4: Message preamble + IMReceiving notification to considerably reduce bandwidth & latency for large messages #654
base: master
Are you sure you want to change the base?
Conversation
… and IMReceiving message
Shouldnt this be v1.3? |
Actually, there was an open PR with v1.3, the idea was to set an appropriate number once its considered ready for merge |
ok, fair enough. |
|
||
The purpose of the preamble is to allow receivers to instantly learn about the incoming message. | ||
The preamble must include the message ID and length, | ||
providing receivers with immediate access to critical information about the incoming message. |
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.
One issue is that as of the protobuf schema is designed, you will have to download the whole message in order to access the preamble. If you look at how control messages are represented in the rpc message:
https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/gossipsub-v1.0.md#protobuf
https://github.com/libp2p/specs/tree/master/pubsub#the-rpc
It is numbered after our full published message. So you would have to download the whole message before you can access the preamble.
Nvm, I misunderstood this. The preamble is a rpc message sent separately beforehand
### IMReceiving Message | ||
|
||
The IMReceiving message serves a distinct purpose compared to the IDONTWANT message. | ||
An IDONTWANT can only be transmitted after receiving the entire message. |
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.
While I understand the distinction here of IMReceiving
compared with IDONTWANT
and having this broadcasted earlier, how effective would this be in practice ? One issue we have seen is that an actual control message takes a while to be processed by the gossip router even after it has been received due to HOL blocking. So by the time you process the control message, the actual message might already be sent by your mesh peers.
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.
For the scenarios we tested, sending IMReceiving
significantly increases the probability of mesh peers being able to stop unnecessary message sends since enough IMReceiving
go through in time.
Still, definitely something we will look out for in our experiments, and check for scenarios where HOL might have a severe impact. We also have have Ethereum focused tests and analyses on the roadmap.
With QUIC as a transport and multiplexer, we can further reduce the HOL impact.
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.
For the scenarios we tested, sending IMReceiving significantly increases the probability of mesh peers being able to stop unnecessary message sends since enough IMReceiving go through in time.
Is there more information on the scenarios tested ? Ex: How many different topics nodes were subscribed to along with how many messages were being published per second on these topics.
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.
While I understand the distinction here of
IMReceiving
compared withIDONTWANT
and having this broadcasted earlier, how effective would this be in practice ? One issue we have seen is that an actual control message takes a while to be processed by the gossip router even after it has been received due to HOL blocking. So by the time you process the control message, the actual message might already be sent by your mesh peers.
Yes, that is why we still see duplicates, averaging around 1.8 per peer in the network. Proper prioritization of preamble/IDONTWANTs should further lower the number of duplicates.
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.
Is there more information on the scenarios tested ? Ex: How many different topics nodes were subscribed to along with how many messages were being published per second on these topics.
All (1500) peers were subscribed to a single topic. Twelve messages were introduced, each by a different publisher, with each publisher waiting 3 seconds before sending the next message. Messages larger than 600 KB take more time to reach all peers, building outgoing message queues at many peers.
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.
The problem with this is that there is no limit on the number of IWANTs you can send for the same message. Thus, you send an IWANT to each of the nodes that send an IHAVE with a message ID that you haven't received (yet). This should be limited to an |
Let me suggest this alternative using IDONTWANT instead of introducing the new IAMRECEIVING message:
This requires another IWANT in case a message is not delivered. |
Yes, that is one big issue!
Yes, this is part of the solution, but it also requires that replying to IWANT requests be made mandatory (at least for large messages), and preamble can further limit IWANT requests! |
It is already "mandatory": not replying to a received IWANT message penalizes your score.
I'd be keen to have some small upgrades like this one before jumping into something bigger. |
While the fundamental purpose of IDONTWANT messages is: However, the use of IDONTWANT messages can be tailored to serve any of the following two purposes:
|
This extension considerably reduces bandwidth utilization and network-wide message dissemination time for large messages.
Problem with existing approach (GossipSub v1.2):
Solution (Proposed extension):
More context available here