Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/evmc6 #57

Merged
merged 182 commits into from
Jul 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
5af0927
vendor: Add EVMC 6.0.2
chfast Sep 11, 2018
b517d31
core/vm: Add EVMC support
chfast Sep 11, 2018
e862a67
Upgrade EVMC to 6.1.1
chfast Feb 13, 2019
6d7511f
evmc: Add support for Petersburg revision
chfast Feb 14, 2019
3f4678b
evm: Reserve space for both EVM and EWASM interpreters
chfast Feb 27, 2019
9976611
evm: Create EVMC or default EVM (no failover)
chfast Feb 27, 2019
cff2b3f
evmc: Refactor code
chfast Feb 27, 2019
5091fd4
evmc: Replace if-else with switch
chfast Apr 3, 2019
a8b6f87
vendor: Upgrade EVMC to 6.2.0 unstable
chfast Apr 3, 2019
46352a4
evmc: Adjust after EVMC upgrade
chfast Apr 3, 2019
567d3aa
evmc: Seperate instances for Ewasm and EVM
chfast May 22, 2019
37eb880
evmc: Separate EVMC module initalization code, use sync.Once
chfast May 22, 2019
4bea7d1
evmc: Add InitEVMC() for EVMC initialization at startup
chfast May 22, 2019
afc097f
evmc: Simplify EVMC initialization
chfast May 22, 2019
da04eb3
vendor: Upgrade EVMC to 6.3.0
chfast Aug 7, 2019
e09ecc6
evmc: Rename SuicideRefundGas -> SelfdestructRefundGas
chfast Aug 14, 2019
1ca8b76
evmc: Add Istanbul support
chfast Nov 8, 2019
3dfb3bf
evmc: Update for v7 EVMC API
chfast Nov 8, 2019
b36c49e
tests: Fix EVMC initialization in tests
chfast Nov 8, 2019
769e062
evmc: Add Istanbul support
chfast Nov 8, 2019
4bdec40
Merge remote-tracking branch 'ewasm/evmc-v6' into feat/evmc6
meowsbits Mar 5, 2020
8825915
Init merge ewasm evmc6 support
meowsbits Mar 5, 2020
7b359ff
core/vm: implement EIP2200 in our style
meowsbits Mar 5, 2020
62a2904
implement EIP158/161 in our style
meowsbits Mar 5, 2020
414ca2c
core/vm: fix params/var import path
meowsbits Mar 5, 2020
7c11f44
core/vm: fix ChainID
meowsbits Mar 5, 2020
0f05562
core/vm: fix IsHomestead/GetEthashEIP2Transition
meowsbits Mar 5, 2020
1641f68
core/vm: adjust Fork/Fork-feature logic for evmc.Revision
meowsbits Mar 5, 2020
64553bc
tests: remove unused import
meowsbits Mar 5, 2020
6a81e07
core/vm,tests: pass: 'go test ./tests/...'
meowsbits Mar 5, 2020
083d08a
run go mod tidy
meowsbits Mar 5, 2020
5aa2c5f
evmc: update to latest
meowsbits Mar 5, 2020
dc9afe5
accounts: NOTES about trying to abi missing header file error
meowsbits Mar 5, 2020
8f9e15f
evmc: update submodule
meowsbits Mar 5, 2020
497478f
run go mod tidy
meowsbits Mar 5, 2020
b339d93
evmc: update submodule
meowsbits Mar 5, 2020
d634a02
accounts/scwallet: fix 'not enough arguments' error
meowsbits Mar 5, 2020
74ec823
run make all
meowsbits Mar 5, 2020
451fe76
go.mod: run go mod tidy, update tag for evmc
meowsbits Mar 5, 2020
4db63db
go.mod: use v0.0.0 for github.com/ethereum/evmc
meowsbits Mar 5, 2020
a6dd735
go.mod: use github.com/ethereum/evmc@v6.3.1
meowsbits Mar 5, 2020
da79e76
accounts/abi/bind: remove dead comments
meowsbits Mar 5, 2020
4af8093
tests: rename flags to use full evmc parent name
meowsbits Mar 5, 2020
4e976bd
evmc: v7.1.0
meowsbits Mar 5, 2020
a162c17
go.mod: use evmc as a submodule, not an external dependency
meowsbits Mar 5, 2020
b386024
evmc: v6.3.1
meowsbits Mar 5, 2020
136deb4
Revert "evmc: v6.3.1"
meowsbits Mar 5, 2020
814e8a4
evmc: v6.3.1
meowsbits Mar 5, 2020
7eec2d4
core/vm: evmc API to v6.3.1 compatible
meowsbits Mar 5, 2020
e5ba87b
core/vm: v6: remote emvc.TxContext#ChainID
meowsbits Mar 5, 2020
cf9bc06
evmc: update
meowsbits Mar 5, 2020
d073ca8
Makefile: add generate command (for evmc)
meowsbits Mar 5, 2020
6253d24
tests: add log line printing evmc flag value
meowsbits Mar 5, 2020
37be839
.golangci.yml,core/vm/tests: (lint) fix issues, ignore evmc linting
meowsbits Mar 5, 2020
a26876b
evmc: v6.3.1
meowsbits Mar 5, 2020
059e79c
Makefile: remove dupe test run
meowsbits Mar 6, 2020
2413dd9
Makefile: rename command generate -> evmc
meowsbits Mar 6, 2020
7e7f8d1
.travis.yml: add 'make evmc' step to test step
meowsbits Mar 6, 2020
d242718
tests: tests/testdata at 'multigeth/ewasm' version
meowsbits Mar 8, 2020
7a3ca4f
tests: rename getVMConfig to getForkChainConfig, more accurate
meowsbits Mar 8, 2020
fdde1a0
core/vm: use better indicative EIPs as references for evmc.Revision s…
meowsbits Mar 8, 2020
139dbb5
tests: PASS hera: allow EVMC to return internalError
meowsbits Mar 8, 2020
8bfeb96
tests: skip EWASM test callSenderBalanceExceeds128Bits
meowsbits Mar 9, 2020
c93eb46
tests: hera skip stEWASMTests/ecAddCallDataCopy
meowsbits Mar 10, 2020
a4bd333
core/vm: use contract Value fn instead of field
meowsbits Mar 10, 2020
88f5c66
cmd/evm: add --evmc.ewasm flag to 'evm statetest' command
meowsbits Mar 10, 2020
e56cad0
cmd/evm: statetest command supports walk dir or single file
meowsbits Mar 10, 2020
3abcf39
cmd/evm: statetest result should default to fail
meowsbits Mar 10, 2020
fc424d7
tests: comment Hera skipLoad tests, they don't seem broken anymore
meowsbits Mar 10, 2020
9dd4dab
Makefile: use evmc command as PHONY to force example_vm.so file for t…
meowsbits Mar 10, 2020
3cd62be
cmd/evm: (lint) goimports
meowsbits Mar 10, 2020
05c12eb
tests: fix stEWASM skipLoad typo
meowsbits Mar 11, 2020
1c7c421
tests: comment ssvm skipLoad values because unknown
meowsbits Mar 11, 2020
1c98f3e
Makefile,build: setup emvc.hera state test
meowsbits Mar 11, 2020
26d5b5d
build: hera script 'set -e' and fix mkdir
meowsbits Mar 11, 2020
febe386
build,Makefile: ssvm.sh and make ssvm command
meowsbits Mar 11, 2020
3291fd0
.travis.yml: apt-get dependencies for SSVM build
meowsbits Mar 11, 2020
82580d7
Makefile: include apt-get installs before evmc generation?
meowsbits Mar 11, 2020
72524aa
Makefile: test multigeth stuff first
meowsbits Mar 11, 2020
493d5f9
Makefile: remove 'make evmc' step from tests
meowsbits Mar 11, 2020
b3265ad
tests: add Difficulty test config for EIP2384
meowsbits Mar 11, 2020
94ad236
Makefile: run test-evmc first on test-multigeth
meowsbits Mar 11, 2020
2e45ef9
.travis.yml,Makefile: move test-evmc to own travis matrix
meowsbits Mar 11, 2020
da1654e
Merge branch 'master' into feat/evmc6
meowsbits Mar 13, 2020
ac941c7
build,tests: update SSVM dependency to latest
meowsbits Mar 16, 2020
ee95d1a
Merge branch 'master' into feat/evmc6
meowsbits Apr 15, 2020
8354c39
build/ssvm.sh: bump SSVM to 0.5.0
meowsbits Apr 15, 2020
0b4c0dd
tests: make EWASM tests in parallel, remove dead comments
meowsbits Apr 15, 2020
7a8bb8a
appveyor.yml: evmc symlink issue workaround
tzdybal Apr 16, 2020
5a1fca1
.travis.yml: new gcc/g++ version
tzdybal Apr 16, 2020
7e84fb1
.travis.yml: actually use g++-9
tzdybal Apr 16, 2020
cd7afd6
.travis.yml: g++-9 for lint step
tzdybal Apr 16, 2020
298c8e1
.travis.yml: manually get evmc submodule
tzdybal Apr 16, 2020
a9f19c7
.travis.ci: add missing step
tzdybal May 4, 2020
a25c0cc
.travis.ci: install gcc-9 arm packages
tzdybal May 4, 2020
205c8b3
.travis.ci: another try with
tzdybal May 4, 2020
f43a997
.travis.yml: remove trailing slash in language decl
meowsbits May 4, 2020
fa741d4
vm: remove dead code re: EIP2200
meowsbits May 4, 2020
5525060
tests: run all StateTests when --evmc.ewasm configured
meowsbits May 4, 2020
b3b0df5
tests: remove dead code from debugging
meowsbits May 4, 2020
f5b5653
.travis.yml: remove trailing slash in go generate step
meowsbits May 4, 2020
41984da
.travis.yml: some random things to see if they fix SO generate issue
meowsbits May 4, 2020
8623ef2
.travis.yml: unexperiemts, remove the 'go generate' evmc step alltoge…
meowsbits May 4, 2020
00ec5c8
Makefile: turn off -v in evmc makefile test cmd
meowsbits May 4, 2020
2121b15
.travis.yml: use defaulty cc, gcc instead of versioned
meowsbits May 4, 2020
9602dee
.travis.yml: maybe fix echo fail b/c command formatting
meowsbits May 4, 2020
5822a9d
.travis.yml: reorder apt-get to happen first
meowsbits May 4, 2020
0eb459f
.travis.yml: remove echos b/c they fails, idk why
meowsbits May 4, 2020
dfb03ab
.travis.yml: use cc=gcc cxx=g++
meowsbits May 4, 2020
37fdf77
.travis.yml: remove -9 version apt-get gccs; they fail
meowsbits May 4, 2020
b48dc7a
.travis.yml: update cc, cxx envs for arm job
meowsbits May 4, 2020
c2a4f75
.travis.yml: use gcc to compile shared object instead of go generate
meowsbits May 4, 2020
f8ca1d8
use explicit gcc9 for test-evmc step
meowsbits May 4, 2020
35efdba
.travis.yml: remove g++ apt-get target, unnecessary b/c addon
meowsbits May 4, 2020
43ac519
remove special g++9?
meowsbits May 4, 2020
a87adc0
download hera instead of building
meowsbits May 4, 2020
c67892a
.github/workflows/evmc.yml,.travis.yml,build/hera.sh: use Github Acti…
meowsbits May 5, 2020
255fa5e
.travis.yml: set cc,cxx env explicity for arm build
meowsbits May 5, 2020
f6530f7
.travis.yml: remove gcc settings from lint job
meowsbits May 5, 2020
2c59367
.travis.yml: p: ARM unrecognized option -marm, s: comment gcc9
meowsbits May 5, 2020
6954382
.travis.yml: try go get ./... to fix linting
meowsbits May 5, 2020
1e1fa8d
.travis.yml: make sure we can install before linting
meowsbits May 5, 2020
275d1b9
.github/workflows/evmc.yml: rename github action evmc job for clarity
meowsbits May 5, 2020
debc83d
.github/workflows/evmc.yml,.travis.yml: git submodule evmc for linter
meowsbits May 5, 2020
ef70895
.travis.yml: remove dead comments
meowsbits May 5, 2020
deadf44
build/ssvm.sh: comment SSVM download vs. install script
meowsbits May 5, 2020
470e324
vm: comment vmConfig EWASM switch
meowsbits May 5, 2020
b5fc873
docs/core/evmc.md: init EVMC documentation
meowsbits May 5, 2020
c24ee92
vm,docs/core/evmc.md: extend evmc documentation
meowsbits May 5, 2020
73ec673
tests: remove dead comment
meowsbits May 5, 2020
5ef5527
Merge branch 'master' into feat/evmc6
meowsbits Jul 7, 2020
f08a3be
main,vm: fix remainder merge conflicts
meowsbits Jul 7, 2020
1928e4e
go.sum: go.sum autoupdated
meowsbits Jul 7, 2020
5ed8083
go.sum: updates go.sum
meowsbits Jul 7, 2020
f050ffe
Merge branch 'feat/travis-arm64' into feat/evmc6
meowsbits Jul 7, 2020
920f48c
Makefile,go.sum: moar go.sum
meowsbits Jul 7, 2020
443e81b
main: (lint) fmt, remove unused
meowsbits Jul 7, 2020
2e75660
build/ssvm.sh: remove --no-check-certificate for wget
meowsbits Jul 7, 2020
16c518d
build/hera.sh,build/ssvm.sh: peg hera to 0.2.5
meowsbits Jul 7, 2020
542f230
.travis.yml,Makefile: refactor .so compile steps to makefile, use mak…
meowsbits Jul 8, 2020
bd26c40
Makefile: remove make command using Makefile in evmc/...
meowsbits Jul 8, 2020
6fef068
.travis.yml: remote go build evmc step, include make test-evmc
meowsbits Jul 8, 2020
26b3fc9
.travis.yml: wait wait, github actions runs make test-evmc
meowsbits Jul 8, 2020
f7ee0d7
Makefile: remove hera and evmc from PHONY
meowsbits Jul 8, 2020
c12c8de
Makefile: add evmc command as dep for make geth,all
meowsbits Jul 8, 2020
a3aa429
.github/workflows/evmc.yml: update github actions to use make command
meowsbits Jul 8, 2020
afc3062
Makefile: add 'all' as dep for lint
meowsbits Jul 8, 2020
10f4f58
.travis.yml: fix lint stage submodules
meowsbits Jul 8, 2020
f5cb460
Makefile: remove 'all' command as dep from 'lint'
meowsbits Jul 8, 2020
7dbe023
.travis.yml: add comments
meowsbits Jul 8, 2020
00b8970
Makefile: add make steps for example_vm.so generation
meowsbits Jul 8, 2020
3750374
Makefile: all doesnt need evmc
meowsbits Jul 8, 2020
1ad653a
Revert "Makefile: all doesnt need evmc"
meowsbits Jul 8, 2020
b2baee2
Makefile: echo must respect escape chars
meowsbits Jul 8, 2020
52c82cd
Makefile: gcc compilation of example_vm.so is from evmc_test.go
meowsbits Jul 8, 2020
da7eb6c
.travis.yml: travis dont peg to g++9, just use whatever we get
meowsbits Jul 8, 2020
ec9b933
Makefile,build/evmc-example_vm.so.sh: add script to conditionalize tr…
meowsbits Jul 8, 2020
6f38ba1
build/evmc-example_vm.so.sh: add debug flag and comments
meowsbits Jul 8, 2020
bf9a498
go.sum: go mod tidy
meowsbits Jul 8, 2020
c4711ff
README.md: update readme with submodule clone instructions
meowsbits Jul 8, 2020
b3e35c9
tests/testdata: update submodule to be equal to master
meowsbits Jul 8, 2020
8b2e1dc
.gitmodules,evmc: remove evmc as submodule
meowsbits Jul 9, 2020
6bd2cc2
evmc: git clone --branch v6.3.1 --depth 1 https://github.com/ethereum…
meowsbits Jul 9, 2020
6a2070a
evmc: skip tests if generated artifact example_vm.so is not present
meowsbits Jul 9, 2020
09efacd
evmc/README_COREGETH.md: documentation for included source and its re…
meowsbits Jul 9, 2020
b21e9fc
.travis.yml: remove Travis EVMC submodule actions
meowsbits Jul 9, 2020
aba05aa
build/evmc-example_vm.so.sh: shebang: use 'sh' instead of 'bash'
meowsbits Jul 9, 2020
4eb48c5
Makefile: remove 'evmc' command from 'test' command
meowsbits Jul 9, 2020
1b22aa8
Makefile: make clean-evmc should also remove example_vm.so
meowsbits Jul 9, 2020
ecd9db9
README.md: remove unnecessary submodules flag from clone cmd
meowsbits Jul 21, 2020
f42633e
docs/core/evmc.md: minor syntax tweaks to emvc6 doc
meowsbits Jul 21, 2020
d4c348a
tests: remove whitespace-only changes
meowsbits Jul 21, 2020
f32e090
Makefile: reinstate all as predicate for test cmd
meowsbits Jul 21, 2020
9359d66
.travis.yml: init move evmc-test to travis
meowsbits Jul 21, 2020
63052ae
.travis.yml: add job names for readability
meowsbits Jul 21, 2020
a0b5fd0
.travis.yml: better names for travis jobs
meowsbits Jul 21, 2020
0c7a433
build/evmc-example_vm.so.sh: fix example_vm.so script to be POSIX com…
meowsbits Jul 21, 2020
9f50dc3
.travis.yml,docs/core/evmc.md: abort trying to get evmc tests to pass…
meowsbits Jul 21, 2020
6c74ead
Makefile,build/evmone.sh,tests: install EVMOne 0.2.0 --evmc.evm .so S…
meowsbits Jul 21, 2020
fb496f8
main,tests: revise skipForks to be a method params for StateTest type
meowsbits Jul 21, 2020
764fd54
tests: (lint) goimports -w
meowsbits Jul 21, 2020
6d9e363
tests: remove unnecessary IstanbulBlock removal from difficulty test …
meowsbits Jul 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/evmc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: EVMC

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:
name: EWASM State Tests
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: |
go get -v -t -d ./...
git submodule update --init --recursive
go get golang.org/x/mobile/cmd/gomobile
gomobile init

- name: Build
run: |
make all

- name: Test EVMC
run: |
make test-evmc
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ run:
skip-files:
- core/genesis_alloc.go
- params/alloc.go
- evmc/*

linters:
disable-all: true
Expand Down
32 changes: 21 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo: false
jobs:
include:

# Only test code linters on latest version of Go
# Run linter check. Only test code linters on latest version of Go.
- stage: lint
os: linux
dist: xenial
Expand All @@ -14,28 +14,32 @@ jobs:
git:
submodules: false
script:
- go run build/ci.go lint
- make lint

# Run core-geth -specific tests, proving regression-safety and config interoperability.
- stage: build
name: "Go1.14.x: make test-coregeth"
os: linux
dist: xenial
go: 1.14.x
env:
- COREGETH
script:
- make test-coregeth

# Run build and tests against latest-1 Go version.
- stage: build
name: "Go1.13.x: make test"
os: linux
dist: xenial
go: 1.13.x
env:
- GO111MODULE=on
script:
- go run build/ci.go install
- travis_wait 60 go run build/ci.go test
- make all
- travis_wait 60 make test

# Run build and tests on ARM64 on Pull Requests.
- stage: build
name: "ARM64/Go1.14.x: make test"
if: type = pull_request
os: linux
arch: arm64
Expand All @@ -44,16 +48,18 @@ jobs:
env:
- GO111MODULE=on
script:
- go run build/ci.go install
- travis_wait 60 go run build/ci.go test
- make all
- travis_wait 60 make test

# Run build and tests with environment-aware possible artifact deployment.
- stage: build
name: "Go1.14.x: make test && deploy"
os: linux
dist: xenial
go: 1.14.x
script:
- go run build/ci.go install
- travis_wait 60 go run build/ci.go test
- make all
- travis_wait 60 make test
before_deploy:
- sh build/deploy.sh
deploy:
Expand All @@ -69,7 +75,9 @@ jobs:
skip_cleanup: true
tag_name: "$TRAVIS_TAG"

# Run build on ARM5 with environment-aware possible artifact deployment.
- stage: build
name: "ARM5/Go1.14.x: go run build/ci.go install && deploy"
os: linux
dist: xenial
sudo: required
Expand Down Expand Up @@ -102,7 +110,9 @@ jobs:
skip_cleanup: true
tag_name: "$TRAVIS_TAG"

#Run build on OSX with environment-aware possible artifact deployment.
- stage: build
name: "OSX/Go1.14.x: make all && deploy"
os: osx
go: 1.14.x
script:
Expand All @@ -115,7 +125,7 @@ jobs:
- ulimit -S -n $NOFILE
- ulimit -n
- unset -f cd
- go run build/ci.go install
- make all
before_deploy:
- sh build/deploy.sh
deploy:
Expand Down
28 changes: 26 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# with Go source code. If you know what GOPATH is then you probably
# don't need to bother with make.

.PHONY: geth android ios geth-cross evm all test clean
.PHONY: all test clean
.PHONY: evmc
.PHONY: geth android ios geth-cross
.PHONY: geth-linux geth-linux-386 geth-linux-amd64 geth-linux-mips64 geth-linux-mips64le
.PHONY: geth-linux-arm geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-arm64
.PHONY: geth-darwin geth-darwin-386 geth-darwin-amd64
Expand All @@ -11,6 +13,7 @@
GOBIN = ./build/bin
GO ?= latest
GORUN = env GO111MODULE=on go run
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))

geth:
$(GORUN) build/ci.go install ./cmd/geth
Expand Down Expand Up @@ -42,6 +45,27 @@ test-coregeth: \
test-coregeth-chainspecs \
test-coregeth-consensus ## Runs all tests specific to core-geth.

evmc/bindings/go/evmc/example_vm.so:
./build/evmc-example_vm.so.sh

hera:
./build/hera.sh

ssvm:
./build/ssvm.sh

evmone:
./build/evmone.sh

test-evmc: evmc/bindings/go/evmc/example_vm.so hera ssvm evmone
go test -count 1 ./evmc/...
go test -count 1 ./tests -run TestState -evmc.ewasm=$(ROOT_DIR)/build/_workspace/hera/build/src/libhera.so
go test -count 1 ./tests -run TestState -evmc.ewasm=$(ROOT_DIR)/build/_workspace/SSVM/build/tools/ssvm-evmc/libssvmEVMC.so
go test -count 1 ./tests -run TestState -evmc.evm=$(ROOT_DIR)/build/_workspace/evmone/lib/libevmone.so

clean-evmc:
rm -rf evmc/bindings/go/evmc/example_vm.so ./build/_workspace/hera ./build/_workspace/SSVM ./build/_workspace/evmone

test-coregeth-features: test-coregeth-features-parity test-coregeth-features-coregeth test-coregeth-features-multigethv0 ## Runs tests specific to multi-geth using Fork/Feature configs.

test-coregeth-consensus: test-coregeth-features-clique-consensus
Expand Down Expand Up @@ -89,7 +113,7 @@ tests-generate-difficulty: ## Generate difficulty tests.
lint: ## Run linters.
$(GORUN) build/ci.go lint

clean:
clean: clean-evmc
env GO111MODULE=on go clean -cache
rm -fr build/_workspace/pkg/ $(GOBIN)/*

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ $ sudo apt-get install -y build-essential

#### Source

Once the dependencies are installed, it's time to clone and build the source:
Once the dependencies have been installed, it's time to clone and build the source:

```shell
$ git clone https://github.com/etclabscore/core-geth.git
Expand Down
4 changes: 4 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ install:

build_script:
- ps: $env:VERSION = "$(git describe --always)"
- copy /Y evmc\include\evmc\evmc.h evmc\bindings\go\evmc\evmc.h
- copy /Y evmc\include\evmc\helpers.h evmc\bindings\go\evmc\helpers.h
- copy /Y evmc\include\evmc\loader.h evmc\bindings\go\evmc\loader.h
- copy /Y evmc\lib\loader\loader.c evmc\bindings\go\evmc\loader.c
- go run build\ci.go install
- 7z a core-geth-win64-%VERSION%.zip .\build\bin\geth.exe
- ps: Get-FileHash core-geth-win64-$env:VERSION.zip -Algorithm SHA256
Expand Down
20 changes: 20 additions & 0 deletions build/evmc-example_vm.so.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

# Travis errors when trying to use the "normal" 'go generate' way of making this file.
# I don't know why.

set -x

if [ "$CI" = "true" ] && [ "$TRAVIS" = "true" ]; then
echo "In Travis CI. Building SO with an adhoc Makefile."
# Use a temporary adhoc Makefile located in a child-dir of the evmc submodule to build the required example_vm.so file.
# Once finished, remove the adhoc Makefile.
# The important part of this command (vs. the 'go generate' command)
# is the -fPIC flags.
> ./evmc/bindings/go/evmc/Makefile \
echo -e 'example_vm.so:\n\tgcc -fPIC -shared ../../../examples/example_vm/example_vm.c -I../../../include -o example_vm.so'
make -C ./evmc/bindings/go/evmc/ example_vm.so
rm -f ./evmc/bindings/go/evmc/Makefile
else
go generate ./evmc/bindings/go/evmc/
fi
7 changes: 7 additions & 0 deletions build/evmone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -e

mkdir -p build/_workspace/evmone/build/tools/ssvm-evmc/
wget -O build/_workspace/evmone/evmone-0.2.0-linux-x86_64.tar.gz https://github.com/ethereum/evmone/releases/download/v0.2.0/evmone-0.2.0-linux-x86_64.tar.gz
tar xzvf build/_workspace/evmone/evmone-0.2.0-linux-x86_64.tar.gz -C build/_workspace/evmone/
17 changes: 17 additions & 0 deletions build/hera.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -e

main() {
mkdir -p build/_workspace
[ ! -d build/_workspace/hera ] && git clone https://github.com/ewasm/hera build/_workspace/hera || echo "Hera exists."
cd build/_workspace/hera
git checkout v0.2.5 # Last EVMCv6-compatible tag (v0.3.0 bumps to v7).
git submodule update --init
mkdir -p build
cd build
cmake -DBUILD_SHARED_LIBS=ON ..
cmake --build .
echo "Built library at: $(pwd)/src/libhera.so"
}
main
26 changes: 26 additions & 0 deletions build/ssvm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

set -e

mkdir -p build/_workspace/SSVM/build/tools/ssvm-evmc/
wget -O build/_workspace/SSVM/build/tools/ssvm-evmc/libssvmEVMC.so https://github.com/second-state/SSVM/releases/download/0.5.0/libssvmEVMC-linux-x86_64.so

# The follow are steps that might be used to build the SSVM SO from source.
# This library is only used for testing.
# Previous versions of this source worked by this pattern, but
# fail for me with 0.5.0.
# So I opted to use the above download pattern, which is simpler.
#main() {
# mkdir -p build/_workspace
# [ ! -d build/_workspace/SSVM ] && git clone https://github.com/second-state/SSVM build/_workspace/SSVM || echo "SSVM exists."
# cd build/_workspace/SSVM
# git fetch --tags
# # git checkout 0.5.0
# git checkout 0.6.1
# mkdir -p build
# cd build
# cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON ..
# make
# echo "Built library at: $(pwd)/tools/ssvm-evmc/libssvmEVMC.so"
#}
#main
4 changes: 4 additions & 0 deletions cmd/evm/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ func runCmd(ctx *cli.Context) error {
},
}

if runtimeConfig.EVMConfig.EVMInterpreter != "" {
vm.InitEVMCEVM(runtimeConfig.EVMConfig.EVMInterpreter)
}

if cpuProfilePath := ctx.GlobalString(CPUProfileFlag.Name); cpuProfilePath != "" {
f, err := os.Create(cpuProfilePath)
if err != nil {
Expand Down
18 changes: 15 additions & 3 deletions cmd/evm/staterunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ var stateTestCommand = cli.Command{
Name: "statetest",
Usage: "executes the given state tests",
ArgsUsage: "<file>",
Flags: []cli.Flag{stateTestEVMCEWASMFlag},
}

var stateTestEVMCEWASMFlag = cli.StringFlag{
Name: "evmc.ewasm",
Usage: "EVMC EWASM configuration",
}

// StatetestResult contains the execution status after running a state test, any
Expand All @@ -57,6 +63,11 @@ func stateTestCmd(ctx *cli.Context) error {
glogger.Verbosity(log.Lvl(ctx.GlobalInt(VerbosityFlag.Name)))
log.Root().SetHandler(glogger)

if s := ctx.String(stateTestEVMCEWASMFlag.Name); s != "" {
log.Info("Running tests with %s=%s", "evmc.ewasm", s)
vm.InitEVMCEwasm(s)
}

// Configure the EVM logger
config := &vm.LogConfig{
DisableMemory: ctx.GlobalBool(DisableMemoryFlag.Name),
Expand Down Expand Up @@ -88,12 +99,13 @@ func stateTestCmd(ctx *cli.Context) error {
}
// Iterate over all the tests, run them and aggregate the results
cfg := vm.Config{
Tracer: tracer,
Debug: ctx.GlobalBool(DebugFlag.Name) || ctx.GlobalBool(MachineFlag.Name),
Tracer: tracer,
Debug: ctx.GlobalBool(DebugFlag.Name) || ctx.GlobalBool(MachineFlag.Name),
EWASMInterpreter: ctx.String(stateTestEVMCEWASMFlag.Name),
}
results := make([]StatetestResult, 0, len(tests))
for key, test := range tests {
for _, st := range test.Subtests() {
for _, st := range test.Subtests(nil) {
// Run the test and aggregate the result
result := &StatetestResult{Name: key, Fork: st.Fork, Pass: true}
_, state, err := test.Run(st, cfg, false)
Expand Down
2 changes: 2 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1647,10 +1647,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {

if ctx.GlobalIsSet(EWASMInterpreterFlag.Name) {
cfg.EWASMInterpreter = ctx.GlobalString(EWASMInterpreterFlag.Name)
vm.InitEVMCEwasm(cfg.EWASMInterpreter)
}

if ctx.GlobalIsSet(EVMInterpreterFlag.Name) {
cfg.EVMInterpreter = ctx.GlobalString(EVMInterpreterFlag.Name)
vm.InitEVMCEVM(cfg.EVMInterpreter)
}
if ctx.GlobalIsSet(RPCGlobalGasCap.Name) {
cfg.RPCGasCap = ctx.GlobalUint64(RPCGlobalGasCap.Name)
Expand Down