Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ import (
"github.com/ava-labs/coreth/triedb"
"github.com/ava-labs/coreth/triedb/hashdb"
"github.com/ava-labs/coreth/triedb/pathdb"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/lru"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion core/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestMain(m *testing.M) {
opts := []goleak.Option{
// No good way to shut down these goroutines:
goleak.IgnoreTopFunction("github.com/ava-labs/coreth/core/state/snapshot.(*diskLayer).generate"),
goleak.IgnoreTopFunction("github.com/ethereum/go-ethereum/metrics.(*meterArbiter).tick"),
goleak.IgnoreTopFunction("github.com/ava-labs/libevm/metrics.(*meterArbiter).tick"),
goleak.IgnoreTopFunction("github.com/syndtr/goleveldb/leveldb.(*DB).mpoolDrain"),
}
goleak.VerifyTestMain(m, opts...)
Expand Down
2 changes: 1 addition & 1 deletion core/rawdb/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import (
"encoding/binary"

"github.com/ava-labs/avalanchego/utils/wrappers"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/metrics"
)

// The fields below define the low level database schema prefixing.
Expand Down
2 changes: 1 addition & 1 deletion core/state/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

package state

import "github.com/ethereum/go-ethereum/metrics"
import "github.com/ava-labs/libevm/metrics"

var (
accountUpdatedMeter = metrics.NewRegisteredMeter("state/update/account", nil)
Expand Down
2 changes: 1 addition & 1 deletion core/state/snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ import (
"github.com/ava-labs/coreth/core/rawdb"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/triedb"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion core/state/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ import (

"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/trie/trienode"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/rlp"
"github.com/holiman/uint256"
)
Expand Down
2 changes: 1 addition & 1 deletion core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ import (
"github.com/ava-labs/coreth/trie/trienode"
"github.com/ava-labs/coreth/trie/triestate"
"github.com/ava-labs/coreth/utils"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/holiman/uint256"
)

Expand Down
2 changes: 1 addition & 1 deletion core/state/trie_prefetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"sync"

"github.com/ava-labs/coreth/libevm/options"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion core/state/trie_prefetcher_extra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/triedb"
"github.com/ava-labs/coreth/triedb/hashdb"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/metrics"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion core/txpool/blobpool/blobpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ import (
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/params"
"github.com/ava-labs/coreth/plugin/evm/header"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/rlp"
"github.com/holiman/billy"
"github.com/holiman/uint256"
Expand Down
2 changes: 1 addition & 1 deletion core/txpool/blobpool/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

package blobpool

import "github.com/ethereum/go-ethereum/metrics"
import "github.com/ava-labs/libevm/metrics"

var (
// datacapGauge tracks the user's configured capacity for the blob pool. It
Expand Down
2 changes: 1 addition & 1 deletion core/txpool/legacypool/legacypool.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ import (
"github.com/ava-labs/coreth/params"
"github.com/ava-labs/coreth/plugin/evm/header"
"github.com/ava-labs/coreth/utils"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/prque"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/holiman/uint256"
)

Expand Down
2 changes: 1 addition & 1 deletion core/txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ import (

"github.com/ava-labs/coreth/core"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
)

var (
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.23.6
require (
github.com/VictoriaMetrics/fastcache v1.12.1
github.com/ava-labs/avalanchego v1.12.3-name-fortuna.0
github.com/ava-labs/libevm v0.0.0-20250320152422-7be6bee7ab32
github.com/cespare/cp v0.1.0
github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233
github.com/davecgh/go-spew v1.1.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/ava-labs/avalanchego v1.12.3-name-fortuna.0 h1:jABN/xZU6Tp0PTw3Q5lpaHJN/FBseVfJu81lH/2s2hw=
github.com/ava-labs/avalanchego v1.12.3-name-fortuna.0/go.mod h1:SlofKg/9oP71zX8BQT78JWPBNff19tBNY7Cvp6QGQL0=
github.com/ava-labs/libevm v0.0.0-20250320152422-7be6bee7ab32 h1:l8Q4JyvTY+22e6lMLcd6WamMYFJc36MfJmeKflis7nQ=
github.com/ava-labs/libevm v0.0.0-20250320152422-7be6bee7ab32/go.mod h1:+Iol+sVQ1KyoBsHf3veyrBmHCXr3xXRWq6ZXkgVfNLU=
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
Expand Down
29 changes: 29 additions & 0 deletions metrics/prometheus/enabled_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// (c) 2021-2025, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package prometheus_test

import (
"testing"

// NOTE: This test assumes that there are no imported packages that might
// change the default value of [metrics.Enabled]. It is therefore in package
// `prometheus_test` in case any other tests modify the variable. If any
// imports here or in the implementation do actually do so then this test
// may have false negatives.
"github.com/stretchr/testify/assert"

"github.com/ava-labs/libevm/metrics"
)

func TestMetricsEnabledByDefault(t *testing.T) {
assert.True(t, metrics.Enabled, "libevm/metrics.Enabled")

switch m := metrics.NewCounter().(type) {
case metrics.NilCounter:
t.Errorf("metrics.NewCounter() got %T; want %T", m, new(metrics.StandardCounter))
case *metrics.StandardCounter:
default:
t.Errorf("metrics.NewCounter() got unknown type %T", m)
}
}
2 changes: 1 addition & 1 deletion metrics/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/prometheus/client_golang/prometheus"

"github.com/ethereum/go-ethereum/metrics"
"github.com/ava-labs/libevm/metrics"

dto "github.com/prometheus/client_model/go"
)
Expand Down
4 changes: 2 additions & 2 deletions metrics/prometheus/prometheus_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2021-2025, Ava Labs, Inc. All rights reserved.
// (c) 2025, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package prometheus
Expand All @@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/ethereum/go-ethereum/metrics"
"github.com/ava-labs/libevm/metrics"
)

func TestGatherer_Gather(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion peer/peer_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

"github.com/ethereum/go-ethereum/log"

"github.com/ethereum/go-ethereum/metrics"
"github.com/ava-labs/libevm/metrics"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion peer/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package stats
import (
"time"

"github.com/ethereum/go-ethereum/metrics"
"github.com/ava-labs/libevm/metrics"
)

// RequestHandlerStats provides the interface for metrics for app requests.
Expand Down
2 changes: 1 addition & 1 deletion plugin/evm/atomic/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"github.com/prometheus/client_golang/prometheus"

"github.com/ava-labs/coreth/plugin/evm/config"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion plugin/evm/network_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/ava-labs/coreth/triedb"
"github.com/ava-labs/coreth/warp"
warpHandlers "github.com/ava-labs/coreth/warp/handlers"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/metrics"
)

var _ message.RequestHandler = &networkHandler{}
Expand Down
2 changes: 1 addition & 1 deletion plugin/evm/testutils/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package testutils
import (
"testing"

"github.com/ethereum/go-ethereum/metrics"
"github.com/ava-labs/libevm/metrics"
)

// WithMetrics enables go-ethereum metrics globally for the test.
Expand Down
2 changes: 1 addition & 1 deletion plugin/evm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import (
"github.com/ava-labs/coreth/triedb"
"github.com/ava-labs/coreth/triedb/hashdb"
"github.com/ava-labs/coreth/utils"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ava-labs/libevm/metrics"

warpcontract "github.com/ava-labs/coreth/precompile/contracts/warp"
"github.com/ava-labs/coreth/rpc"
Expand Down
2 changes: 1 addition & 1 deletion rpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ import (
"sync"
"time"

"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"golang.org/x/time/rate"
)

Expand Down
2 changes: 1 addition & 1 deletion rpc/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"fmt"
"time"

"github.com/ethereum/go-ethereum/metrics"
"github.com/ava-labs/libevm/metrics"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion sync/client/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"

"github.com/ava-labs/coreth/plugin/evm/message"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ava-labs/libevm/metrics"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion sync/handlers/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package stats
import (
"time"

"github.com/ethereum/go-ethereum/metrics"
"github.com/ava-labs/libevm/metrics"
)

// HandlerStats reports prometheus metrics for the state sync handlers
Expand Down
2 changes: 1 addition & 1 deletion sync/statesync/trie_sync_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (

utils_math "github.com/ava-labs/avalanchego/utils/math"
"github.com/ava-labs/avalanchego/utils/timer"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion sync/statesync/trie_sync_stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

"github.com/ethereum/go-ethereum/metrics"
"github.com/ava-labs/libevm/metrics"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion trie/stacktrie.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import (
"sync"

"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion trie/utils/verkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"encoding/binary"
"sync"

"github.com/ava-labs/libevm/metrics"
"github.com/crate-crypto/go-ipa/bandersnatch/fr"
"github.com/ethereum/go-ethereum/common/lru"
"github.com/ethereum/go-ethereum/metrics"
"github.com/gballet/go-verkle"
"github.com/holiman/uint256"
)
Expand Down
2 changes: 1 addition & 1 deletion triedb/hashdb/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ import (
"github.com/ava-labs/coreth/trie/trienode"
"github.com/ava-labs/coreth/trie/triestate"
"github.com/ava-labs/coreth/utils"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/rlp"
)

Expand Down
2 changes: 1 addition & 1 deletion triedb/pathdb/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

package pathdb

import "github.com/ethereum/go-ethereum/metrics"
import "github.com/ava-labs/libevm/metrics"

// nolint: unused
var (
Expand Down
2 changes: 1 addition & 1 deletion utils/metered_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"

"github.com/VictoriaMetrics/fastcache"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ava-labs/libevm/metrics"
)

// MeteredCache wraps *fastcache.Cache and periodically pulls stats from it.
Expand Down
2 changes: 1 addition & 1 deletion warp/handlers/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package handlers
import (
"time"

"github.com/ethereum/go-ethereum/metrics"
"github.com/ava-labs/libevm/metrics"
)

type handlerStats struct {
Expand Down
2 changes: 1 addition & 1 deletion warp/verifier_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package warp

import (
"github.com/ethereum/go-ethereum/metrics"
"github.com/ava-labs/libevm/metrics"
)

type verifierStats struct {
Expand Down
Loading