Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase size of possible p2p message for unmarshaller #1869

Merged
merged 1 commit into from
May 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion p2p/starknet/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
"google.golang.org/protobuf/proto"
)

const unmarshalMaxSize = 15 * utils.Megabyte
kirugan marked this conversation as resolved.
Show resolved Hide resolved

type NewStreamFunc func(ctx context.Context, pids ...protocol.ID) (network.Stream, error)

type Client struct {
Expand Down Expand Up @@ -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)
}
Expand Down
Loading