455 Commits

Author SHA1 Message Date
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
Adin Schmahmann
5ef7439d71 interface: New Topic + TopicEventHandlers objects.
Added PubSub.Join(topic) that returns a Topic object. This object can be Subscribed and Published to as well as to get a TopicEventHandler for topic events. This means that the Subscription object will no longer handle PeerEvents and that PubSub's Publish and Subscribe functions are deprecated.
2019-10-31 15:37:44 -04:00
Adin Schmahmann
c837436c80 dep: update go-libp2p 2019-10-31 15:36:07 -04:00
vyzo
aa9a8756d4
Merge pull request #218 from libp2p/feat/view-last-hop
Expose the peer that propagates a message to the recipient
2019-10-18 11:47:50 +03:00
Adin Schmahmann
6551b41f12 go fmt 2019-10-18 04:25:52 -04:00
Adin Schmahmann
c0494a42f4
minor variable refactor 2019-10-18 03:25:24 -04:00
Adin Schmahmann
d28f450046 expose the peer that propagates a message to the recipient 2019-10-18 02:39:37 -04:00
vyzo
2247a54a8c
Merge pull request #204 from libp2p/fix/gossip-methods
gossip methods: renames and predicate adjustment
2019-10-12 16:41:09 +03:00
Raúl Kripalani
8d7838b031 rename queueGossip() to enqueueGossip(). 2019-10-12 21:50:20 +09:00
vyzo
d72666d4eb
Merge pull request #205 from libp2p/fix/mcache-docs
godocs: clarify config params of MessageCache.
2019-10-06 22:17:11 +03:00
Raúl Kripalani
e897918f4b godocs: clarify config params of MessageCache. 2019-10-06 19:58:07 +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
55553ac009
Merge pull request #196 from libp2p/fix/minor-bug
minor bug fix: on join, source peers from gossip[topic] if insufficient peers in fanout[topic]
2019-10-05 21:58:11 +03:00
vyzo
dba8299a92
Merge pull request #201 from lukesolo/subscription-fix-cancel
add PubSub's context to Subscription
2019-10-01 15:15:08 +03:00
lukesolo
9d03237eec add PubSub's context to Subscription 2019-09-30 12:55:37 +03:00
vyzo
2bac4705dc fix very minor bug in gossipsub 2019-08-13 12:01:55 +03:00
vyzo
9f04364996
Merge pull request #190 from aschmahmann/feat/addOnSubscribeNotification
Add the ability to handle newly subscribed peers
v0.1.1
2019-08-07 13:02:18 +03:00
Adin Schmahmann
97e63e477e better context respect when waiting for new peer events. refactored backlog into eventLog. removed test that was no longer useful. 2019-08-06 00:26:40 -04:00
Adin Schmahmann
65825ce63a fix race 2019-08-05 15:48:31 -04:00
Adin Schmahmann
57f2c1efdd Refactored events to be camel case. 2019-08-02 12:25:57 -04:00
Adin Schmahmann
48c9847240 oops forgot a return. separated out and added more comments to the new tests. 2019-08-02 00:46:49 -04:00
Adin Schmahmann
934b813b9a stronger notification deliveries backed by unbounded buffer 2019-08-01 16:57:05 -04:00
Adin Schmahmann
e4a65bcf1c Made discovery enum use int and removed the UNKNOWN zero value from the enum 2019-07-22 10:02:58 -04:00
Adin Schmahmann
ae667299a8 go fmt 2019-07-01 17:43:49 +02:00
Adin Schmahmann
e26e489bdd Small code cleanup + refactor 2019-06-21 08:46:41 +02:00
Adin Schmahmann
be69856a1d Fixed some unnecessary Leave notifications.
Combined Join and Leave events into a single API with a struct that specifies whether the event is a Join or a Leave.
2019-06-12 10:06:16 -04:00
Adin Schmahmann
817651a6d1 Subscription Join events now fire even for peers connected to us before we subscribe.
Added a Subscription Leave event
2019-06-11 17:49:28 -04:00
Adin Schmahmann
cc791f28b9 Made TestSubscriptionNotification thread safe 2019-06-07 09:21:17 -04:00
Adin Schmahmann
8037a2e60f Add the ability to handle newly subscribed peers 2019-06-07 08:31:14 -04:00
vyzo
4221a3966b
Merge pull request #188 from quorumcontrol/heartbeat-race
Fix gossipsub race condition for heartbeat
2019-05-28 19:57:04 +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) v0.1.0 2019-05-26 17:19:03 +01:00
Hector Sanjuan
08ddcf7bf2 update deps (-u=patch) v0.0.6 2019-05-24 23:41:35 +02:00
Steven Allen
1a2f55f640 dep: update go-libp2p deps
Deal with https://github.com/libp2p/go-libp2p/issues/640
v0.0.5
2019-05-21 20:25:06 -07:00
Steven Allen
2ab4518e0e dep: update go-libp2p
Deal with broken tag.
v0.0.4
2019-05-21 18:10:24 -07:00
vyzo
b962da55e5
Merge pull request #176 from libp2p/feat/rework-validators
rework validator pipeline
v0.0.3
2019-05-15 11:22:06 +03:00
vyzo
2df9d940bf remove unnecessary context in validateSingleTopic 2019-05-14 14:17:32 +03:00
vyzo
f4d9eeec26 improve godocs 2019-05-14 14:03:08 +03:00
vyzo
cb423f474d split off validation into its own type 2019-05-14 14:03:08 +03:00
vyzo
8d0c8d60b1 add option to control number of synchronous validation workers 2019-05-14 13:59:52 +03:00
vyzo
d8f08cdba7 add support for inline (synchronous) validators 2019-05-14 13:59:52 +03:00
vyzo
b84a32a4ee remove default async validation timeout and increase default topic validation throttle.
and some better documentation.
2019-05-14 13:59:52 +03:00
vyzo
b227afbf9f invoke user validators once for each message 2019-05-14 13:59:52 +03:00
vyzo
7a38f7642e validation pipeline front-end for handling signature validation synchronously 2019-05-14 13:59:52 +03:00
vyzo
9d7a59f4a8
Merge pull request #181 from keep-network/test-adversarial-signing
Test adversarial signing
2019-05-08 20:27:41 +03:00
Raghav Gulati
3c78c237ce
Remove empty line in imports 2019-05-08 10:09:30 -07:00
Raghav Gulati
08c4a28ee3
Better comment for signing with a different key
Note that the second message is the incorrectly signed message.
2019-05-08 09:27:57 -07:00
Raghav Gulati
a726a896db
Use names rather than index
We've aliased array elements, use the explicit names instead.
2019-05-08 09:27:26 -07:00