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

feat: gossipsub 1.2: IDONTWANT #498

Merged
merged 8 commits into from
Sep 13, 2024
Merged

feat: gossipsub 1.2: IDONTWANT #498

merged 8 commits into from
Sep 13, 2024

Conversation

wemeetagain
Copy link
Member

@wemeetagain wemeetagain commented Aug 8, 2024

Add support for gossipsub 1.2, namely, IDONTWANT support.

Behavior

  • The first time a message is seen, prevalidation, send IDONTWANT to mesh peers (that aren't the sender and that support 1.2) if the message data is gte idontwantMinDataSize
  • Track per-heartbeat count of IDONTWANTs received from peers
  • Track IDONTWANTs received from peers, along with the heartbeat tick that the IDONTWANT was received
  • Prune IDONTWANT counts in the heartbeat
  • Prune tracked IDONTWANTs in the heartbeat, only keep IDONTWANTs for mcacheLength number of heartbeats
  • Prune IDONTWANT counts and tracked IDONTWANTs on peer removal
  • Prune IDONTWANT counts and tracked IDONTWANTs on stop
  • New metrics track sent / received IDONTWANT count and IDONTWANT count of messages we haven't yet received (to track the "savings" of IDONTWANT)

Configuration

  • new opts:
    • idontwantMinDataSize - The minimum message size in bytes to be considered for sending IDONTWANT messages. Below this, no IDONTWANT is sent. - default 512
    • idontwantMaxMessages - The maximum number of IDONTWANT messages per heartbeat per peer. IDONTWANTs received beyond this limit are ignored. - default 512
  • new metrics
    • gossipsub_rpc_sent_idontwant_total
    • gossipsub_idontwant_rcv_msgids_total
    • gossipsub_idontwant_rcv_dont_have_msgids_total

@wemeetagain wemeetagain requested a review from a team as a code owner August 8, 2024 20:35
@wemeetagain wemeetagain merged commit 5481add into master Sep 13, 2024
9 checks passed
@wemeetagain wemeetagain deleted the feat/idontwant branch September 13, 2024 15:04
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.

1 participant