Skip to content

fix: make the received block metrics correct#357

Merged
joey0612 merged 2 commits into
developfrom
debug-crossregion
May 21, 2026
Merged

fix: make the received block metrics correct#357
joey0612 merged 2 commits into
developfrom
debug-crossregion

Conversation

@will-2012

@will-2012 will-2012 commented May 21, 2026

Copy link
Copy Markdown
Contributor

Description

Make the received block metrics correct to ensure the reth_chain_delay_block_recv metrics are accurate for more effective network latency troubleshooting.

Rationale

  1. Make the ms-timestamp correct.
  2. Do not update the received block metrics of the self-mined block.

Example

N/A.

Changes

Notable changes:

  • Metrics*

Potential Impacts

N/A.

@will-2012 will-2012 requested a review from joey0612 as a code owner May 21, 2026 00:32
@hashdit-bot

hashdit-bot Bot commented May 21, 2026

Copy link
Copy Markdown

Pull Request Review

This PR refactors block delay metric handling in the Parlia consensus path to use full millisecond-precision block timestamps derived from the header (including Lorentz-era ms data), instead of second-only timestamps. It also separates metric behavior between network-received blocks and self-mined blocks by introducing register_self_mined_block, preventing locally produced blocks from contaminating the chain.delay.block_recv propagation metric. Call sites in block import service were updated to pass full headers and use the new self-mined registration path.

Sensitive Content

No sensitive content detected.

Security Issues

No serious security issues detected.


Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits.

@will-2012 will-2012 changed the title fix: Make the received block metrics correct fix: make the received block metrics correct May 21, 2026
cargo-udeps 0.1.61 segfaults on nightly >= 2026-05-19 due to an
incompatibility with rustc internals. Pin to the last known-good
nightly to unblock CI. A follow-up should migrate to cargo-machete
to remove the nightly fragility entirely.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hashdit-bot

hashdit-bot Bot commented May 21, 2026

Copy link
Copy Markdown

Pull Request Review

This PR refactors chain-delay metric handling in a Rust blockchain client (Parlia/BSC context) to improve accuracy of reth_chain_delay_block_recv measurements. It changes block timestamp handling to use millisecond precision derived from the full header (calculate_millisecond_timestamp) and separates logic for network-received blocks vs self-mined blocks. It also updates call sites in block import flow accordingly and pins the CI udeps nightly toolchain to a specific date for reproducibility.

Sensitive Content

No sensitive content detected.

Security Issues

No serious security issues detected.


Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits.

@joey0612 joey0612 merged commit 32a07ee into develop May 21, 2026
8 checks passed
chee-chyuan pushed a commit that referenced this pull request May 21, 2026
* fix: make receive block metrics correct

* ci: pin udeps job to nightly-2026-05-11

cargo-udeps 0.1.61 segfaults on nightly >= 2026-05-19 due to an
incompatibility with rustc internals. Pin to the last known-good
nightly to unblock CI. A follow-up should migrate to cargo-machete
to remove the nightly fragility entirely.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

3 participants