Skip to content

Commit

Permalink
Use go-ethereum instead of libevm
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Jan 14, 2025
1 parent 0667830 commit 928d299
Show file tree
Hide file tree
Showing 40 changed files with 39 additions and 40 deletions.
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/ava-labs/libevm/metrics.(*meterArbiter).tick"),
goleak.IgnoreTopFunction("github.com/ethereum/go-ethereum/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/ava-labs/libevm/metrics"
import "github.com/ethereum/go-ethereum/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 @@ -42,10 +42,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/txpool"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/params"
"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/ava-labs/libevm/metrics"
import "github.com/ethereum/go-ethereum/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/core/types"
"github.com/ava-labs/coreth/params"
"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: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.22.8
require (
github.com/VictoriaMetrics/fastcache v1.12.1
github.com/ava-labs/avalanchego v1.12.2-0.20250106102004-902377d447ba
github.com/ava-labs/libevm v1.13.14-0.1.0-rc.1
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: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ 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.2-0.20250106102004-902377d447ba h1:7t2ORGM53sqdsczNZGFQIK99of9yeetCld90keJ47Os=
github.com/ava-labs/avalanchego v1.12.2-0.20250106102004-902377d447ba/go.mod h1:oK/C7ZGo5cAEayBKBoawh2EpOo3E9gD1rpd9NAM0RkQ=
github.com/ava-labs/libevm v1.13.14-0.1.0-rc.1 h1:ughW0E2DUNRnvwJYNU8zUSCUzIWdcOwyXSBpy7oauZE=
github.com/ava-labs/libevm v1.13.14-0.1.0-rc.1/go.mod h1:yBctIV/wnxXTF38h95943jvpuk4aj07TrjbpoGor6LQ=
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
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/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/metrics"

dto "github.com/prometheus/client_model/go"
)
Expand Down
2 changes: 1 addition & 1 deletion metrics/prometheus/prometheus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/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/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/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/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/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/syncervm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ import (
"github.com/ava-labs/coreth/sync/statesync"
"github.com/ava-labs/coreth/trie"
"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"
"github.com/ethereum/go-ethereum/rlp"
)

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

warpcontract "github.com/ava-labs/coreth/precompile/contracts/warp"
"github.com/ava-labs/coreth/rpc"
Expand Down
2 changes: 1 addition & 1 deletion plugin/evm/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/ava-labs/coreth/plugin/evm/config"
"github.com/ava-labs/coreth/trie"
"github.com/ava-labs/coreth/utils"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/metrics"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
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/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/metrics"
)

var (
Expand Down
2 changes: 2 additions & 0 deletions scripts/geth-allowed-packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@
"github.com/ethereum/go-ethereum/ethdb/pebble"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/metrics.(*meterArbiter).tick"
"github.com/ethereum/go-ethereum/rlp"
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/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/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/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/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/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/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/ava-labs/libevm/metrics"
import "github.com/ethereum/go-ethereum/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/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/metrics"
)

// MeteredCache wraps *fastcache.Cache and periodically pulls stats from it.
Expand Down
2 changes: 1 addition & 1 deletion warp/handlers/signature_request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/ava-labs/coreth/utils"
"github.com/ava-labs/coreth/warp"
"github.com/ava-labs/coreth/warp/warptest"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/metrics"
"github.com/stretchr/testify/require"
)

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/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/metrics"
)

type handlerStats struct {
Expand Down
2 changes: 1 addition & 1 deletion warp/verifier_backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/ava-labs/avalanchego/vms/platformvm/warp/payload"
"github.com/ava-labs/coreth/utils"
"github.com/ava-labs/coreth/warp/warptest"
"github.com/ava-labs/libevm/metrics"
"github.com/ethereum/go-ethereum/metrics"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/proto"
)
Expand Down
Loading

0 comments on commit 928d299

Please sign in to comment.