Skip to content

core, core/state: fix storage and block import metrics - #3838

Merged
zlacfzy merged 1 commit into
bnb-chain:developfrom
zlacfzy:codex/fix-state-import-metrics
Oct 8, 2026
Merged

zlacfzy merged 1 commit into
bnb-chain:developfrom
zlacfzy:codex/fix-state-import-metrics

Conversation

@zlacfzy

@zlacfzy zlacfzy commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Initialize the storage-update timer before processing trie updates, preventing zero-time durations from overflowing state timing statistics. Report block import duration and throughput only through ExecuteStats.reportMetrics, so each imported block contributes one sample to chain/inserts and chain/mgasps.

Validation:

  • Focused state tests: TestUpdateLeaks, TestIntermediateLeaks, and TestStorageDirtiness.
  • In-memory reproductions: empty-state timing stays finite across repeated calls; importing one block records one sample in each import metric.
  • make all, repository lint (including cmd/keeper), generated-file/module hygiene checks, and forbidden-dependency checks all passed.

Tests were limited to the affected logic; the full test suite was not run.

@hashdit-bot

hashdit-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

Pull Request Review

This PR initializes the state storage-update timer before trie processing, preventing invalid or overflowing timing statistics when processing completes immediately. It also removes duplicate block import duration and throughput metric updates from ProcessBlock, leaving ExecuteStats.reportMetrics as the single reporting 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.

@zlacfzy
zlacfzy merged commit d9b8610 into bnb-chain:develop Oct 8, 2026
8 checks passed
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.

4 participants