fix: batch getLogs in upgradeExecutorFetchPrivilegedAccounts - #745
Open
gomesalexandre wants to merge 1 commit into
Open
fix: batch getLogs in upgradeExecutorFetchPrivilegedAccounts#745gomesalexandre wants to merge 1 commit into
gomesalexandre wants to merge 1 commit into
Conversation
`upgradeExecutorFetchPrivilegedAccounts` queried the RoleGranted and RoleRevoked events with a single `fromBlock: 0n, toBlock: 'latest'` call. Most RPC providers cap `eth_getLogs` to a bounded block range, so this fails with "query range is too big" on nearly every endpoint, including https://sepolia-rollup.arbitrum.io/rpc. Use `getLogsWithBatching`, the same helper the other fetchers (getBatchPosters, getValidators, getKeysets, ...) already use: it tries the full range first and falls back to fixed-size batches on failure, so it works against range-limited RPCs. closes OffchainLabs#642
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #642
what
upgradeExecutorFetchPrivilegedAccountsfetched theRoleGrantedandRoleRevokedevents with a singlegetLogs({ fromBlock: 0n, toBlock: 'latest' })per event. Most RPC providers capeth_getLogsto a bounded block range, so this fails with "query range is too big" on nearly every endpoint (includinghttps://sepolia-rollup.arbitrum.io/rpc), making the function unusable there.how
Use
getLogsWithBatching, the helper the other fetchers already use (getBatchPosters,getValidators,getKeysets,createRollupFetchCoreContracts). It attempts the full range first and, on failure, falls back to fixed-size (9,999-block) batches from the latest block down to the rollup-creator deployment block, so it works against range-limited RPCs while staying fast on permissive ones.tests
Added a unit test that mocks the RPC to reject the full-range query and asserts the function batches (rather than throwing) and returns the correct privileged account. It fails against the previous implementation.
test:unit(vitest) passes,tsc,eslint,prettier --checkclean.