Эх сурвалжийг харах

fix(hermes): match p2p config with wh spy

Ali Behjati 2 жил өмнө
parent
commit
5010fa91ec

+ 1 - 1
hermes/Cargo.lock

@@ -1764,7 +1764,7 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
 
 [[package]]
 name = "hermes"
-version = "0.1.13"
+version = "0.1.14"
 dependencies = [
  "anyhow",
  "axum",

+ 1 - 1
hermes/Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 name    = "hermes"
-version = "0.1.13"
+version = "0.1.14"
 edition = "2021"
 
 [dependencies]

+ 6 - 2
hermes/src/network/p2p.go

@@ -189,7 +189,11 @@ func RegisterObservationCallback(f C.callback_t, network_id, bootstrap_addrs, li
 		defer h.Close()
 
 		topic := fmt.Sprintf("%s/%s", networkID, "broadcast")
-		ps, err := pubsub.NewGossipSub(ctx, h)
+		ps, err := pubsub.NewGossipSub(
+			ctx,
+			h,
+			pubsub.WithValidateQueueSize(1024),
+		)
 		if err != nil {
 			err := fmt.Errorf("Failed to create Pubsub: %w", err)
 			fmt.Println(err)
@@ -205,7 +209,7 @@ func RegisterObservationCallback(f C.callback_t, network_id, bootstrap_addrs, li
 
 		defer th.Close()
 
-		sub, err := th.Subscribe()
+		sub, err := th.Subscribe(pubsub.WithBufferSize(1024))
 		if err != nil {
 			err := fmt.Errorf("Failed to subscribe topic: %w", err)
 			fmt.Println(err)