From e4557c64f484332703ad1ed0ef33e449b70b014a Mon Sep 17 00:00:00 2001 From: Gabriel mermelstein Date: Wed, 12 Feb 2025 15:52:05 +0200 Subject: [PATCH] fixing hash to bytes conversion and increasing chan sizes --- waku/common/message_hash.go | 7 ++++++- waku/nwaku.go | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/waku/common/message_hash.go b/waku/common/message_hash.go index c51e480..c7a3cfe 100644 --- a/waku/common/message_hash.go +++ b/waku/common/message_hash.go @@ -35,5 +35,10 @@ func (h MessageHash) String() string { } func (h MessageHash) Bytes() ([]byte, error) { - return hex.DecodeString(string(h)) + s := string(h) + // Remove 0x prefix if present + if len(s) >= 2 && s[:2] == "0x" { + s = s[2:] + } + return hex.DecodeString(s) } diff --git a/waku/nwaku.go b/waku/nwaku.go index d59cad5..70b3320 100644 --- a/waku/nwaku.go +++ b/waku/nwaku.go @@ -337,9 +337,9 @@ import ( ) const requestTimeout = 30 * time.Second -const MsgChanBufferSize = 100 -const TopicHealthChanBufferSize = 100 -const ConnectionChangeChanBufferSize = 100 +const MsgChanBufferSize = 1024 +const TopicHealthChanBufferSize = 1024 +const ConnectionChangeChanBufferSize = 1024 type WakuConfig struct { Host string `json:"host,omitempty"`