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

Idonthave #1

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Idonthave #1

wants to merge 10 commits into from

Conversation

chaitanyaprem
Copy link
Owner

Attempt to continue this PR libp2p#553

  • just rebased with 1.2
  • add a feature test to not send IDONTWANT if the other side doesnt support it
  • Need to address review comments in original PR

ppopth and others added 10 commits August 7, 2024 10:22
Since we want to implement a priority queue later, we need to replace
the normal sending channels with the new smart structures first.
UrgentPush allows you to push an rpc packet to the front of the queue so
that it will be popped out fast.
Most importantly, this commit adds a new method called PreValidation to
the interface PubSubRouter, which will be called right before validating
the gossipsub message.

In GossipSubRouter, PreValidation will send the IDONTWANT controll
messages to all the mesh peers of the topics of the received messages.
When receiving IDONTWANTs, the host should remember the message ids
contained in IDONTWANTs using a hash map.

When receiving messages with those ids, it shouldn't forward them to the
peers who already sent the IDONTWANTs.

When the maximum number of IDONTWANTs is reached for any particular
peer, the host should ignore any excessive IDONTWANTs from that peer.
If the messages IDs received from IDONTWANTs are older than 3
heartbeats, they should be removed from the IDONTWANT cache.
Rather than keeping the raw message ids, keep their hashes instead to
save memory and protect again memory DoS attacks.
@chaitanyaprem chaitanyaprem self-assigned this Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants