Skip to content

Commit

Permalink
chore: add log msg on highest block check (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
nvtaveras authored Dec 20, 2024
1 parent f6164f3 commit 44a0a19
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "celo-oracle",
"version": "2.0.16-beta",
"version": "2.0.17-beta",
"description": "Oracle application to aggregate and report exchange rates to the Celo network",
"author": "Celo",
"license": "Apache-2.0",
Expand Down
15 changes: 9 additions & 6 deletions src/reporters/block_based_reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,15 @@ export class BlockBasedReporter extends BaseReporter {

performBlockHeaderChecks(blockHeader: BlockHeader) {
// Ensure this is the highest block number we've seen
// Temporary disable this check as it seems to cause issues after the L2 upgrade, likely because of the faster block times
// if (this.highestObservedBlockNumber && blockHeader.number <= this.highestObservedBlockNumber) {
// throw Error(
// `Block number is lower than the highest previously observed block: ${blockHeader.number} <= ${this.highestObservedBlockNumber}`
// )
// }
if (this.highestObservedBlockNumber && blockHeader.number <= this.highestObservedBlockNumber) {
// Temporary disable this throw as it seems to cause issues after the L2 upgrade, likely because of the faster block times
// throw Error(
// `Block number is lower than the highest previously observed block: ${blockHeader.number} <= ${this.highestObservedBlockNumber}`
// )
this.logger.warn(
`New Block number (${blockHeader.number}) is lower than the highest previously observed block (${this.highestObservedBlockNumber})`
)
}
const now = Date.now()
// now is in ms, and blockHeader.timestamp is in seconds, so we convert it to ms
const blockTimestampMs = secondsToMs(blockHeader.timestamp as number)
Expand Down

0 comments on commit 44a0a19

Please sign in to comment.