`BundleManager.handlePastEvents` may exceed JSON RPC response size limit
kaiix opened this issue · comments
kaiix commented
When a bundler is started and a bundle is sent for the first time (https://github.com/eth-infinitism/bundler/blob/v0.5.0/packages/bundler/src/modules/BundleManager.ts#L55), all past events of entrypoint are scanned (https://github.com/eth-infinitism/bundler/blob/v0.5.0/packages/bundler/src/modules/EventsManager.ts#L37). This may fail because the response from RPC server's eth_getLogs
exceeds the size limit.
Part of the error logs:
reason: 'processing response error',
code: 'SERVER_ERROR',
body: '{"jsonrpc":"2.0","id":55,"error":{"code":-32602,"message":"Log response size exceeded. You can make eth_getLogs requests with up to a 2K block range and no limit on the response size, or you can request any block range with a cap of 10K logs in the response. Based
on your parameters and the response size limit, this block range should work: [0x0, 0x2014fd1]"}}',
error: Error: Log response size exceeded. You can make eth_getLogs requests with up to a 2K block range and no limit on the response size, or you can request any block range with a cap of 10K logs in the response. Based on your parameters and the response size limit, this
block range should work: [0x0, 0x2014fd1]
at getResult (webpack:///../../node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js?:148:23)
at processJsonFunc (webpack:///../../node_modules/@ethersproject/web/lib.esm/index.js?:312:22)
at eval (webpack:///../../node_modules/@ethersproject/web/lib.esm/index.js?:255:46)
at Generator.next (<anonymous>)
at fulfilled (webpack:///../../node_modules/@ethersproject/web/lib.esm/index.js?:18:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: -32602,
data: undefined
},
requestBody: '{"method":"eth_getLogs","params":[{"fromBlock":"0x0","toBlock":"latest","address":"0x0576a174d229e3cfa37253523e645a78a0c91b57"}],"id":55,"jsonrpc":"2.0"}',
requestMethod: 'POST',
url: 'https://polygon-mumbai.g.alchemy.com/v2/...'
Dror Tirosh commented
fixed
(limit backlog when looking for events)