Skip to content

Fix block time calculation - #67

Merged
qezz merged 1 commit into
mainfrom
fix-block-time-avg
Jun 22, 2026
Merged

Fix block time calculation#67
qezz merged 1 commit into
mainfrom
fix-block-time-avg

Conversation

@qezz

@qezz qezz commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Previously, the function would unconditionally update the last seen block height value and time, which is not correct if the height scrape interval is lower than block time.

E.g. if watchers.height-interval is set to 600ms, and the real block time is 1.5s, then the block duration will be always shown as 600ms.

Updating the block timestamp only when the new block height is different seems to be the correct approach.


checked on one of the instances

Previously, the function would unconditionally update the last seen
block height value and time, which is not correct if the height scrape
interval is lower than block time.

E.g. if `watchers.height-interval` is set to 600ms, and the real block
time is 1.5s, then the block duration will be always shown as 600ms.

Updating the block timestamp only when the new block height is
different seems to be the correct approach.
@qezz
qezz requested a review from a team June 22, 2026 15:20
@qezz
qezz merged commit 4b3fa12 into main Jun 22, 2026
2 checks passed
@qezz
qezz deleted the fix-block-time-avg branch June 22, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants