-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: batch long-range log queries (#208)
- Loading branch information
1 parent
0c87bf6
commit 7cc5266
Showing
10 changed files
with
677 additions
and
60 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
44 changes: 44 additions & 0 deletions
44
src/utils/getEarliestRollupCreatorDeploymentBlockNumber.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Chain, PublicClient, Transport } from 'viem'; | ||
import { | ||
mainnet, | ||
arbitrumOne, | ||
arbitrumNova, | ||
base, | ||
sepolia, | ||
holesky, | ||
arbitrumSepolia, | ||
baseSepolia, | ||
nitroTestnodeL1, | ||
nitroTestnodeL2, | ||
} from '../chains'; | ||
import { validateParentChain } from '../types/ParentChain'; | ||
|
||
const earliestRollupCreatorDeploymentBlockNumber: Record<number, bigint> = { | ||
// mainnet L1 | ||
[mainnet.id]: 18_736_164n, | ||
// mainnet L2 | ||
[arbitrumOne.id]: 150_599_584n, | ||
[arbitrumNova.id]: 47_798_739n, | ||
[base.id]: 12_978_604n, | ||
// testnet L1 | ||
[sepolia.id]: 4_741_823n, | ||
[holesky.id]: 1_118_493n, | ||
// testnet L2 | ||
[arbitrumSepolia.id]: 654_628n, | ||
[baseSepolia.id]: 10_606_961n, | ||
// local nitro-testnode | ||
[nitroTestnodeL1.id]: 0n, | ||
[nitroTestnodeL2.id]: 0n, | ||
}; | ||
|
||
export function getEarliestRollupCreatorDeploymentBlockNumber<TChain extends Chain | undefined>( | ||
publicClient: PublicClient<Transport, TChain>, | ||
) { | ||
const { chainId, isCustom } = validateParentChain(publicClient); | ||
|
||
if (isCustom) { | ||
return 0n; | ||
} | ||
|
||
return earliestRollupCreatorDeploymentBlockNumber[chainId]; | ||
} |
Oops, something went wrong.