diff --git a/.changeset/smooth-bulldogs-hear.md b/.changeset/smooth-bulldogs-hear.md new file mode 100644 index 0000000000000000000000000000000000000000..f92cbb68218a523d17658b6064aa77c2c223c826 --- /dev/null +++ b/.changeset/smooth-bulldogs-hear.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/chain-mon': patch +--- + +Fixed an issue with logging the wrong timestamp. diff --git a/packages/chain-mon/src/wd-mon/service.ts b/packages/chain-mon/src/wd-mon/service.ts index c75a772eb407ef9474479a54ea08555638699881..259c34b49fb57cabe9380fc2077fc2b23bb60139 100644 --- a/packages/chain-mon/src/wd-mon/service.ts +++ b/packages/chain-mon/src/wd-mon/service.ts @@ -191,16 +191,14 @@ export class WithdrawalMonitor extends BaseServiceV2<Options, Metrics, State> { await this.state.messenger.contracts.l2.BedrockMessagePasser.sentMessages( proofEvent.args.withdrawalHash ) - const provenAt = `${ - (dateformat( - new Date( - (await this.options.l1RpcProvider.getBlock(proofEvent.blockHash)) - .timestamp * 1000 - ) - ), + const block = await proofEvent.getBlock() + const now = new Date(block.timestamp * 1000) + const dateString = dateformat( + now, 'mmmm dS, yyyy, h:MM:ss TT', - true) - } UTC` + true // use UTC time + ) + const provenAt = `${dateString} UTC` if (exists) { this.metrics.withdrawalsValidated.inc() this.logger.info(`valid withdrawal`, {