Skip to content

Commit

Permalink
Inlined the evm (ava-labs#1092)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph authored Jan 11, 2022
1 parent 3765210 commit 7dd7bea
Show file tree
Hide file tree
Showing 7 changed files with 306 additions and 13 deletions.
12 changes: 12 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,20 @@ builds:
flags:
- -v
ignore:
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: darwin
goarch: 386
- goos: linux
goarch: 386
- goos: windows
goarch: 386
- goos: freebsd
goarch: 386

release:
# Repo in which the release will be created.
Expand Down
11 changes: 1 addition & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ go 1.16
require (
github.com/Microsoft/go-winio v0.4.14
github.com/NYTimes/gziphandler v1.1.1
github.com/ava-labs/coreth v0.8.4-rc.1
github.com/btcsuite/btcutil v1.0.2
github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200627015759-01fd2de07837
github.com/golang-jwt/jwt v3.2.1+incompatible
github.com/golang/protobuf v1.5.2 // indirect
github.com/gorilla/handlers v1.4.2
github.com/gorilla/mux v1.8.0
github.com/gorilla/rpc v1.2.0
Expand All @@ -27,33 +27,24 @@ require (
github.com/jackpal/gateway v1.0.6
github.com/jackpal/go-nat-pmp v1.0.2
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0
github.com/kr/text v0.2.0 // indirect
github.com/linxGnu/grocksdb v1.6.34
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/mr-tron/base58 v1.2.0
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d
github.com/prometheus/client_golang v1.7.1
github.com/prometheus/client_model v0.2.0
github.com/rs/cors v1.7.0
github.com/spaolacci/murmur3 v1.1.0
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.1
github.com/stretchr/objx v0.2.0 // indirect
github.com/stretchr/testify v1.7.0
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2
golang.org/x/exp v0.0.0-20191227195350-da58074b4299 // indirect
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac
gonum.org/v1/gonum v0.9.1
google.golang.org/grpc v1.37.0
google.golang.org/protobuf v1.27.1
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gotest.tools v2.2.0+incompatible
)
287 changes: 287 additions & 0 deletions go.sum

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"

coreth "github.com/ava-labs/coreth/plugin/evm"

"github.com/ava-labs/avalanchego/api/admin"
"github.com/ava-labs/avalanchego/api/auth"
"github.com/ava-labs/avalanchego/api/health"
Expand Down Expand Up @@ -683,6 +685,7 @@ func (n *Node) initChainManager(avaxAssetID ids.ID) error {
n.Config.VMManager.RegisterFactory(secp256k1fx.ID, &secp256k1fx.Factory{}),
n.Config.VMManager.RegisterFactory(nftfx.ID, &nftfx.Factory{}),
n.Config.VMManager.RegisterFactory(propertyfx.ID, &propertyfx.Factory{}),
n.Config.VMManager.RegisterFactory(evm.ID, &coreth.Factory{}),
rpcchainvm.RegisterPlugins(n.Config.PluginDir, n.Config.VMManager),
)
if errs.Errored() {
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_avalanche.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ source "$AVALANCHE_PATH"/scripts/constants.sh
# Build with rocksdb allowed only if the environment variable ROCKSDBALLOWED is set
if [ -z ${ROCKSDBALLOWED+x} ]; then
echo "Building AvalancheGo..."
go build -ldflags "-X github.com/ava-labs/avalanchego/version.GitCommit=$git_commit $static_ld_flags" -o "$avalanchego_path" "$AVALANCHE_PATH/main/"*.go
go build -ldflags "-X github.com/ava-labs/avalanchego/version.GitCommit=$git_commit -X github.com/ava-labs/coreth/plugin/evm.Version=$coreth_version $static_ld_flags" -o "$avalanchego_path" "$AVALANCHE_PATH/main/"*.go
else
echo "Building AvalancheGo with rocksdb enabled..."
go build -tags rocksdballowed -ldflags "-X github.com/ava-labs/avalanchego/version.GitCommit=$git_commit $static_ld_flags" -o "$avalanchego_path" "$AVALANCHE_PATH/main/"*.go
Expand Down
2 changes: 1 addition & 1 deletion scripts/versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

# Set up the versions to be used
# Don't export them as their used in the context of other calls
coreth_version=${CORETH_VERSION:-'v0.8.3-rc.3'}
coreth_version=${CORETH_VERSION:-'v0.8.4-rc0'}
2 changes: 1 addition & 1 deletion version/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

// These are globals that describe network upgrades and node versions
var (
Current = NewDefaultVersion(1, 7, 3)
Current = NewDefaultVersion(1, 7, 4)
CurrentApp = NewDefaultApplication(constants.PlatformName, Current.Major(), Current.Minor(), Current.Patch())
MinimumCompatibleVersion = NewDefaultApplication(constants.PlatformName, 1, 7, 0)
PrevMinimumCompatibleVersion = NewDefaultApplication(constants.PlatformName, 1, 6, 0)
Expand Down

0 comments on commit 7dd7bea

Please sign in to comment.