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

Record BEACON_BLOCK_DELAY_GOSSIP metric only after a bock is verified #6046

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

chong-he
Copy link
Member

@chong-he chong-he commented Jul 4, 2024

@michaelsproul found that the BEACON_BLOCK_DELAY_GOSSIP metric is recorded before the block is verified:

metrics::set_gauge(
&metrics::BEACON_BLOCK_DELAY_GOSSIP,
block_delay.as_millis() as i64,
);
let verification_result = self
.chain
.clone()
.verify_block_for_gossip(block.clone())
.await;

This causes the metric could record a time in the range minutes-hours if an old block is received, see https://discord.com/channels/605577013327167508/746918775919738893/1255734712971038810

This PR fixes it so that the metric is only recorded after the block is verified.

Thanks @michaelsproul !

@chong-he chong-he added the ready-for-review The code is ready for review label Jul 4, 2024
Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@michaelsproul michaelsproul added bug Something isn't working ready-for-merge This PR is ready to merge. v5.3.0 Q3 2024 release with database changes! and removed ready-for-review The code is ready for review labels Jul 5, 2024
@michaelsproul
Copy link
Member

@mergify queue

Copy link

mergify bot commented Jul 5, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 8e0bc9a

@mergify mergify bot merged commit 8e0bc9a into sigp:unstable Jul 5, 2024
28 checks passed
@chong-he chong-he deleted the block-gossip-metric branch July 16, 2024 05:36
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready-for-merge This PR is ready to merge. v5.3.0 Q3 2024 release with database changes!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants