Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class CanonicalChainBatchSubmitter extends ScheduledTask {
// Returns the most recent block number with a L1 to L2 transaction
protected async getBatchSubmissionBlockNumber(): Promise<number> {
const results = await Promise.all([
this.dataService.getMaxL1BlockNumber(),
this.getMaxL1BlockNumber(),
this.getMaxL1ToL2QueueBlockNumber(),
this.getMaxSafetyQueueBlockNumber(),
])
Expand All @@ -183,6 +183,10 @@ export class CanonicalChainBatchSubmitter extends ScheduledTask {
}
}

if (min === Number.MAX_SAFE_INTEGER) {
throw new Error('Unable to fetch batch submission block number')
}

return min
}

Expand Down Expand Up @@ -491,6 +495,14 @@ export class CanonicalChainBatchSubmitter extends ScheduledTask {
)
}

private async getMaxL1BlockNumber(): Promise<number> {
try {
return await this.dataService.getMaxL1BlockNumber()
} catch (e) {
return undefined
}
}

private async catchQueueIsEmptyAndReturnUndefined(
func: () => Promise<number>
): Promise<number> {
Expand Down