-
Notifications
You must be signed in to change notification settings - Fork 454
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
Add option for websocket message size limit #2266
Conversation
This plumbs through the websocket message size limit option for all rpc clients.
util/rpcclient/rpcclient.go
Outdated
@@ -56,6 +58,8 @@ var DefaultClientConfig = ClientConfig{ | |||
Retries: 3, | |||
RetryErrors: "websocket: close.*|dial tcp .*|.*i/o timeout|.*connection reset by peer|.*connection refused", | |||
ArgLogLimit: 2048, | |||
// Use geth's unexported wsDefaultReadLimit from rpc/websocket.go | |||
WebsocketMessageSizeLimit: 32 * 1024 * 1024, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's increase this to 256 MiB (for the other websocket clients as well). All of these websocket clients are expecting the server to be honest.
@@ -256,9 +260,9 @@ func (c *RpcClient) Start(ctx_in context.Context) error { | |||
var err error | |||
var client *rpc.Client | |||
if jwt == nil { | |||
client, err = rpc.DialContext(ctx, url) | |||
client, err = rpc.DialOptions(ctx, url, rpc.WithWebsocketMessageSizeLimit(c.config().WebsocketMessageSizeLimit)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's test here if WebsocketMessageSizeLimit == 0 (it can happen e.g. for validation-server-configs). If it's 0 either use default or don't apply rpc.WithWebsocketMessageSizeLimit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
closes NIT-2449
This plumbs through the websocket message size limit option for all rpc clients.
Testing done
Checked that this option is present for all clients and that the default is correctly set.