101 Commits

Author SHA1 Message Date
vyzo
5bbe37191a downgrade graylist Warn log to Info 2020-05-05 21:10:14 +03:00
vyzo
ce9a0b7edf use log.Warn instead of Warning 2020-05-05 21:10:14 +03:00
vyzo
1901383099 implement extended validator support 2020-05-04 09:42:20 +03:00
Lukasz Zimnoch
9a0bd7ad56 Prevent multiple invocations of relay cancel function 2020-05-01 12:22:22 +03:00
Lukasz Zimnoch
9a0d2f5948 Move counter incrementing before announce 2020-05-01 12:22:22 +03:00
Lukasz Zimnoch
10f5464279 Merge stop announcing conditions 2020-05-01 12:22:22 +03:00
Lukasz Zimnoch
3336559a27 Relay incoming messages
Added a possibility to
relay incoming messages if
there are existing relays
2020-05-01 12:22:22 +03:00
Lukasz Zimnoch
0d884f3e90 Topic relay discovery
Incorporated relays to
exiting discovery logic
and added them to topic
before-remove guard.
2020-05-01 12:22:22 +03:00
Lukasz Zimnoch
af44f7a07d Topic relay cancelling
Implemented relay reference
cancel logic.
2020-05-01 12:22:22 +03:00
Lukasz Zimnoch
750cc66336 Topic relay support
Implemented Relay method which
allows to enable message relaying
for the given topic.
2020-05-01 12:22:22 +03:00
vyzo
4f45d455f8 fix broken WithMessageAuthor option 2020-04-23 18:38:26 +03:00
vyzo
97519bf76c better handling of message originating from self but forwarded by another peer 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
1c4f0920fe use named constants for tracing message rejection reasons 2020-04-18 11:09:06 +03:00
vyzo
06d72b93da fix bug in WithEventTracer
wrong nil check.
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
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
7d928697a2 peer score scaffolding 2020-04-18 11:09:06 +03:00
Raúl Kripalani
1f147c2457
make wire protocol message size configurable. (#261) 2020-02-25 18:07:16 -08:00
Piotr Dyraga
ae00326b96
go fmt on pubsub.go 2020-01-27 13:44:03 +01:00
Preston Van Loon
8ced088fee rename VaidatorData to ValidatorData 2019-12-19 15:15:45 -08: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
fb11aa9857 initialize tracer with peer ID, trace RPC from join/leave announcements 2019-11-15 20:42:04 +02:00
vyzo
89c7ed46e3 trace publish 2019-11-15 20:42:04 +02:00
vyzo
67275a6382 tracing scaffolding 2019-11-15 20:42:04 +02:00
vyzo
28a87b3121
Merge pull request #231 from libp2p/feat/validator-data
add ValidatorData field to Message
2019-11-15 20:37:20 +02:00
vyzo
8b423348a0 add ValidatorData field to Message
Useful for passing data from the validation to the application.
2019-11-15 20:16:58 +02:00
Aarsh Shah
0dd2171ac5 queue size must always be positive 2019-11-16 01:39:12 +08:00
Aarsh Shah
d380477228 Configurable outbound peer queue sizes 2019-11-16 01:14:10 +08:00
Adin Schmahmann
686c928d4e pubsub and topic methods now return error if the pubsub context has been cancelled instead of hanging 2019-11-04 03:52:39 -05: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
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
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
lukesolo
9d03237eec add PubSub's context to Subscription 2019-09-30 12:55:37 +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
934b813b9a stronger notification deliveries backed by unbounded buffer 2019-08-01 16:57:05 -04: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
8037a2e60f Add the ability to handle newly subscribed peers 2019-06-07 08:31:14 -04:00
Raúl Kripalani
49274b0e8a
migrate to consolidated types. (#185) 2019-05-26 17:19:03 +01: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