Skip to content

Make RPC request limit configurable #3981

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

Open
jochem-brouwer opened this issue Apr 16, 2025 · 6 comments · May be fixed by #3993
Open

Make RPC request limit configurable #3981

jochem-brouwer opened this issue Apr 16, 2025 · 6 comments · May be fixed by #3993

Comments

@jochem-brouwer
Copy link
Member

The current limit of the JSON-RPC service (for both RPCs like eth and engine) is currently hardcoded at 11MB

app.use(JSONParser({ limit: '11mb' }))

For JSON-RPC eth this seems wayyy too high. For engine, this could be too low, especially if these are full blocks with blobs in them (and also since the max blobs in Prague is now 9, not 6 (Cancun)). We should raise this limit on the engine JSON-RPC service since this service is trusted and authenticated.

Additionally, we should add CLI flags to edit the limits of the trusted service (engine) and the non-trusted service (eth/debug/whatever, anything which is not engine)

@ether-wan
Copy link

Gm @jochem-brouwer can I work on this issue?

@ether-wan
Copy link

Here is the approach I would like to propose:

The idea would be to add two new parameters in the configuration file: rpcEngineMaxPayload and rpcEthMaxPayload, which would be customizable if the user provides specific CLI arguments.

  • In the case where the eth and the engine rpc are started on the same address and port (a single server for both services), we would apply a common payload size limit for both.

  • In the case where the eth and engine rpc are started on separate addresses and ports (two distinct servers), we would be able to apply different payload size limits for each service.

Another option could be to enforce that eth and engine rpc must always run on separate servers, but this would introduce a breaking change compared to the current setup.

@jochem-brouwer
Copy link
Member Author

Hey @ether-wan, sorry I wanted to reply to this yesterday but I forgot! This is a good issue to start on and your approach looks good to me!

I am only not sure if we are running both engine and eth on the same address+port, I think this should be by default the localhost:8545 (eth) and localhost:8546 (engine).

@jochem-brouwer
Copy link
Member Author

Just assigned you, feel free to move ahead with this and let us know if you run in any problems or have a question. If you prefer chat, we have a discord https://discord.gg/TNwARpR 😄 👍

@ether-wan
Copy link

Hey @ether-wan, sorry I wanted to reply to this yesterday but I forgot! This is a good issue to start on and your approach looks good to me!

I am only not sure if we are running both engine and eth on the same address+port, I think this should be by default the localhost:8545 (eth) and localhost:8546 (engine).

Yes, you're right! I've just realised that by default, two servers are created: one on port :8545 for eth and one on port :8551 for engine.

That's great because it simplifies setting different maximum payload sizes for each server 😁

@jochem-brouwer
Copy link
Member Author

Ah right good point I confused the ports, it's indeed 8551 for the engine (8546 for websocket JSON-RPC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants