Commit Graph

148 Commits

Author SHA1 Message Date
vyzo adad40c764 reraise GossipSubPrunePeers to 16
so that bootstrappers can give us a good enough chunk of peers to connect to.
2020-04-18 11:09:06 +03:00
vyzo 71ab9c1d73 use a struct for aggregating score thresholds 2020-04-18 11:09:06 +03:00
vyzo f6f34cfc99 make PX optional and disabled by default, gate by acceptPXThreshold 2020-04-18 11:09:06 +03:00
vyzo 8a5114c127 fix rebase artifacts 2020-04-18 11:09:06 +03:00
vyzo 90e6984148 track heartbeat ticks, only clear backoff every 15. 2020-04-18 11:09:06 +03:00
vyzo f70dcbe77c check exact expiration date of backoff when pruning because of backoff 2020-04-18 11:09:06 +03:00
vyzo 6bcaacd74b add backoff when pruning because of negative score 2020-04-18 11:09:06 +03:00
vyzo 15d204cc14 refresh backoff when pruning during the backoff period 2020-04-18 11:09:06 +03:00
vyzo d0979258f7 shuffle IWANT list 2020-04-18 11:09:06 +03:00
vyzo 244a39f419 validate the threshold values 2020-04-18 11:09:06 +03:00
vyzo d5e432a62b move score starting nil check inside the score implementation 2020-04-18 11:09:06 +03:00
vyzo ff89a0e619 short-circuit score computation in peer selection filters 2020-04-18 11:09:06 +03:00
vyzo 39e65e8729 peer score parameter validation 2020-04-18 11:09:06 +03:00
vyzo 8d82c2bdec explicit Start for peer scoring to inject the router
so that we can unit test without a router.
2020-04-18 11:09:06 +03:00
vyzo 31a279b9f0 limit message retransmissions through IWANT requests 2020-04-18 11:09:06 +03:00
vyzo f9d29c47b6 adaptive gossip dissemination 2020-04-18 11:09:06 +03:00
vyzo 8fb6924f7c select good peers for PX, tune the px related limits 2020-04-18 11:09:06 +03:00
vyzo 2ddc4b999f allow gossipsub to graylist peers based on score 2020-04-18 11:09:06 +03:00
vyzo 87bbe69a8b router.Publish doesn't need the source, it takes the whole message now 2020-04-18 11:09:06 +03:00
vyzo 75fd8826af backoff when we prune too, refuse to reGRAFT backed off peers 2020-04-18 11:09:06 +03:00
vyzo 56dbe5dc8a increase D_score to 4 2020-04-18 11:09:06 +03:00
vyzo 69e4102a6d correctly implement flood publishing
Only applies to messages that have been published by our own peer!
2020-04-18 11:09:06 +03:00
vyzo 4f6ca1b1b7 implement flood publishing option 2020-04-18 11:09:06 +03:00
vyzo dc6af4bbe6 keep D peer when pruning for oversubscription 2020-04-18 11:09:06 +03:00
vyzo 712bab2c64 remove peers with negative score from fanout 2020-04-18 11:09:06 +03:00
vyzo 80f3b8c45b hook score into heartbeat maintenance 2020-04-18 11:09:06 +03:00
vyzo 487bbaf09f heartbeat doPX is a more complex decision 2020-04-18 11:09:06 +03:00
vyzo f9ce661bda filter peers with negative score in initial mesh on join 2020-04-18 11:09:06 +03:00
vyzo c13e9c07e4 hook peer score into control message handlers 2020-04-18 11:09:06 +03:00
vyzo 7d928697a2 peer score scaffolding 2020-04-18 11:09:06 +03:00
Yusef Napora 4c804a954a track changes to peer records in -core 2020-04-18 11:09:06 +03:00
vyzo 946f35c4d4 fix rebase artifacts 2020-03-24 15:52:34 +02:00
vyzo ce1970d18d don't spawn a goroutine for scheduling connections 2020-03-24 15:52:34 +02:00
vyzo 0dec90571b shuffle peers when limiting px set 2020-03-24 15:52:34 +02:00
vyzo 17fd85f02c add limit to the number of peers to connect to from px 2020-03-24 15:52:34 +02:00
vyzo f20f93004b connect to peers obtained through px 2020-03-24 15:52:34 +02:00
vyzo 85b455fa50 backoff grafting to peers that have pruned us 2020-03-24 15:52:34 +02:00
vyzo 6b80c4078d peer exchange on prune 2020-03-24 15:52:34 +02:00
vyzo 73af710419 protocol ID for gossipsub v1.1 2020-03-24 15:52:34 +02:00
Yusef Napora 559cf91dce renaming in error messages & local var 2020-03-24 15:52:34 +02:00
Yusef Napora d860620a23 add missing continue to error case 2020-03-24 15:52:34 +02:00
Yusef Napora 23e30d529a fix import & var naming 2020-03-24 15:52:34 +02:00
Yusef Napora 919d81fd91 track changes to peer records in -core 2020-03-24 15:52:34 +02:00
vyzo 5b0ec14ea7 don't spawn a goroutine for scheduling connections 2020-03-24 15:52:34 +02:00
vyzo efb09f2984 shuffle peers when limiting px set 2020-03-24 15:52:34 +02:00
vyzo e4667b6073 add limit to the number of peers to connect to from px 2020-03-24 15:52:34 +02:00
vyzo a4c5325665 make connection timeout a variable, set for 30s (instead of 10s) 2020-03-24 15:52:34 +02:00
vyzo d118e1d554 connect to peers obtained through px 2020-03-24 15:52:34 +02:00
vyzo 806fd24a58 backoff grafting to peers that have pruned us 2020-03-24 15:52:34 +02:00
vyzo 6c59beedb8 peer exchange on prune 2020-03-24 15:52:34 +02:00
vyzo 6fc8050bac protocol ID for gossipsub v1.1 2020-03-24 15:52:34 +02:00
protolambda 6bd07a71fc
PR feedback: name change and account for different options order 2019-12-16 12:46:30 +01:00
protolambda 7981f9bfbd
fixes #247: implement msg id function as pubsub option 2019-12-16 03:54:40 +01:00
vyzo 958e09a5b3 remove useless nil check when initializing subsystem tracers 2019-11-15 20:42:04 +02:00
vyzo 67275a6382 tracing scaffolding 2019-11-15 20:42:04 +02:00
Adin Schmahmann f9c26c2e68 Added libp2p discovery capabilities to PubSub.
When the WithDiscovery option is passed to PubSub then PubSub will be able to search for more peers that are interested in our topics.

This includes the ability for Publishes (via Topic.Publish()) to block until the router is ready to publish. When a router is ready is currently defined by a combination of a user defined MinTopicSize function (passed into topic.Publish via the WithReadiness publish option) and the properties of the pubsub router used. The discovery tests show example usage.
2019-10-31 16:39:18 -04:00
Raúl Kripalani 8d7838b031 rename queueGossip() to enqueueGossip(). 2019-10-12 21:50:20 +09:00
Raúl Kripalani 2a90debb89 rename pushGossip to queueGossip for accuracy. 2019-10-06 18:53:05 +09:00
Raúl Kripalani 9103afa349 emitGossip: gossip to D peers. 2019-10-06 18:52:11 +09:00
Raúl Kripalani cd94989155 emitGossip: rename param name for clarity. 2019-10-06 18:50:40 +09:00
vyzo 2bac4705dc fix very minor bug in gossipsub 2019-08-13 12:01:55 +03:00
Topper Bowers 5e883d794c also check for nil peers (h/t @brandonwestcott) 2019-05-28 12:09:08 -04:00
Raúl Kripalani 49274b0e8a
migrate to consolidated types. (#185) 2019-05-26 17:19:03 +01:00
vyzo 96c5b40934 godoc cosmetics 2019-01-04 13:14:04 +02:00
vyzo 2478eb9a87 gossipsub: tag mesh peers to discourage pruning their connections 2018-10-26 15:49:34 +03:00
Steven Allen bd1a4630b9 move to go-libp2p-pubsub
Updates for move from go-floodsub to go-libp2p-pubsub.

fixes https://github.com/libp2p/go-libp2p-pubsub/issues/4
2018-10-18 21:10:16 +01:00
Kevin Atkinson 0827f5e955 gx publish 0.9.31 2018-10-04 19:23:53 -04:00
Kevin Atkinson 1abb0209ce gx publish 0.9.30 2018-10-04 18:41:48 -04:00
James Ray 096722488e
pubish -> publish 2018-09-17 14:57:32 +10:00
gukq 91285f3022 Just repair spelling mistake
Signed-off-by: gukq <gukaiqiang@gmail.com>
2018-09-10 23:17:23 +08:00
vyzo 0cd357b295 control parameter for gossipsub initial heartbeat delay 2018-08-29 11:15:41 +03:00
vyzo de4adefafb fix data race in ownership of RPC when piggybacking control messages. 2018-08-28 21:07:18 +03:00
vyzo bb5dd40680 basic logging for gossipsub 2018-08-09 12:16:19 +03:00
vyzo 1dc8405449 more docs for gossipsub router, expire fanout peers when we haven't published in a while 2018-06-12 08:00:17 -07:00
vyzo b490d117f2 make heartbeat interval a parameter, turn all gossipsub parameters into variables 2018-06-12 08:00:17 -07:00
vyzo 009efebdaf harden piggybackControl
don't create a control object if the graft/prune are stale and only assign
the relevant fields.
2018-06-12 08:00:17 -07:00
vyzo af061f5040 refactor sendGraftPrune out of heartbeat 2018-06-12 08:00:17 -07:00
vyzo ef730627ad remove unnecessary and potentially harmful check from heartbeat
- the check is unnecessary because peers emit PRUNE on Leave
- the check is harmful, because the ANNOUNCE message might have
  benn lost (or reordered after the GRAFT depending on the retry
  strategy), which would leave the mesh in an inconsistent state.
2018-06-12 08:00:17 -07:00
vyzo 4667b0ae94 fanout sources should emit gossip too 2018-06-12 08:00:17 -07:00
vyzo 1f5959bf54 fix slice bounds issues; getCount takes care of the slicing 2018-06-12 08:00:17 -07:00
vyzo 599ccffecd shift the message history window at the end of the heartbeat 2018-06-12 08:00:17 -07:00
vyzo 64cdbbabbc remove pending gossip and control messages on RemovePeer 2018-06-12 08:00:17 -07:00
vyzo bd29e81e3a history and gossip length are named constants 2018-06-12 08:00:17 -07:00
vyzo c5fe290389 reduce gossip amplification; don't send to mesh peers 2018-06-12 08:00:17 -07:00
vyzo 0e288dc741 delete mesh before sending prunes on leave 2018-06-12 08:00:17 -07:00
vyzo 64d35994d1 shuffle peers 2018-06-12 08:00:17 -07:00
vyzo 07875f149e implement flush 2018-06-12 08:00:17 -07:00
vyzo 74a10cfa70 piggybacking details 2018-06-12 08:00:17 -07:00
vyzo 7251c64e65 control message piggybacking logic 2018-06-12 08:00:17 -07:00
vyzo 78618fce23 maintain fanout peer lists on heartbeat 2018-06-12 08:00:17 -07:00
vyzo bc25116516 clean peers that have left the topic on heartbeat 2018-06-12 08:00:17 -07:00
vyzo 73da341386 hearbeat preliminaries: overlay management 2018-06-12 08:00:17 -07:00
vyzo 34509d47b3 implement Join and Leave, refactor sendRPC 2018-06-12 08:00:17 -07:00
vyzo e1fbe11c97 refactor Publish to use getPeers 2018-06-12 08:00:17 -07:00
vyzo 6a177a7396 handle gossipsub control messages 2018-06-12 08:00:17 -07:00
vyzo 375c4176b9 gossipsub publish 2018-06-12 08:00:17 -07:00
vyzo b867200fee gossipsub: heartbeat timer 2018-06-12 08:00:17 -07:00
vyzo 448f380722 gossipsub: router outline 2018-06-12 08:00:17 -07:00