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

refactor: implement a maximum upperbound on parallel http requests to… #65

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

msf
Copy link
Contributor

@msf msf commented Jul 23, 2024

… the RPC node

Currently we allow defining RPCConcurrency, but that is in reality the BLOCK CONCURRENCY, the number of blocks we fetch in parallel.

for OP-Stack EVMs, we issue, for each block, in parallel, 3 RPC requests to the RPC Node.
So, the real concurrency is something like:
3 * (RPCConcurrency + DLQRPCConcurrency)

This patch enforces a maximum concurrency by using on rpcClient an internal workerPool.
This uses the github.com/panjf2000/ants/v2 library

Now the maximum total RPC concurrency is defined as 4 x RPCConcurrency

ingester/send.go Outdated Show resolved Hide resolved
@msf msf force-pushed the bounded-jsonrpc-concurrency branch 3 times, most recently from 685f2b0 to 82794c1 Compare July 23, 2024 18:58
@msf msf requested a review from adammilnesmith July 23, 2024 18:59
@msf msf force-pushed the bounded-jsonrpc-concurrency branch 2 times, most recently from 6f0d4ff to ccbd98b Compare July 23, 2024 20:18
… the RPC node

Currently we allow defining RPCConcurrency, but that is in reality the
BLOCK CONCURRENCY, the number of blocks we fetch in parallel.

for OP-Stack EVMs, we issue, for each block, in parallel, 3 RPC requests
to the RPC Node.
So, the real concurrency is something like:
3 * (RPCConcurrency + DLQRPCConcurrency)

This patch enforces a maximum concurrency by using on rpcClient an
internal workerPool.
This uses the github.com/panjf2000/ants/v2 library

Now the maximum total RPC concurrency is defined as 4 x RPCConcurrency
@msf msf force-pushed the bounded-jsonrpc-concurrency branch from ccbd98b to d913247 Compare July 23, 2024 20:20
@msf msf merged commit 2d406c3 into main Jul 23, 2024
1 check passed
@msf msf deleted the bounded-jsonrpc-concurrency branch July 23, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants