Skip to content

core/miner: observability for block building delays#1682

Merged
manav2401 merged 3 commits intodevelopfrom
manav/txpool-metrics
Aug 6, 2025
Merged

core/miner: observability for block building delays#1682
manav2401 merged 3 commits intodevelopfrom
manav/txpool-metrics

Conversation

@manav2401
Copy link
Copy Markdown
Member

Description

Adds some observability to capture delays during block building. Mainly captures

  1. Time taken to acquire lock in pending pool
  2. Time taken for the whole pending call to finish (this matters the most for miner during block building)
  3. Time taken to release the lock held during tx pool reorg
  4. Time taken to init a heap out of the pending transactions before starting to execute transactions
  5. Time taken to actually execute transactions in ideal mining workflow

Changes

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Nodes audience

In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply
  • Created a task in Jira and informed the team for implementation in Erigon client (if applicable)
  • Includes RPC methods changes, and the Notion documentation has been updated

Cross repository changes

  • This PR requires changes to heimdall
    • In case link the PR here:
  • This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on amoy
  • I have created new e2e tests into express-cli

Manual tests

Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

@kamuikatsurgi kamuikatsurgi requested a review from Copilot August 5, 2025 06:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds observability metrics to track delays during block building in the Ethereum miner. The goal is to provide better insights into where bottlenecks occur during the mining process, particularly around transaction pool operations and transaction execution.

Key changes include:

  • Added timing metrics for transaction heap initialization and transaction execution in the worker
  • Added timing metrics for lock acquisition and total duration of pending transaction retrieval from the transaction pool
  • Added timing metrics for lock duration during transaction pool reorganization

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
miner/worker.go Adds metrics for transaction heap initialization and transaction execution timing
core/txpool/legacypool/legacypool.go Adds metrics for pending call duration, lock wait times, and reorg lock duration

manav2401 and others added 2 commits August 6, 2025 05:41
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@manav2401 manav2401 merged commit de1f112 into develop Aug 6, 2025
7 of 8 checks passed
@manav2401 manav2401 deleted the manav/txpool-metrics branch August 6, 2025 00:13
nebojsa94 pushed a commit to nebojsa94/bor that referenced this pull request Aug 14, 2025
Adds some observability to capture delays during block building. 

- Time taken to acquire lock in pending pool
- Time taken for the whole pending call to finish (this matters the most for miner during block building)
- Time taken to release the lock held during tx pool reorg
- Time taken to init a heap out of the pending transactions before starting to execute transactions
- Time taken to actually execute transactions in ideal mining workflow
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.

5 participants