Open InoMurko opened 1 year ago
In src/services/l1-ingestion/service.ts there's a _getContractAddressAtBlock() function which performs a query for AddressManager registration events, in case the CTC/SCC contracts have changed address at some point since deployment.
events = await this.state.contracts.Lib_AddressManager.queryFilter(
this.state.contracts.Lib_AddressManager.filters.AddressSet(
contractName
),
this.state.startingL1BlockNumber,
blockNumber
)
The events are not cached, and every query runs from the original startingL1BlockNumber up to the block which is being queried.
A workaround is to bypass this query and instead look up the CTC/SCC addresses from the internal representation of the addresses.json file.
Issue Type
Current Behavior
Log from L2 Boba Goerli ` {"level":50,"time":1684234278751,"extra":{"message":"Error: failed to meet quorum (method=\"getLogs\", params={\"filter\":{\"fromBlock\":\"0x780c66\",\"toBlock\":\"0x8979c0\",\"address\":\"0x6FF9c8FF8F0B6a0763a3030540c21aFC721A9148\",\"topics\":[\"0x9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c\",\"0x02b616af23339f1e031e76333e2d5b1c3067beb78578c961911872cc2127ef8b\"]}}, results=[{\"weight\":1,\"start\":1684234278688,\"error\":{\"reason\":\"processing response error\",\"code\":\"SERVER_ERROR\",\"body\":\"{\\"id\\":1134,\\"jsonrpc\\":\\"2.0\\",\\"error\\":{\\"code\\":-32602,\\"message\\":\\"invalid params\\",\\"data\\":{\\"error_id\\":\\"6a6a714e-01f6-42e9-b3e4-6e0d7ef470ec\\",\\"payload\\":\\"range 1142106 is bigger than range limit 2000\\"}}}\",\"error\":{\"code\":-32602,\"data\":{\"error_id\":\"6a6a714e-01f6-42e9-b3e4-6e0d7ef470ec\",\"payload\":\"range 1142106 is bigger than range limit 2000\"}},\"requestBody\":\"{\\"method\\":\\"eth_getLogs\\",\\"params\\":[{\\"fromBlock\\":\\"0x780c66\\",\\"toBlock\\":\\"0x8979c0\\",\\"address\\":\\"0x6ff9c8ff8f0b6a0763a3030540c21afc721a9148\\",\\"topics\\":[\\"0x9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c\\",\\"0x02b616af23339f1e031e76333e2d5b1c3067beb78578c961911872cc2127ef8b\\"]}],\\"id\\":1134,\\"jsonrpc\\":\\"2.0\\"}\",\"requestMethod\":\"POST\",\"url\":\"https://goerli.gateway.tenderly.co/\"}}], provider={\"_isProvider\":true,\"_events\":[],\"_emitted\":{\"block\":-2},\"disableCcipRead\":false,\"formatter\":{\"formats\":{\"transaction\":{},\"transactionRequest\":{},\"receiptLog\":{},\"receipt\":{},\"block\":{},\"blockWithTransactions\":{},\"filter\":{},\"filterLog\":{}}},\"anyNetwork\":false,\"_networkPromise\":{},\"_maxInternalBlockNumber\":9009608,\"_lastBlockNumber\":-2,\"_maxFilterBlockRange\":10,\"_pollingInterval\":4000,\"_fastQueryDate\":1684234278178,\"providerConfigs\":[{\"priority\":0,\"provider\":{\"_isProvider\":true,\"_events\":[],\"_emitted\":{\"block\":-2},\"disableCcipRead\":false,\"formatter\":{\"formats\":{\"transaction\":{},\"transactionRequest\":{},\"receiptLog\":{},\"receipt\":{},\"block\":{},\"blockWithTransactions\":{},\"filter\":{},\"filterLog\":{}}},\"anyNetwork\":false,\"_networkPromise\":{},\"_maxInternalBlockNumber\":9009608,\"_lastBlockNumber\":-2,\"_maxFilterBlockRange\":10,\"_pollingInterval\":4000,\"_fastQueryDate\":1684234278688,\"connection\":{\"url\":\"https://goerli.gateway.tenderly.co/\",\"headers\":{\"User-Agent\":\"data-transport-layer\"}},\"_nextId\":1135,\"_eventLoopCache\":{\"detectNetwork\":null,\"eth_chainId\":null,\"eth_blockNumber\":null},\"_network\":{\"name\":\"goerli\",\"chainId\":5,\"ensAddress\":\"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\"},\"_internalBlockNumber\":{},\"_fastBlockNumber\":9009608,\"_fastBlockNumberPromise\":{}},\"stallTimeout\":750,\"weight\":1}],\"quorum\":0.5,\"_highestBlockNumber\":9009608,\"_network\":{\"name\":\"goerli\",\"chainId\":5,\"ensAddress\":\"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\"},\"_internalBlockNumber\":{},\"_fastBlockNumber\":9009608,\"_fastBlockNumberPromise\":{}}, code=SERVER_ERROR, version=providers/5.7.2)","stack":"Error: failed to meet quorum (method=\"getLogs\", params={\"filter\":{\"fromBlock\":\"0x780c66\",\"toBlock\":\"0x8979c0\",\"address\":\"0x6FF9c8FF8F0B6a0763a3030540c21aFC721A9148\",\"topics\":[\"0x9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c\",\"0x02b616af23339f1e031e76333e2d5b1c3067beb78578c961911872cc2127ef8b\"]}}, results=[{\"weight\":1,\"start\":1684234278688,\"error\":{\"reason\":\"processing response error\",\"code\":\"SERVER_ERROR\",\"body\":\"{\\"id\\":1134,\\"jsonrpc\\":\\"2.0\\",\\"error\\":{\\"code\\":-32602,\\"message\\":\\"invalid params\\",\\"data\\":{\\"error_id\\":\\"6a6a714e-01f6-42e9-b3e4-6e0d7ef470ec\\",\\"payload\\":\\"range 1142106 is bigger than range limit 2000\\"}}}\",\"error\":{\"code\":-32602,\"data\":{\"error_id\":\"6a6a714e-01f6-42e9-b3e4-6e0d7ef470ec\",\"payload\":\"range 1142106 is bigger than range limit 2000\"}},\"requestBody\":\"{\\"method\\":\\"eth_getLogs\\",\\"params\\":[{\\"fromBlock\\":\\"0x780c66\\",\\"toBlock\\":\\"0x8979c0\\",\\"address\\":\\"0x6ff9c8ff8f0b6a0763a3030540c21afc721a9148\\",\\"topics\\":[\\"0x9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c\\",\\"0x02b616af23339f1e031e76333e2d5b1c3067beb78578c961911872cc2127ef8b\\"]}],\\"id\\":1134,\\"jsonrpc\\":\\"2.0\\"}\",\"requestMethod\":\"POST\",\"url\":\"https://goerli.gateway.tenderly.co/1clfZoq7qEGyF4SQvF8gvI\"}}], provider={\"_isProvider\":true,\"_events\":[],\"_emitted\":{\"block\":-2},\"disableCcipRead\":false,\"formatter\":{\"formats\":{\"transaction\":{},\"transactionRequest\":{},\"receiptLog\":{},\"receipt\":{},\"block\":{},\"blockWithTransactions\":{},\"filter\":{},\"filterLog\":{}}},\"anyNetwork\":false,\"_networkPromise\":{},\"_maxInternalBlockNumber\":9009608,\"_lastBlockNumber\":-2,\"_maxFilterBlockRange\":10,\"_pollingInterval\":4000,\"_fastQueryDate\":1684234278178,\"providerConfigs\":[{\"priority\":0,\"provider\":{\"_isProvider\":true,\"_events\":[],\"_emitted\":{\"block\":-2},\"disableCcipRead\":false,\"formatter\":{\"formats\":{\"transaction\":{},\"transactionRequest\":{},\"receiptLog\":{},\"receipt\":{},\"block\":{},\"blockWithTransactions\":{},\"filter\":{},\"filterLog\":{}}},\"anyNetwork\":false,\"_networkPromise\":{},\"_maxInternalBlockNumber\":9009608,\"_lastBlockNumber\":-2,\"_maxFilterBlockRange\":10,\"_pollingInterval\":4000,\"_fastQueryDate\":1684234278688,\"connection\":{\"url\":\"https://goerli.gateway.tenderly.co/1clfZoq7qEGyF4SQvF8gvI\",\"headers\":{\"User-Agent\":\"data-transport-layer\"}},\"_nextId\":1135,\"_eventLoopCache\":{\"detectNetwork\":null,\"eth_chainId\":null,\"eth_blockNumber\":null},\"_network\":{\"name\":\"goerli\",\"chainId\":5,\"ensAddress\":\"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\"},\"_internalBlockNumber\":{},\"_fastBlockNumber\":9009608,\"_fastBlockNumberPromise\":{}},\"stallTimeout\":750,\"weight\":1}],\"quorum\":0.5,\"_highestBlockNumber\":9009608,\"_network\":{\"name\":\"goerli\",\"chainId\":5,\"ensAddress\":\"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\"},\"_internalBlockNumber\":{},\"_fastBlockNumber\":9009608,\"_fastBlockNumberPromise\":{}}, code=SERVER_ERROR, version=providers/5.7.2)\n at Logger.makeError (/opt/optimism/node_modules/@ethersproject/logger/lib/index.js:238:21)\n at Logger.throwError (/opt/optimism/node_modules/@ethersproject/logger/lib/index.js:247:20)\n at FallbackProvider. (/opt/optimism/node_modules/@ethersproject/providers/lib/fallback-provider.js:684:54)\n at step (/opt/optimism/node_modules/@ethersproject/providers/lib/fallback-provider.js:48:23)\n at Object.next (/opt/optimism/node_modules/@ethersproject/providers/lib/fallback-provider.js:29:53)\n at fulfilled (/opt/optimism/node_modules/@ethersproject/providers/lib/fallback-provider.js:20:58)\n at runMicrotasks ()\n at processTicksAndRejections (node:internal/process/task_queues:96:5)","code":"SERVER_ERROR"},"msg":"Caught an unhandled error"}
`
Expected Behavior
Steps to Reproduce
1. 2. 3.
Suggested Fix
@wsdt execute @Boyuan-Chen help