From f3044fba62433ae8cbda23bc2c7f26ece6ec833b Mon Sep 17 00:00:00 2001 From: Kirill Date: Sat, 18 May 2024 22:11:53 +0400 Subject: [PATCH] Increase size of possible p2p message for unmarshaller --- p2p/starknet/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/p2p/starknet/client.go b/p2p/starknet/client.go index fb69e6bbbb..6ddffe68d0 100644 --- a/p2p/starknet/client.go +++ b/p2p/starknet/client.go @@ -14,6 +14,8 @@ import ( "google.golang.org/protobuf/proto" ) +const unmarshalMaxSize = 15 * utils.Megabyte + type NewStreamFunc func(ctx context.Context, pids ...protocol.ID) (network.Stream, error) type Client struct { @@ -44,7 +46,7 @@ func sendAndCloseWrite(stream network.Stream, req proto.Message) error { func receiveInto(stream network.Stream, res proto.Message) error { unmarshaller := protodelim.UnmarshalOptions{ - MaxSize: 10 * utils.Megabyte, + MaxSize: unmarshalMaxSize, } return unmarshaller.UnmarshalFrom(&byteReader{stream}, res) }