Skip to content

Conversation

@alarso16
Copy link
Contributor

@alarso16 alarso16 commented Dec 29, 2025

Why this should be merged

Firewood metrics aren't particularly expensive, and there's a ticket to expose more expensive metrics within Firewood. It should always be registered.

How this works

ffi.StartMetrics can only be called once per process, otherwirse it returns an error. This is a problem for tests, so this is moved to an init function, guaranteeing it will only happen once.

How this was tested

Locally, to ensure metrics are still scrapable.
image

Need to be documented in RELEASES.md?

No.

@alarso16 alarso16 self-assigned this Dec 29, 2025
@alarso16 alarso16 added bug Something isn't working evm Related to EVM functionality labels Dec 29, 2025
@alarso16 alarso16 marked this pull request as ready for review December 30, 2025 16:33
@alarso16 alarso16 requested a review from a team as a code owner December 30, 2025 16:33
Copilot AI review requested due to automatic review settings December 30, 2025 16:33
Copy link
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 ensures Firewood metrics are always registered when Firewood is enabled, rather than conditionally based on the MetricsExpensiveEnabled flag. The initialization of metrics is moved to an init() function to avoid errors from multiple calls to ffi.StartMetrics() during testing.

Key changes:

  • Moved ffi.StartMetrics() call to an init() function in a new metrics.go file
  • Removed the MetricsExpensiveEnabled condition from metric registration logic
  • Simplified error messages for metric registration failures

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
graft/evm/firewood/metrics.go New file introducing init() function to start Firewood metrics once per process
graft/subnet-evm/plugin/evm/vm.go Removed conditional check for expensive metrics and simplified registration logic
graft/coreth/plugin/evm/vm.go Removed conditional check for expensive metrics and simplified registration logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@maru-ava maru-ava enabled auto-merge January 6, 2026 15:35
@maru-ava maru-ava added this pull request to the merge queue Jan 6, 2026
Merged via the queue into master with commit a99251d Jan 6, 2026
53 checks passed
@maru-ava maru-ava deleted the alarso16/firewood-metrics branch January 6, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working evm Related to EVM functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants