Skip to content

Commit

Permalink
fix: fix missing update on the latest block (#173)
Browse files Browse the repository at this point in the history
# Description

Follow up on an error from #172 

Basically, I forgot to update the latest block after the warm up (when
we are subscribing to new blocks)

I noticed, because the chart looks funny!

<img width="1426" alt="image"
src="https://github.com/user-attachments/assets/737bbdf0-c155-4603-91d7-94b9aaae3f2d">

This PR should address the issue.
  • Loading branch information
anxolin authored Dec 7, 2024
1 parent a6aaf36 commit e98fb81
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/services/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ export class ChainContext {
log.debug(`Watchdog timeout: ${watchdogTimeout} seconds`);
let lastBlockReceived = lastProcessedBlock;
provider.on("block", async (blockNumber: number) => {
metrics.blockHeight.labels(chainId.toString()).set(blockNumber);

try {
log = getLogger({
name: loggerName,
Expand Down

0 comments on commit e98fb81

Please sign in to comment.