Commit 287d317d authored by Maurelian's avatar Maurelian

feat(cmon): fix time string formatting bug

parent 62c7f3b0
---
'@eth-optimism/chain-mon': patch
---
Fixed an issue with logging the wrong timestamp.
...@@ -191,16 +191,14 @@ export class WithdrawalMonitor extends BaseServiceV2<Options, Metrics, State> { ...@@ -191,16 +191,14 @@ export class WithdrawalMonitor extends BaseServiceV2<Options, Metrics, State> {
await this.state.messenger.contracts.l2.BedrockMessagePasser.sentMessages( await this.state.messenger.contracts.l2.BedrockMessagePasser.sentMessages(
proofEvent.args.withdrawalHash proofEvent.args.withdrawalHash
) )
const provenAt = `${ const block = await proofEvent.getBlock()
(dateformat( const now = new Date(block.timestamp * 1000)
new Date( const dateString = dateformat(
(await this.options.l1RpcProvider.getBlock(proofEvent.blockHash)) now,
.timestamp * 1000
)
),
'mmmm dS, yyyy, h:MM:ss TT', 'mmmm dS, yyyy, h:MM:ss TT',
true) true // use UTC time
} UTC` )
const provenAt = `${dateString} UTC`
if (exists) { if (exists) {
this.metrics.withdrawalsValidated.inc() this.metrics.withdrawalsValidated.inc()
this.logger.info(`valid withdrawal`, { this.logger.info(`valid withdrawal`, {
......
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