31 Commits

Author SHA1 Message Date
Marco Munizaga
0c5ee7bbfe
feat(gossipsub): Add MessageBatch (#607)
to support batch publishing messages

Replaces #602.

Batch publishing lets the system know there are multiple related
messages to be published so it can prioritize sending different messages
before sending copies of messages. For example, with the default API,
when you publish two messages A and B, under the hood A gets sent to D=8
peers first, before B gets sent out. With this MessageBatch api we can
now send one copy of A _and then_ one copy of B before sending multiple
copies.

When a node has bandwidth constraints relative to the messages it is
publishing this improves dissemination time.

For more context see this post:
https://ethresear.ch/t/improving-das-performance-with-gossipsub-batch-publishing/21713
2025-05-08 10:23:02 -07:00
vyzo
829f9026a3
Default validator support (#525)
* add default validator support

* add an implementation for basic seqno as nonce validation

* missing return

* the nonce belongs to the origin peer

* add note about rust predicament

* add seqno validator tests

* minor test tweak, ensure at least 1ms before replay
2023-03-01 16:15:54 +02:00
Marten Seemann
4f56e8f0a7
update go-libp2p to v0.22.0 (#498)
* update go-libp2p to v0.22.0

* skip TestGossipsubConnTagMessageDeliveries
2022-08-26 02:45:41 -07:00
Wondertan
0e687f24a6 feat: integrate msgIdGenerator 2022-01-23 09:29:32 +02:00
Ian Davis
2efd313b83
cleanup: fix vet and staticcheck failures (#435)
* cleanup: fix vet failures and most staticcheck failures

* Fix remaining staticcheck failures

* Give test goroutines chance to exit early when context is canceled
2021-07-22 15:27:32 -07:00
vyzo
84302e9633 rename checkSignature to checkSigningPolicy 2021-03-31 17:53:46 +03:00
vyzo
175d43f4e7 rename validation.Publish to PushLocal 2021-03-31 17:53:46 +03:00
vyzo
005ac1598c implement synchronous validation for locally published messages
So that locally published messages are never dropped because of full
validation queues.
2021-03-31 17:53:46 +03:00
vyzo
05c505ef60 export rejection named string constants 2021-03-16 08:28:02 +02:00
vyzo
d6c20b59fc remove multi-topic message support 2020-10-08 20:18:21 +03:00
vyzo
06a12f17b7 reduce log verbosity; debug mostly 2020-09-01 20:42:50 +03:00
vyzo
efd56962bc track validation time 2020-08-21 10:51:13 +03:00
Diederik Loerakker
99507107b6
Merge pull request #359 from protolambda/optional-sig-origin-seq
Signing policy + optional Signature, From and Seqno
2020-07-23 08:47:47 +03:00
Edgar Aroutiounian
9de0241df1 [validation] Use label for break 2020-05-13 09:58:12 +03:00
Edgar Aroutiounian
04e971fa0d [validation] break not used correct - need return or give label, i choose return 2020-05-13 09:58:12 +03:00
vyzo
ce9a0b7edf use log.Warn instead of Warning 2020-05-05 21:10:14 +03:00
vyzo
63e7ba850c add comment about validationThrottled suerpseding ValidationIgnore 2020-05-04 09:42:20 +03:00
vyzo
5a7a4fcf84 fix typo
Co-Authored-By: Yusef Napora <yusef@protocol.ai>
2020-05-04 09:42:20 +03:00
vyzo
1901383099 implement extended validator support 2020-05-04 09:42:20 +03:00
vyzo
1c4f0920fe use named constants for tracing message rejection reasons 2020-04-18 11:09:06 +03:00
vyzo
98671566a2 distinguish throttled validation because of a full worker queue. 2020-04-18 11:09:06 +03:00
vyzo
e17e266aa9 track message delivery time within the validation pipeline 2020-04-18 11:09:06 +03:00
Piotr Dyraga
499109b165
Configurable size of validate queue
validateWorker() reads from validateQ and invokes validate function
that performs validation of the message. Signature validation is performed
synchronously. The number of validate workers defaults to the number of CPUs
and can be updated with WithValidateWorkers function. With no additional user
validators, signature validation is the bottleneck when receiving new messages.

Increasing the number of validating workers does not help given the context
switching and bottleneck nature of this spot. As stated in WithValidateWorkers
documentation, this function should be used rather to limit the number of workers
to devote less CPU time for synchronous validation. On the other hand, with the
default size of `validateQ`, some applications built on a top of libp2p may
experience throttled validation and lost messages.

This problem is addressed by WithValidateQueueSize allowing to configure the buffer
size for synchronous validation. Application developers knowing the nature of their
protocols can set this value to minimise the possibility of throttled synchronous
validation and dropped messages. Configurable buffer size allows to gracefully
handle peaks of messages and, from the other side, the number of concurrent
synchronous workers is still limited by validateWorkers property so the receiver
should not get congested.
2020-01-21 10:19:42 +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
d28f450046 expose the peer that propagates a message to the recipient 2019-10-18 02:39:37 -04:00
Raúl Kripalani
49274b0e8a
migrate to consolidated types. (#185) 2019-05-26 17:19:03 +01: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