Forward messages to floodsub peers#214
Merged
twoeths merged 2 commits intodapplion/gossipsubfrom Mar 23, 2022
Merged
Conversation
twoeths
commented
Mar 23, 2022
| peerStreams && | ||
| peerStreams.protocol === constants.FloodsubID && | ||
| this.score.score(id) >= this.opts.scoreThresholds.publishThreshold | ||
| ) { |
Contributor
Author
There was a problem hiding this comment.
Some notes
- If there is no floodsub peers, we save a loop through topic peers
- One difference is the check of
peersInTopic.has(id), master has this but rust-libp2p does not have
dapplion
approved these changes
Mar 23, 2022
twoeths
added a commit
that referenced
this pull request
Apr 5, 2022
* Add metrics and revamp logic Declare prometheus metrics in gossipsub Add missing metric labels Fix metrics types Add onReportValidation * Compile tests * Fix tests * Customize await policy * Run prettier on files * Relax heartbeat test condition * Re-add util package for browser testing * Remove unused dependencies * Add getMeshPeers * Fix rpc metric name * Improve metrics * More gossip promise metrics * Fix metrics typo * Clarify metrics names * Track metric of score deltas * Fix score metrics * Add buckets for gossipsub_score_cache_delta * Review PeerScore logic * Dump peer stats * Fix PeerStats constructor * Enable strict typescript checks * Fix compute-score logic * f * Fix peer stats types * Reenable go-gossipsub tests (#201) * Add checkReceivedSubscriptions * Add checkReceivedSubscriptions to 'test gossipsub multihops' * Add checkReceivedSubscriptions to 'test gossipsub tree topology' * test gossipsub star topology with signed peer records * Fix 'test gossipsub direct peers' * Fix 'test gossipsub flood publish' * Fix 'test gossipsub star topology with signed peer records' * 'direct peers' test: wait for subscriptions event again * 'direct peer': await for 2 peer:connect events * 'direct peers': add missing Promise.all * Expect topic peers to contain peer id * Fix test types * Set as connected in addPeer() * Prune publishedMessageIds * Fix markFirstMessageDelivery typo * Same logic in scoreMetrics * More metrics for p3 and p7 (#213) * Add behaviourPenalty metrics * Add duplicateMsgDelivery metric * Observe topic and peer in duplicateMsgDelivery topic * Remove peerId from duplicateMsgDelivery metric * Use min meshMessageDeliveriesWindow * Use topic label for duplicateMsgDelivery metric * Record duplicateMsgDelivery in all cases * Forward messages to floodsub peers (#214) * Forward messages to floodsub peers * Add comments Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com> * Add missing msgId in validateReceivedMessage (#215) * Fix 'test gossipsub opportunistic grafting' * Fix tests in browser * Fix tests suspended issue in browsers * Fix 'test gossipsub fanout expiry' go-gossipsub test * GossipsubIWantFollowupTime as a param (#216) * Increase resolution of delay metrics (#217) * Fix minMeshMessageDeliveriesWindow (#218) * Fix minMeshMessageDeliveriesWindow * Fix gossipsubIWantFollowupTime for metric * Fix tracer prune() * Change to maxMeshMessageDeliveriesWindow * Use maxMeshMessageDeliveriesWindowSec for metric * Rename gossipsubIWantFollowupMs option, revert/correct tracer.prune() logic * Reset behaviourPenalty histogram to track current count * publish(): return number of sent peers * Add getScore() * makePrune: update PeerStat so that we don't apply p3 penalty * Remove redundant this.score.prune() in heartbeat * Track iasked cache size per heartbeat and remove TODOs * validateReceivedMessage: check duplicate message first (#223) Co-authored-by: tuyennhv <vutuyen2636@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description