Commit Graph
998 Commits
Author SHA1 Message Date
Hlib Kanunnikov 9c56b2deca perf: use msgio pooled buffers for received msgs (#500) 2022-11-19 15:19:10 +02:00
Yahya Hassanzadeh 1e161006c4 Enables injectable GossipSub router (#503)
* adds with gossipsub tracker

* renames and add godoc
2022-11-02 06:53:50 +02:00
libp2p-mgmt-read-write[bot] 01ab84a809 chore: Update .github/workflows/stale.yml [skip ci] 2022-09-19 13:41:37 +00:00
Yahya Hassanzadeh 8866ca88a1 Enables non-atomic validation for peer scoring parameters (#499)
* decouples topic scoring parameters

* adds skiping atomic validation for topic parameters

* cleans up

* adds skip atomic validation to peer score threshold

* adds skip atomic validation for peer parameters

* adds test for non-atomic validation

* adds tests for peer score

* adds tests for peer score thresholds

* refactors tests
2022-09-08 08:20:23 +03: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
vyzo 60cf380032 fix handling of dead peers (#492)
* fix handling of dead peers

* remove unnecessary continue
2022-07-01 19:37:38 +03:00
Hlib Kanunnikov 96efa27a1a feat: WithLocalPublication option to enable local only publishing on a topic (#481)
* feat: WithLocalPublication option to enable local only publishing on a topic

* docs: improve comment on WithLocalPublication option
2022-07-01 18:49:12 +03:00
Nishant Das ca702289e6 update pubsub deps (#491) 2022-06-30 07:30:19 +03:00
Marco Munizaga 68cdae031b Gossipsub: Unsubscribe backoff (#488)
* Implement Unsusbcribe backoff

* Add test to check that prune backoff time is used

* Update which backoff to use in TestGossibSubJoinTopic test

* Fix race in TestGossipSubLeaveTopic

* Wait for all the backoff checks, and check that we aren't missing too many

* Remove open question
2022-06-03 06:46:56 +03:00
Yahya Hassanzadeh 06b5ba4763 Adds exponential backoff to re-spawing new streams for supposedly dead peers (#483)
* updates gitignore

* implements draft solution

* consolidates update and get

* extends test

* adds cleaner logic

* removes a redundant else case

* refactors cleanup in a goroutine

* adds a jitter to backoff

* stretches the sleep for cleanup

* reduces jitter time

* fixes a test

* adds maximum backoff attempts

* returns error for closing channel

* refactors peer status exceed backoff threshold

* converts if-else to switch

* nit

* consolidates update and maximum backoff check

* bug fix

* nit

* refactors cleanup with a ticker object
2022-05-30 19:47:08 +03:00
Iulian Pascalau 0ea9140c95 Publishing option for signing a message with a custom private key (#486)
* - added PublishWithSk functionality on the Topic implementation

* - fixes after merge

* - complete refactor: used publishing options instead of a new function

* - added one more check in unit test

* - bugfix: use local variables instead of fields

* - renamed tests
2022-05-26 12:39:30 +03:00
protolambda 566fdfa6fc fix unused GossipSubHistoryGossip, make seenMessages ttl configurable, make score params SeenMsgTTL configurable 2022-05-24 22:20:42 +03:00
Manic Security fa4161c634 Update README.md
Corrected from Implementations, to Examples in linked positional.
2022-03-03 21:18:37 +02:00
nisdas aeb30a2ac1 Add in Backoff Check 2022-02-08 09:20:54 +02:00
nisdas e02b3472aa Modify comment 2022-02-07 14:09:18 +02:00
nisdas 3d93f5f991 Add Backoff For Pruned Peers 2022-02-07 14:09:18 +02:00
Wondertan be065ce051 tests: new test for WithTopicMsgIdFunction 2022-01-23 09:29:32 +02:00
Wondertan fed393e39d chore: better name 2022-01-23 09:29:32 +02:00
Wondertan fcbbfd8131 feat: detach WithMsgIdFunction 2022-01-23 09:29:32 +02:00
Wondertan f9b2412210 fix: use RawID in traceRPCMeta to avoid allocations 2022-01-23 09:29:32 +02:00
Wondertan 9fbf906fb5 feat: extract RawID from ID 2022-01-23 09:29:32 +02:00
Wondertan 6faf473cad chore: hello mister mutex hat 2022-01-23 09:29:32 +02:00
Wondertan ec5e9b42a9 chore: go fmt and return timecache named import 2022-01-23 09:29:32 +02:00
Wondertan 6035642336 feat: new WithMsgIdFunction topic option to enable topics to have own msg id generation rules 2022-01-23 09:29:32 +02:00
Wondertan 0e687f24a6 feat: integrate msgIdGenerator 2022-01-23 09:29:32 +02:00
Wondertan 957fc4f80c feat: introduce msgIdGenerator and add ID field to Message wrapper 2022-01-23 09:29:32 +02:00
vyzo b57bcc8b36 add tests for clearing the peerPromises map 2022-01-13 14:13:37 +02:00
vyzo 9e39259ffe properly clear the peerPromises map 2022-01-13 14:13:37 +02:00
rene 6b31a7bd2a more info 2021-12-22 14:27:06 +02:00
rene 3b1c59c733 add to MinTopicSize godoc re topic size 2021-12-22 14:27:06 +02:00
Gus Eggert c6dd285c5d feat: plumb through context changes (#459) 2021-11-11 11:09:45 -05:00
Daniel Martí 5c90105738 support MinTopicSize without a discovery mechanism
That is, when MinTopicSize is used but not WithDiscovery,
Publish will keep waiting until MinTopicSize's condition is met.

At the moment, this is done by polling every 200ms.
In the future, the mechanism could be optimized to be event-based.
A TODO is left for that purpose.

Fixes #454.
2021-10-29 20:55:01 +03:00
vyzo 85a1f01869 clear peerPromises map when fullfilling a promise 2021-10-29 13:44:02 +03:00
vyzo cee11bb0e4 README: remove obsolete notice, fix example code for tracing. 2021-10-18 09:57:24 +03:00
Simon Zhu 7ef0669764 remove peer filter check from subscriptions (#453) 2021-09-22 10:46:09 +03:00
Simon Zhu 628353661b Create peer filter option 2021-09-21 13:50:09 +03:00
vyzo 0c7092d1f5 make slowness a warning, with a user configurable threshold 2021-07-30 23:10:03 +03:00
vyzo 257d133a07 reduce log spam from empty heartbeat messages 2021-07-30 23:10:03 +03:00
Richard Ramos 37d36d77b1 fix: code review 2021-07-30 16:57:34 +03:00
Richard Ramos faffd2a0bd add support for custom protocol matching function 2021-07-30 16:57:34 +03:00
Steven Allen 02dae6505c fix: downgrade multiaddr (#439)
The new version doesn't work with the current websocket release. We can
upgrade in the next minor release.
2021-07-27 22:43:38 -07:00
Steven Allen 3951ef46dd fix: downgrade core (#438)
We'll bump in a minor release.
2021-07-27 22:08:35 -07:00
Marten Seemann 24b2d00e07 chore: update deps (#437) 2021-07-27 10:14:01 -07:00
Steven Allen ba28f8ecfc fix: remove deprecated Bytes call (#436) 2021-07-22 15:31:08 -07: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
Ian Davis 37ebe34352 Revert noisy newline changes 2021-07-19 15:48:58 +03:00
Ian Davis 079d8973a6 fix: avoid panic when peer is blacklisted after connection 2021-07-19 15:48:58 +03:00
vyzo 3b98004eed release priority locks early when handling batches 2021-07-14 00:43:52 +03:00
vyzo e9e5a9913f don't respawn writer if we fail to open a stream; declare it a peer error 2021-07-14 00:43:52 +03:00
vyzo b289ec5017 batch process dead peer notifications 2021-07-14 00:43:52 +03:00