Skip to content

Commit

Permalink
better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariano Goldman committed Jul 1, 2024
1 parent 281aeae commit 6d4e09a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions content/src/service/validations/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export async function createOnChainValidator(
l2Provider: HTTPProvider
): Promise<ValidateFn> {
const { env, metrics, logs, externalCalls } = components
const logger = logs.getLogger('OnChainValidator')
const l1Network: 'mainnet' | 'sepolia' = env.getConfig(EnvironmentConfig.ETH_NETWORK)
const l2Network = l1Network === 'mainnet' ? 'polygon' : 'amoy'

Expand Down Expand Up @@ -119,9 +120,9 @@ export async function createOnChainValidator(
const file = `blocks-cache-${networkName}.csv`
try {
await loadTree(tree, file, converter)
console.log(`loading snapshot for ${networkName} took ${new Date().getTime() - start} ms.`)
logger.debug(`loading snapshot for ${networkName} took ${new Date().getTime() - start} ms.`)
} catch (e) {
console.log(`failed to load cache file ${file}`, e.toString())
logger.warn(`failed to load cache file ${file}`, e.toString())
}
}
await warmUpCache(l1BlockSearch.tree, l1Network)
Expand Down

0 comments on commit 6d4e09a

Please sign in to comment.