Commit Graph

128 Commits

Author SHA1 Message Date
Yusef Napora 94015cee77 factor out doSendRPC and doDropRPC methods 2020-05-06 19:01:22 +03:00
Yusef Napora 21a4f8c0c8 only call fragmentRPC if we're over the size limit 2020-05-06 19:01:22 +03:00
Yusef Napora cb02a50cd8 split large IWANT / IHAVE messages, add unit test 2020-05-06 19:01:22 +03:00
Yusef Napora b1de03b608 try to send control messages in one RPC when fragmenting 2020-05-06 19:01:22 +03:00
Yusef Napora 27f009a9c7 fragment large RPCs in sendRPC 2020-05-06 19:01:22 +03:00
vyzo ce9a0b7edf use log.Warn instead of Warning 2020-05-05 21:10:14 +03:00
vyzo ea95ae8975 reify fanoutTTL in the GossipSubRouter struct 2020-04-23 18:38:26 +03:00
vyzo 5397bb5abc pull overlay parameters into the GossipSubRouter struct
pacify the race detector in travis
2020-04-23 13:40:50 +03:00
vyzo 11ef2a9cf2 fix the global variable mutation races 2020-04-22 21:08:13 +03:00
vyzo ca7b1f3dbf make initial delay for direct peer connections a variable 2020-04-22 21:08:13 +03:00
vyzo 32c3fb325d remove unnecessary length check 2020-04-22 21:08:13 +03:00
vyzo c00b476fb4 add test for gossipsub direct peers 2020-04-22 21:08:13 +03:00
vyzo 235c28ff49 truncate per peer message id lists 2020-04-20 19:53:12 +03:00
vyzo 8bc2c5c0f1 log counts in IHAVE flood protection measures 2020-04-20 19:53:12 +03:00
vyzo a645afd1b3 add backoff penalty for GRAFT floods 2020-04-20 19:53:12 +03:00
vyzo 9ab44c5069 make maximum number of IHAVE messages accepted per heartbeat configurable 2020-04-20 19:53:12 +03:00
vyzo 8150843cf3 improve handling of IHAVE floods 2020-04-20 19:53:12 +03:00
vyzo 34f2295c19 add protections from IHAVE floods 2020-04-20 19:53:12 +03:00
vyzo 1645516276 add protections from GRAFT floods 2020-04-20 19:53:12 +03:00
vyzo 9904d69cde configurable number of peers for opportunistic grafting 2020-04-18 11:09:06 +03:00
vyzo 6732f9848b fix typo
Co-Authored-By: Raúl Kripalani <raul@protocol.ai>
2020-04-18 11:09:06 +03:00
vyzo 8a53469c43 fix typo
Co-Authored-By: Raúl Kripalani <raul@protocol.ai>
2020-04-18 11:09:06 +03:00
vyzo 2fdf6cdaed opportunistic grafting 2020-04-18 11:09:06 +03:00
vyzo 8e969ba29e use a configurable variable for direct peer reconnect ticks 2020-04-18 11:09:06 +03:00
vyzo f97d151aec eagerly send gossip at the end heartbeat
instead of trying to piggyback with outgoing messages
2020-04-18 11:09:06 +03:00
Raúl Kripalani fc38f556a3 comments and nits. 2020-04-18 11:09:06 +03:00
vyzo 8809484a47 support direct peering agreements 2020-04-18 11:09:06 +03:00
vyzo ce3da3facd move self-publish check to pubsub 2020-04-18 11:09:06 +03:00
vyzo ea314605d3 don't forward messages with source ourselves but not published by ourselves
per stebalien's request.
2020-04-18 11:09:06 +03:00
vyzo 0cab7f5e59 increase connection manager weight for mesh peers 2020-04-18 11:09:06 +03:00
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