Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add log msg on highest block check #281

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
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
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
Loading