Commit f4cd5c0e authored by Matthew Slipper's avatar Matthew Slipper Committed by GitHub

Merge pull request #4005 from ethereum-optimism/sc/dtl-fast-goerli-sync

feat(dtl): fast goerli sync
parents 23630395 7c90d5a4
---
'@eth-optimism/data-transport-layer': patch
---
Patch for fast Goerli sync
...@@ -426,6 +426,36 @@ export class L1IngestionService extends BaseService<L1IngestionServiceOptions> { ...@@ -426,6 +426,36 @@ export class L1IngestionService extends BaseService<L1IngestionServiceOptions> {
fromBlock: l1BlockRangeStart, fromBlock: l1BlockRangeStart,
toBlock: toL1Block, toBlock: toL1Block,
}) })
} else if (this.options.l2ChainId === 420) {
if (
l1BlockRangeStart < 7260849 &&
contractName === 'StateCommitmentChain'
) {
if (toL1Block < 7260849) {
eventRanges.push({
address: '0x72281826e90dd8a65ab686ff254eb45be426dd22',
fromBlock: l1BlockRangeStart,
toBlock: toL1Block,
})
} else {
eventRanges.push({
address: '0x72281826e90dd8a65ab686ff254eb45be426dd22',
fromBlock: l1BlockRangeStart,
toBlock: 7260849,
})
eventRanges.push({
address: await this._getFixedAddress(contractName),
fromBlock: 7260849,
toBlock: toL1Block,
})
}
} else {
eventRanges.push({
address: await this._getFixedAddress(contractName),
fromBlock: l1BlockRangeStart,
toBlock: toL1Block,
})
}
} else { } else {
// Addresses can change on non-mainnet deployments. If an address changes, we will // Addresses can change on non-mainnet deployments. If an address changes, we will
// potentially need to sync events from both the old address and the new address. We will // potentially need to sync events from both the old address and the new address. We will
...@@ -533,9 +563,16 @@ export class L1IngestionService extends BaseService<L1IngestionServiceOptions> { ...@@ -533,9 +563,16 @@ export class L1IngestionService extends BaseService<L1IngestionServiceOptions> {
const filter = const filter =
this.state.contracts.Lib_AddressManager.filters.OwnershipTransferred() this.state.contracts.Lib_AddressManager.filters.OwnershipTransferred()
for (let i = 0; i < currentL1Block; i += 2000) { for (
let i = 0;
i < currentL1Block;
i += this.options.logsPerPollingInterval
) {
const start = i const start = i
const end = Math.min(i + 2000, currentL1Block) const end = Math.min(
i + this.options.logsPerPollingInterval,
currentL1Block
)
this.logger.info(`Searching for ${filter} from ${start} to ${end}`) this.logger.info(`Searching for ${filter} from ${start} to ${end}`)
const events = await this.state.contracts.Lib_AddressManager.queryFilter( const events = await this.state.contracts.Lib_AddressManager.queryFilter(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment