From 6dac0fa63c9d25b6a295c91758abc778b8a00d49 Mon Sep 17 00:00:00 2001 From: Sam Batschelet Date: Mon, 5 Sep 2022 03:01:44 -0400 Subject: [PATCH] bump: AvalancheGo@v1.8.0 (#249) * AvalancheGo@v1.8.0 Signed-off-by: Sam Batschelet * *: react to bump Signed-off-by: Sam Batschelet * bump: avalanche-network-runner@v1.2.1 Signed-off-by: Sam Batschelet * Remove network runner dep * remove needs from goreleaser * Update subnet evm version to v0.3.0 Signed-off-by: Sam Batschelet Co-authored-by: Aaron Buchwald --- .github/workflows/lint-tests-release.yml | 76 ++--- cmd/simulator/go.mod | 2 +- go.mod | 41 +-- go.sum | 100 +----- plugin/evm/block_builder.go | 5 +- plugin/evm/staged_timer.go | 20 ++ plugin/evm/staged_timer_test.go | 47 +++ plugin/evm/timer.go | 108 +++++++ plugin/evm/timer_test.go | 21 ++ scripts/parser/go.mod | 14 - scripts/parser/go.sum | 15 - scripts/parser/main.go | 118 -------- scripts/versions.sh | 6 +- tests/curl.go | 181 ----------- tests/curl_test.go | 45 --- tests/e2e/e2e_test.go | 285 ------------------ tests/e2e/genesis/contract_native_minter.json | 50 --- tests/e2e/genesis/deployer_allow_list.json | 50 --- tests/e2e/genesis/fee_manager.json | 50 --- tests/e2e/genesis/tx_allow_list.json | 47 --- tests/e2e/ping/suites.go | 28 -- tests/e2e/runner/runner.go | 218 -------------- tests/e2e/solidity/suites.go | 100 ------ tests/e2e/utils/describe.go | 18 -- tests/e2e/utils/params.go | 98 ------ tests/e2e/utils/parser.go | 75 ----- 26 files changed, 254 insertions(+), 1564 deletions(-) create mode 100644 plugin/evm/staged_timer.go create mode 100644 plugin/evm/staged_timer_test.go create mode 100644 plugin/evm/timer.go create mode 100644 plugin/evm/timer_test.go delete mode 100644 scripts/parser/go.mod delete mode 100644 scripts/parser/go.sum delete mode 100644 scripts/parser/main.go delete mode 100644 tests/curl.go delete mode 100644 tests/curl_test.go delete mode 100644 tests/e2e/e2e_test.go delete mode 100644 tests/e2e/genesis/contract_native_minter.json delete mode 100644 tests/e2e/genesis/deployer_allow_list.json delete mode 100644 tests/e2e/genesis/fee_manager.json delete mode 100644 tests/e2e/genesis/tx_allow_list.json delete mode 100644 tests/e2e/ping/suites.go delete mode 100644 tests/e2e/runner/runner.go delete mode 100644 tests/e2e/solidity/suites.go delete mode 100644 tests/e2e/utils/describe.go delete mode 100644 tests/e2e/utils/params.go delete mode 100644 tests/e2e/utils/parser.go diff --git a/.github/workflows/lint-tests-release.yml b/.github/workflows/lint-tests-release.yml index b4678527ce..82ed111cb7 100644 --- a/.github/workflows/lint-tests-release.yml +++ b/.github/workflows/lint-tests-release.yml @@ -44,47 +44,47 @@ jobs: - run: ./scripts/coverage.sh shell: bash - e2e_test: - name: e2e tests - runs-on: ubuntu-latest - steps: - - name: Git checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: 1.18 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: "14.x" - - name: Yarn install - run: yarn - working-directory: ./contract-examples - - name: Run e2e tests - shell: bash - run: SKIP_NETWORK_RUNNER_START=true SKIP_NETWORK_RUNNER_SHUTDOWN=true ENABLE_SOLIDITY_TESTS=true scripts/run.sh + # e2e_test: + # name: e2e tests + # runs-on: ubuntu-latest + # steps: + # - name: Git checkout + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + # - name: Set up Go + # uses: actions/setup-go@v3 + # with: + # go-version: 1.18 + # - name: Use Node.js + # uses: actions/setup-node@v3 + # with: + # node-version: "14.x" + # - name: Yarn install + # run: yarn + # working-directory: ./contract-examples + # - name: Run e2e tests + # shell: bash + # run: SKIP_NETWORK_RUNNER_START=true SKIP_NETWORK_RUNNER_SHUTDOWN=true ENABLE_SOLIDITY_TESTS=true scripts/run.sh - simulator_test: - name: Load testing with simulator - runs-on: ubuntu-latest - steps: - - name: Git checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: 1.18 - - name: Run simulator tests - shell: bash - run: SKIP_NETWORK_RUNNER_SHUTDOWN=true RUN_SIMULATOR=true scripts/run.sh + # simulator_test: + # name: Load testing with simulator + # runs-on: ubuntu-latest + # steps: + # - name: Git checkout + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + # - name: Set up Go + # uses: actions/setup-go@v3 + # with: + # go-version: 1.18 + # - name: Run simulator tests + # shell: bash + # run: SKIP_NETWORK_RUNNER_SHUTDOWN=true RUN_SIMULATOR=true scripts/run.sh release: - needs: [lint_test, simulator_test] # TODO: re-add after flaky tests are fixed (unit_test, e2e_test) + # needs: [lint_test, simulator_test] # TODO: re-add after flaky tests are fixed (unit_test, e2e_test) runs-on: ubuntu-latest steps: - name: Git checkout diff --git a/cmd/simulator/go.mod b/cmd/simulator/go.mod index 28c845aa43..a0e529a888 100644 --- a/cmd/simulator/go.mod +++ b/cmd/simulator/go.mod @@ -14,7 +14,7 @@ require ( replace github.com/ava-labs/subnet-evm => ../.. require ( - github.com/ava-labs/avalanchego v1.7.18 // indirect + github.com/ava-labs/avalanchego v1.8.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/deckarep/golang-set v1.8.0 // indirect diff --git a/go.mod b/go.mod index 08c8a0cd1d..4f040e2477 100644 --- a/go.mod +++ b/go.mod @@ -4,14 +4,11 @@ go 1.18 require ( github.com/VictoriaMetrics/fastcache v1.10.0 - github.com/ava-labs/avalanche-network-runner v1.2.1-0.20220819133900-ee59fae043fc - github.com/ava-labs/avalanchego v1.7.18 + github.com/ava-labs/avalanchego v1.8.0 github.com/cespare/cp v0.1.0 - github.com/creack/pty v1.1.18 github.com/davecgh/go-spew v1.1.1 github.com/deckarep/golang-set v1.8.0 - github.com/ethereum/go-ethereum v1.10.21 - github.com/fatih/color v1.13.0 + github.com/ethereum/go-ethereum v1.10.23 github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 github.com/google/uuid v1.2.0 @@ -24,8 +21,6 @@ require ( github.com/mattn/go-colorable v0.1.12 github.com/mattn/go-isatty v0.0.14 github.com/olekukonko/tablewriter v0.0.5 - github.com/onsi/ginkgo/v2 v2.1.4 - github.com/onsi/gomega v1.19.0 github.com/prometheus/client_golang v1.12.2 github.com/prometheus/client_model v0.2.0 github.com/rjeczalik/notify v0.9.2 @@ -44,47 +39,29 @@ require ( golang.org/x/text v0.3.7 golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac gopkg.in/urfave/cli.v1 v1.20.0 - gopkg.in/yaml.v2 v2.4.0 gotest.tools v2.2.0+incompatible - sigs.k8s.io/yaml v1.3.0 ) require ( - github.com/Microsoft/go-winio v0.5.2 // indirect - github.com/NYTimes/gziphandler v1.1.1 // indirect - github.com/aead/siphash v1.0.1 // indirect - github.com/ava-labs/coreth v0.8.16-rc.2 // indirect + github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/btcsuite/btcd v0.23.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect - github.com/btcsuite/btcd/btcutil v1.1.1 // indirect - github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect - github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect - github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect - github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect - github.com/btcsuite/winsvc v1.0.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect - github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200627015759-01fd2de07837 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect - github.com/decred/dcrd/lru v1.1.1 // indirect github.com/deepmap/oapi-codegen v1.8.2 // indirect github.com/edsrzf/mmap-go v1.0.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-stack/stack v1.8.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect github.com/golang-jwt/jwt/v4 v4.3.0 // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.5.8 // indirect - github.com/gorilla/mux v1.8.0 // indirect github.com/graph-gophers/graphql-go v1.3.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3 // indirect github.com/hashicorp/go-hclog v1.2.2 // indirect github.com/hashicorp/go-plugin v1.4.4 // indirect github.com/hashicorp/hcl v1.0.0 // indirect @@ -93,12 +70,8 @@ require ( github.com/influxdata/influxdb v1.8.3 // indirect github.com/influxdata/influxdb-client-go/v2 v2.4.0 // indirect github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 // indirect - github.com/jackpal/gateway v1.0.6 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect - github.com/jessevdk/go-flags v1.5.0 // indirect - github.com/jrick/logrotate v1.0.0 // indirect - github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/kkdai/bstream v1.0.0 // indirect + github.com/jhump/protoreflect v1.11.1-0.20220213155251-0c2aedc66cf4 // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect @@ -109,7 +82,6 @@ require ( github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d // indirect github.com/oklog/run v1.1.0 // indirect github.com/opentracing/opentracing-go v1.1.0 // indirect - github.com/otiai10/copy v1.7.0 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.1 // indirect github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 // indirect @@ -120,10 +92,8 @@ require ( github.com/prometheus/tsdb v0.10.0 // indirect github.com/rs/cors v1.7.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.8.2 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/stretchr/objx v0.2.0 // indirect github.com/subosito/gotenv v1.3.0 // indirect github.com/tklauser/go-sysconf v0.3.5 // indirect github.com/tklauser/numcpus v0.2.2 // indirect @@ -141,5 +111,6 @@ require ( gopkg.in/ini.v1 v1.66.4 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f034f31580..776d966cc2 100644 --- a/go.sum +++ b/go.sum @@ -44,15 +44,9 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/VictoriaMetrics/fastcache v1.10.0 h1:5hDJnLsKLpnUEToub7ETuRu8RCkb40woBZAUiKonXzY= github.com/VictoriaMetrics/fastcache v1.10.0/go.mod h1:tjiYeEfYXCqacuvYw/7UoDIeJaNxq6132xHICNP77w8= -github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg= -github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -64,46 +58,21 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= -github.com/ava-labs/avalanche-network-runner v1.2.1-0.20220819133900-ee59fae043fc h1:7vg3adZguN+VDK94RPMv6pGmPM3GJXPAiPmUnda4yXY= -github.com/ava-labs/avalanche-network-runner v1.2.1-0.20220819133900-ee59fae043fc/go.mod h1:jDDs7viP410ZmuJXlOEZfU4t6I4NHn3QQmZt1SxCOgI= -github.com/ava-labs/avalanchego v1.7.18 h1:x4PrTKIyUZkxhPjjf/a4hQLZDUB8netA6oFMw6Z1M+Q= -github.com/ava-labs/avalanchego v1.7.18/go.mod h1:Jo21X9sMxvkZNoo8B7GJbbelGrIJbwFPcMhwanink68= -github.com/ava-labs/coreth v0.8.16-rc.2 h1:Yo6J5faqK9sdnp7yzTIIEGodZqPctvy9l4SLRTVTWck= -github.com/ava-labs/coreth v0.8.16-rc.2/go.mod h1:iOB8EcOy/9yY1+/MAUqI2UM5GUIuIbX2MVKK1gCHqHs= +github.com/ava-labs/avalanchego v1.8.0 h1:rQrK6YzIMqjaZ9YQbL1TcbUwzFdTeMXGqzynEB+w8bE= +github.com/ava-labs/avalanchego v1.8.0/go.mod h1:KzMGQZ77xkTVxkxl/zGH3aIGjaHnGbuPTycxkcjngIc= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= +github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= github.com/btcsuite/btcd v0.23.1 h1:IB8cVQcC2X5mHbnfirLG5IZnkWYNTPlLZVrxUYSotbE= -github.com/btcsuite/btcd v0.23.1/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= -github.com/btcsuite/btcd/btcec/v2 v2.1.1/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= -github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= -github.com/btcsuite/btcd/btcutil v1.1.1 h1:hDcDaXiP0uEzR8Biqo2weECKqEw0uHDZ9ixIWevVQqY= -github.com/btcsuite/btcd/btcutil v1.1.1/go.mod h1:nbKlBMNm9FGsdvKvu0essceubPiAcI57pYBNnsLAa34= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3SkEwmHoWBmX1DNXhXZqlTpq6s4tyJGc= -github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= -github.com/btcsuite/winsvc v1.0.0 h1:J9B4L7e3oqhXOcm+2IuNApwzQec85lE+QaikUcCs+dk= -github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= @@ -125,27 +94,17 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= -github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/decred/dcrd/chaincfg/chainhash v1.0.2 h1:rt5Vlq/jM3ZawwiacWjPa+smINyLRN07EO0cNBV6DGU= -github.com/decred/dcrd/chaincfg/chainhash v1.0.2/go.mod h1:BpbrGgrPTr3YJYRN3Bm+D9NuaFd+zGyNeIKgrhCXK60= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200627015759-01fd2de07837 h1:g2cyFTu5FKWhCo7L4hVJ797Q506B4EywA7L9I6OebgA= -github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200627015759-01fd2de07837/go.mod h1:J70FGZSbzsjecRTiTzER+3f1KZLNaXkuv+yeFTKoxM8= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/decred/dcrd/lru v1.1.1 h1:kWFDaW0OWx6AD6Ki342c+JPmHbiVdE6rK81pT3fuo/Y= -github.com/decred/dcrd/lru v1.1.1/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= github.com/deepmap/oapi-codegen v1.8.2 h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbzjuhfU= github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= @@ -161,10 +120,11 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/go-ethereum v1.10.21 h1:5lqsEx92ZaZzRyOqBEXux4/UR06m296RGzN3ol3teJY= -github.com/ethereum/go-ethereum v1.10.21/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= +github.com/ethereum/go-ethereum v1.10.23 h1:Xk8XAT4/UuqcjMLIMF+7imjkg32kfVFKoeyQDaO2yWM= +github.com/ethereum/go-ethereum v1.10.23/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= @@ -205,14 +165,11 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg78 github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -249,8 +206,6 @@ github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= -github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -299,8 +254,6 @@ github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLt github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3 h1:BGNSrTRW4rwfhJiFwvwF4XQ0Y72Jj9YEgxVrtovbD5o= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3/go.mod h1:VHn7KgNsRriXa4mcgtkpR00OXyQY6g67JWMvn+R27A4= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-hclog v1.2.2 h1:ihRI7YFwcZdiSD7SIenIhHfQH3OuDvWerAUBZbeQS3M= @@ -340,18 +293,11 @@ github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19y github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/jackpal/gateway v1.0.6 h1:/MJORKvJEwNVldtGVJC2p2cwCnsSoLn3hl3zxmZT7tk= -github.com/jackpal/gateway v1.0.6/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= -github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.11.1-0.20220213155251-0c2aedc66cf4 h1:E2CdxLXYSn6Zrj2+u8DWrwMJW3YZLSWtM/7kIL8OL18= +github.com/jhump/protoreflect v1.11.1-0.20220213155251-0c2aedc66cf4/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuTd3Z9nFXJf5E= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -365,13 +311,8 @@ github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4d github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/kkdai/bstream v1.0.0 h1:Se5gHwgp2VT2uHfDrkbbgbgEvV9cimLELwrPJctSjg8= -github.com/kkdai/bstream v1.0.0/go.mod h1:FDnDOHt5Yx4p3FaHcioFT0QjDOtgUpvjeZqAs+NVZZA= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= @@ -442,17 +383,11 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= -github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= @@ -462,13 +397,6 @@ github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFSt github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE= -github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U= -github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= -github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= -github.com/otiai10/mint v1.3.3 h1:7JgpsBaN0uMkyju4tbYHu0mnM55hNKVYLsXmwr15NQI= -github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= @@ -530,12 +458,9 @@ github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMT github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -553,8 +478,6 @@ github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 h1:Oo2KZNP70K github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -611,7 +534,6 @@ go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95a go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -663,7 +585,6 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -693,7 +614,6 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -768,12 +688,10 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -785,7 +703,6 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -976,6 +893,7 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.50.0-dev h1:cL3RBCQpJ9B+dJmkAVg0OeAogLIuGkH/kWiXKX+RVSI= google.golang.org/grpc v1.50.0-dev/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= @@ -1037,5 +955,3 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/plugin/evm/block_builder.go b/plugin/evm/block_builder.go index 3376da7239..227d7b4211 100644 --- a/plugin/evm/block_builder.go +++ b/plugin/evm/block_builder.go @@ -13,7 +13,6 @@ import ( "github.com/ava-labs/avalanchego/snow" commonEng "github.com/ava-labs/avalanchego/snow/engine/common" - "github.com/ava-labs/avalanchego/utils/timer" "github.com/ethereum/go-ethereum/log" ) @@ -67,7 +66,7 @@ type blockBuilder struct { // [buildBlockTimer] is a two stage timer handling block production. // Stage1 build a block if the batch size has been reached. // Stage2 build a block regardless of the size. - buildBlockTimer *timer.Timer + buildBlockTimer *Timer // buildStatus signals the phase of block building the VM is currently in. // [dontBuild] indicates there's no need to build a block. @@ -99,7 +98,7 @@ func (vm *VM) NewBlockBuilder(notifyBuildBlockChan chan<- commonEng.Message) *bl } func (b *blockBuilder) handleBlockBuilding() { - b.buildBlockTimer = timer.NewStagedTimer(b.buildBlockTwoStageTimer) + b.buildBlockTimer = NewStagedTimer(b.buildBlockTwoStageTimer) go b.ctx.Log.RecoverAndPanic(b.buildBlockTimer.Dispatch) if !b.chainConfig.IsSubnetEVM(big.NewInt(time.Now().Unix())) { diff --git a/plugin/evm/staged_timer.go b/plugin/evm/staged_timer.go new file mode 100644 index 0000000000..b7ba959045 --- /dev/null +++ b/plugin/evm/staged_timer.go @@ -0,0 +1,20 @@ +// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package evm + +import "time" + +// NewStagedTimer returns a timer that will execute [f] +// when a timeout occurs and execute an additional timeout after +// the returned duration if [f] returns true and some duration. +func NewStagedTimer(f func() (time.Duration, bool)) *Timer { + t := NewTimer(nil) + t.handler = func() { + delay, repeat := f() + if repeat { + t.SetTimeoutIn(delay) + } + } + return t +} diff --git a/plugin/evm/staged_timer_test.go b/plugin/evm/staged_timer_test.go new file mode 100644 index 0000000000..edcbea7d3b --- /dev/null +++ b/plugin/evm/staged_timer_test.go @@ -0,0 +1,47 @@ +// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package evm + +import ( + "sync" + "testing" + "time" + + "github.com/stretchr/testify/require" +) + +func TestSingleStagedTimer(t *testing.T) { + wg := sync.WaitGroup{} + wg.Add(1) + ticks := 1 + i := 0 + timer := NewStagedTimer(func() (time.Duration, bool) { + defer wg.Done() + i++ + return 0, false + }) + go timer.Dispatch() + + timer.SetTimeoutIn(time.Millisecond) + wg.Wait() + require.Equal(t, i, ticks) +} + +func TestMultiStageTimer(t *testing.T) { + wg := sync.WaitGroup{} + ticks := 3 + wg.Add(ticks) + + i := 0 + timer := NewStagedTimer(func() (time.Duration, bool) { + defer wg.Done() + i++ + return time.Millisecond, i < ticks + }) + go timer.Dispatch() + + timer.SetTimeoutIn(time.Millisecond) + wg.Wait() + require.Equal(t, i, ticks) +} diff --git a/plugin/evm/timer.go b/plugin/evm/timer.go new file mode 100644 index 0000000000..f5a4aa41d3 --- /dev/null +++ b/plugin/evm/timer.go @@ -0,0 +1,108 @@ +// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package evm + +import ( + "sync" + "time" +) + +// Timer wraps a timer object. This allows a user to specify a handler. Once +// specifying the handler, the dispatch thread can be called. The dispatcher +// will only return after calling Stop. SetTimeoutIn will result in calling the +// handler in the specified amount of time. +type Timer struct { + handler func() + timeout chan struct{} + + lock sync.Mutex + wg sync.WaitGroup + finished, shouldExecute bool + duration time.Duration +} + +// NewTimer creates a new timer object +func NewTimer(handler func()) *Timer { + timer := &Timer{ + handler: handler, + timeout: make(chan struct{}, 1), + } + timer.wg.Add(1) + + return timer +} + +// SetTimeoutIn will set the timer to fire the handler in [duration] +func (t *Timer) SetTimeoutIn(duration time.Duration) { + t.lock.Lock() + defer t.lock.Unlock() + + t.duration = duration + t.shouldExecute = true + t.reset() +} + +// Cancel the currently scheduled event +func (t *Timer) Cancel() { + t.lock.Lock() + defer t.lock.Unlock() + + t.shouldExecute = false + t.reset() +} + +// Stop this timer from executing any more. +func (t *Timer) Stop() { + t.lock.Lock() + if !t.finished { + defer t.wg.Wait() + } + defer t.lock.Unlock() + + t.finished = true + t.reset() +} + +func (t *Timer) Dispatch() { + t.lock.Lock() + defer t.lock.Unlock() + defer t.wg.Done() + + timer := time.NewTimer(0) + cleared := false + reset := false + for !t.finished { // t.finished needs to be thread safe + if !reset && !timer.Stop() && !cleared { + <-timer.C + } + + if cleared && t.shouldExecute { + t.lock.Unlock() + t.handler() + } else { + t.lock.Unlock() + } + + cleared = false + reset = false + select { + case <-t.timeout: + t.lock.Lock() + if t.shouldExecute { + timer.Reset(t.duration) + } + reset = true + case <-timer.C: + t.lock.Lock() + cleared = true + } + } +} + +func (t *Timer) reset() { + select { + case t.timeout <- struct{}{}: + default: + } +} diff --git a/plugin/evm/timer_test.go b/plugin/evm/timer_test.go new file mode 100644 index 0000000000..68e818a4f9 --- /dev/null +++ b/plugin/evm/timer_test.go @@ -0,0 +1,21 @@ +// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package evm + +import ( + "sync" + "testing" + "time" +) + +func TestTimer(t *testing.T) { + wg := sync.WaitGroup{} + wg.Add(1) + defer wg.Wait() + + timer := NewTimer(wg.Done) + go timer.Dispatch() + + timer.SetTimeoutIn(time.Millisecond) +} diff --git a/scripts/parser/go.mod b/scripts/parser/go.mod deleted file mode 100644 index 4899656e1a..0000000000 --- a/scripts/parser/go.mod +++ /dev/null @@ -1,14 +0,0 @@ -module github.com/ava-labs/subnet-evm/scripts/parser - -go 1.18 - -require ( - github.com/fatih/color v1.13.0 - gopkg.in/yaml.v2 v2.4.0 -) - -require ( - github.com/mattn/go-colorable v0.1.9 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect - golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect -) diff --git a/scripts/parser/go.sum b/scripts/parser/go.sum deleted file mode 100644 index e7a5364000..0000000000 --- a/scripts/parser/go.sum +++ /dev/null @@ -1,15 +0,0 @@ -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/scripts/parser/main.go b/scripts/parser/main.go deleted file mode 100644 index 891570835e..0000000000 --- a/scripts/parser/main.go +++ /dev/null @@ -1,118 +0,0 @@ -// (c) 2022 Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package main - -import ( - "io/ioutil" - "os" - "strings" - - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/subnet-evm/tests/e2e/runner" - "github.com/ava-labs/subnet-evm/tests/e2e/utils" - "github.com/fatih/color" - "gopkg.in/yaml.v2" -) - -/* -===Example File=== - -endpoint: /ext/bc/2Z36RnQuk1hvsnFeGWzfZUfXNr7w1SjzmDQ78YxfTVNAkDq3nZ -logsDir: /var/folders/mp/6jm81gc11dv3xtcwxmrd8mcr0000gn/T/runnerlogs2984620995 -pid: 55547 -uris: -- http://localhost:61278 -- http://localhost:61280 -- http://localhost:61282 -- http://localhost:61284 -- http://localhost:61286 -*/ - -type output struct { - Endpoint string `yaml:"endpoint"` - Logs string `yaml:"logsDir"` - URIs []string `yaml:"uris"` -} - -func startSubnet(outputFile string, avalanchegoPath string, pluginDir string, grpc string, genesisPath string) { - // set vmid - b := make([]byte, 32) - vmName := "subnetevm" - copy(b, []byte(vmName)) - var err error - vmId, err := ids.ToID(b) - if err != nil { - panic(err) - } - - utils.SetOutputFile(outputFile) - utils.SetPluginDir(pluginDir) - err = runner.InitializeRunner(avalanchegoPath, grpc, "info") - if err != nil { - panic(err) - } - _, err = runner.StartNetwork(vmId, vmName, genesisPath, pluginDir) - if err != nil { - panic(err) - } - blockchainId, logsDir, err := runner.WaitForCustomVm(vmId) - if err != nil { - panic(err) - } - runner.GetClusterInfo(blockchainId, logsDir) -} - -func parseMetamask(outputFile string, chainId string, address string) { - yamlFile, err := ioutil.ReadFile(outputFile) - if err != nil { - panic(err) - } - var o output - if err := yaml.Unmarshal(yamlFile, &o); err != nil { - panic(err) - } - - color.Green("\n") - color.Green("Logs Directory: %s", o.Logs) - color.Green("\n") - - color.Green("EVM Chain ID: %s", chainId) - color.Green("Funded Address: %s", address) - color.Green("RPC Endpoints:") - for _, uri := range o.URIs { - color.Green("- %s%s/rpc", uri, o.Endpoint) - } - color.Green("\n") - - color.Green("WS Endpoints:") - for _, uri := range o.URIs { - wsURI := strings.ReplaceAll(uri, "http", "ws") - color.Green("- %s%s/ws", wsURI, o.Endpoint) - } - color.Green("\n") - - color.Yellow("MetaMask Quick Start:") - color.Yellow("Funded Address: %s", address) - color.Yellow("Network Name: Local EVM") - color.Yellow("RPC URL: %s%s/rpc", o.URIs[0], o.Endpoint) - color.Yellow("Chain ID: %s", chainId) - color.Yellow("Currency Symbol: LEVM") -} - -func main() { - if len(os.Args) != 8 { - panic("missing args
") - } - - outputFile := os.Args[1] - chainId := os.Args[2] - address := os.Args[3] - avagoPath := os.Args[4] - pluginDir := os.Args[5] - grpc := os.Args[6] - genesis := os.Args[7] - - startSubnet(outputFile, avagoPath, pluginDir, grpc, genesis) - parseMetamask(outputFile, chainId, address) -} diff --git a/scripts/versions.sh b/scripts/versions.sh index 73b167ec62..c898e2921e 100644 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash # Set up the versions to be used -subnet_evm_version=${SUBNET_EVM_VERSION:-'v0.2.9'} +subnet_evm_version=${SUBNET_EVM_VERSION:-'v0.3.0'} # Don't export them as they're used in the context of other calls -avalanche_version=${AVALANCHE_VERSION:-'v1.7.18'} -network_runner_version=${NETWORK_RUNNER_VERSION:-'v1.2.0'} +avalanche_version=${AVALANCHE_VERSION:-'v1.8.0'} +network_runner_version=${NETWORK_RUNNER_VERSION:-'v1.2.1'} ginkgo_version=${GINKGO_VERSION:-'v2.1.4'} diff --git a/tests/curl.go b/tests/curl.go deleted file mode 100644 index e51e074c1e..0000000000 --- a/tests/curl.go +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. -// -// This file is a derived work, based on github.com/etcd-io/etcd/pkg/expect. - -package tests - -import ( - "bufio" - "fmt" - "os" - "os/exec" - "strings" - "sync" - "syscall" - "time" - - "github.com/creack/pty" -) - -// Sends a POST request to the endpoint with JSON body "dataRaw", -// and returns an error if "expect" string is not found in the response. -func CURLPost(endpoint string, dataRaw string, expect string) (string, error) { - cmdArgs := []string{ - "curl", - "-L", endpoint, - "-m", "10", - "-H", "Content-Type: application/json", - "-X", "POST", - "-d", dataRaw, - } - - ex, err := newExpect(cmdArgs[0], cmdArgs[1:]...) - if err != nil { - return "", err - } - defer ex.Close() - - return ex.Expect(expect) -} - -const DEBUG_LINES_TAIL = 40 - -type expectProcess struct { - cmd *exec.Cmd - fpty *os.File - wg sync.WaitGroup - - mu sync.RWMutex // protects lines and err - lines []string - err error - - stopSignal os.Signal -} - -func newExpect(name string, args ...string) (ep *expectProcess, err error) { - cmd := exec.Command(name, args...) - ep = &expectProcess{ - cmd: cmd, - stopSignal: syscall.SIGKILL, - } - ep.cmd.Stderr = ep.cmd.Stdout - ep.cmd.Stdin = nil - - if ep.fpty, err = pty.Start(ep.cmd); err != nil { - return nil, err - } - - ep.wg.Add(1) - go ep.read() - return ep, nil -} - -func (ep *expectProcess) read() { - defer ep.wg.Done() - printDebugLines := os.Getenv("EXPECT_DEBUG") != "" - r := bufio.NewReader(ep.fpty) - for { - l, err := r.ReadString('\n') - ep.mu.Lock() - if l != "" { - if printDebugLines { - fmt.Printf("%s-%d: %s", ep.cmd.Path, ep.cmd.Process.Pid, l) - } - ep.lines = append(ep.lines, l) - } - if err != nil { - ep.err = err - ep.mu.Unlock() - break - } - ep.mu.Unlock() - } -} - -func (ep *expectProcess) ExpectFunc(f func(string) bool) (string, error) { - i := 0 - - for { - ep.mu.Lock() - for i < len(ep.lines) { - line := ep.lines[i] - i++ - if f(line) { - ep.mu.Unlock() - return line, nil - } - } - if ep.err != nil { - ep.mu.Unlock() - break - } - ep.mu.Unlock() - time.Sleep(time.Millisecond * 100) - } - ep.mu.Lock() - lastLinesIndex := len(ep.lines) - DEBUG_LINES_TAIL - if lastLinesIndex < 0 { - lastLinesIndex = 0 - } - lastLines := strings.Join(ep.lines[lastLinesIndex:], "") - ep.mu.Unlock() - return "", fmt.Errorf("match not found."+ - " Set EXPECT_DEBUG for more info Err: %v, last lines:\n%s", - ep.err, lastLines) -} - -// Expect returns the first line containing the given string. -func (ep *expectProcess) Expect(s string) (string, error) { - return ep.ExpectFunc(func(txt string) bool { return strings.Contains(txt, s) }) -} - -// Stop kills the expect process and waits for it to exit. -func (ep *expectProcess) Stop() error { return ep.close(true) } - -// Signal sends a signal to the expect process -func (ep *expectProcess) Signal(sig os.Signal) error { - return ep.cmd.Process.Signal(sig) -} - -func (ep *expectProcess) Close() error { return ep.close(false) } - -func (ep *expectProcess) close(kill bool) error { - if ep.cmd == nil { - return ep.err - } - if kill { - ep.Signal(ep.stopSignal) - } - - err := ep.cmd.Wait() - ep.fpty.Close() - ep.wg.Wait() - - if err != nil { - if !kill && strings.Contains(err.Error(), "exit status") { - // non-zero exit code - err = nil - } else if kill && strings.Contains(err.Error(), "signal:") { - err = nil - } - } - - ep.cmd = nil - return err -} - -func (ep *expectProcess) ProcessError() error { - if strings.Contains(ep.err.Error(), "input/output error") { - // TODO: The expect library should not return - // `/dev/ptmx: input/output error` when process just exits. - return nil - } - return ep.err -} - -func (ep *expectProcess) Lines() []string { - ep.mu.RLock() - defer ep.mu.RUnlock() - return ep.lines -} diff --git a/tests/curl_test.go b/tests/curl_test.go deleted file mode 100644 index 1324d3b985..0000000000 --- a/tests/curl_test.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package tests - -import "testing" - -func TestExpectFunc(t *testing.T) { - ep, err := newExpect("echo", "hello world") - if err != nil { - t.Fatal(err) - } - wstr := "hello world\r\n" - l, eerr := ep.ExpectFunc(func(a string) bool { return len(a) > 10 }) - if eerr != nil { - t.Fatal(eerr) - } - if l != wstr { - t.Fatalf(`got "%v", expected "%v"`, l, wstr) - } - if cerr := ep.Close(); cerr != nil { - t.Fatal(cerr) - } -} - -func TestEcho(t *testing.T) { - ep, err := newExpect("echo", "hello world") - if err != nil { - t.Fatal(err) - } - l, eerr := ep.Expect("world") - if eerr != nil { - t.Fatal(eerr) - } - wstr := "hello world" - if l[:len(wstr)] != wstr { - t.Fatalf(`got "%v", expected "%v"`, l, wstr) - } - if cerr := ep.Close(); cerr != nil { - t.Fatal(cerr) - } - if _, eerr = ep.Expect("..."); eerr == nil { - t.Fatalf("expected error on closed expect process") - } -} diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go deleted file mode 100644 index bd801f0bbf..0000000000 --- a/tests/e2e/e2e_test.go +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -// e2e implements the e2e tests. -package e2e - -import ( - "context" - "flag" - "fmt" - "os" - "testing" - "time" - - "github.com/ava-labs/avalanche-network-runner/client" - "github.com/ava-labs/avalanche-network-runner/rpcpb" - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/subnet-evm/tests/e2e/runner" - "github.com/ava-labs/subnet-evm/tests/e2e/utils" - ginkgo "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/formatter" - "github.com/onsi/gomega" - "gopkg.in/yaml.v2" - - _ "github.com/ava-labs/subnet-evm/tests/e2e/ping" - _ "github.com/ava-labs/subnet-evm/tests/e2e/solidity" -) - -func TestE2E(t *testing.T) { - gomega.RegisterFailHandler(ginkgo.Fail) - ginkgo.RunSpecs(t, "subnet-evm e2e test suites") -} - -var ( - networkRunnerLogLevel string - gRPCEp string - gRPCGatewayEp string - - outputFile string - pluginDir string - - // sets the "avalanchego" exec path - execPath string - - vmGenesisPath string - - skipNetworkRunnerStart bool - skipNetworkRunnerShutdown bool -) - -func init() { - flag.StringVar( - &networkRunnerLogLevel, - "network-runner-log-level", - "info", - "gRPC server endpoint", - ) - flag.StringVar( - &gRPCEp, - "network-runner-grpc-endpoint", - "0.0.0.0:8080", - "gRPC server endpoint", - ) - flag.StringVar( - &gRPCGatewayEp, - "network-runner-grpc-gateway-endpoint", - "0.0.0.0:8081", - "gRPC gateway endpoint", - ) - - flag.StringVar( - &execPath, - "avalanchego-path", - "", - "avalanchego executable path", - ) - flag.StringVar( - &pluginDir, - "avalanchego-plugin-dir", - "", - "avalanchego plugin directory", - ) - flag.StringVar( - &vmGenesisPath, - "vm-genesis-path", - "", - "VM genesis file path", - ) - flag.StringVar( - &outputFile, - "output-path", - "", - "output YAML path to write local cluster information", - ) - flag.BoolVar( - &skipNetworkRunnerStart, - "skip-network-runner-start", - false, - "'true' to skip network runner start", - ) - flag.BoolVar( - &skipNetworkRunnerShutdown, - "skip-network-runner-shutdown", - false, - "'true' to skip network runner shutdown", - ) -} - -const vmName = "subnetevm" - -var vmID ids.ID - -func init() { - // TODO: add "getVMID" util function in avalanchego and import from "avalanchego" - b := make([]byte, 32) - copy(b, []byte(vmName)) - var err error - vmID, err = ids.ToID(b) - if err != nil { - panic(err) - } -} - -var subnetEVMRPCEps []string - -var _ = ginkgo.BeforeSuite(func() { - utils.SetOutputFile(outputFile) - utils.SetPluginDir(pluginDir) - utils.SetExecPath(execPath) - utils.SetPluginDir(pluginDir) - utils.SetVmGenesisPath(vmGenesisPath) - utils.SetSkipNetworkRunnerStart(skipNetworkRunnerStart) - utils.SetSkipNetworkRunnerShutdown(skipNetworkRunnerShutdown) - - err := runner.InitializeRunner(execPath, gRPCEp, networkRunnerLogLevel) - gomega.Expect(err).Should(gomega.BeNil()) - - if utils.GetSkipNetworkRunnerStart() { - return - } - - runnerCli := runner.GetClient() - gomega.Expect(runnerCli).ShouldNot(gomega.BeNil()) - - ginkgo.By("calling start API via network runner", func() { - outf("{{green}}sending 'start' with binary path:{{/}} %q\n", utils.GetExecPath()) - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) - resp, err := runnerCli.Start( - ctx, - utils.GetExecPath(), - client.WithPluginDir(utils.GetPluginDir()), - client.WithBlockchainSpecs( - []*rpcpb.BlockchainSpec{ - { - VmName: vmName, - Genesis: utils.GetVmGenesisPath(), - }, - }, - )) - cancel() - gomega.Expect(err).Should(gomega.BeNil()) - outf("{{green}}successfully started:{{/}} %+v\n", resp.ClusterInfo.NodeNames) - }) - - // TODO: network runner health should imply custom VM healthiness - // or provide a separate API for custom VM healthiness - // "start" is async, so wait some time for cluster health - outf("\n{{magenta}}sleeping before checking custom VM status...{{/}}\n") - time.Sleep(2 * time.Minute) - - ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) - _, err = runnerCli.Health(ctx) - cancel() - gomega.Expect(err).Should(gomega.BeNil()) - - subnetEVMRPCEps = make([]string, 0) - blockchainID, logsDir := "", "" - - // wait up to 5-minute for custom VM installation - outf("\n{{magenta}}waiting for all custom VMs to report healthy...{{/}}\n") - ctx, cancel = context.WithTimeout(context.Background(), 5*time.Minute) -done: - for ctx.Err() == nil { - select { - case <-ctx.Done(): - break done - case <-time.After(5 * time.Second): - } - - outf("{{magenta}}checking custom VM status{{/}}\n") - cctx, ccancel := context.WithTimeout(context.Background(), 2*time.Minute) - resp, err := runnerCli.Status(cctx) - ccancel() - gomega.Expect(err).Should(gomega.BeNil()) - - // all logs are stored under root data dir - logsDir = resp.GetClusterInfo().GetRootDataDir() - - for blkChainID, vmInfo := range resp.ClusterInfo.CustomChains { - if vmInfo.VmId == vmID.String() { - blockchainID = blkChainID - outf("{{blue}}subnet-evm is ready:{{/}} %+v\n", vmInfo) - break done - } - } - } - gomega.Expect(ctx.Err()).Should(gomega.BeNil()) - cancel() - - gomega.Expect(blockchainID).Should(gomega.Not(gomega.BeEmpty())) - gomega.Expect(logsDir).Should(gomega.Not(gomega.BeEmpty())) - - cctx, ccancel := context.WithTimeout(context.Background(), 2*time.Minute) - uris, err := runnerCli.URIs(cctx) - ccancel() - gomega.Expect(err).Should(gomega.BeNil()) - outf("{{blue}}avalanche HTTP RPCs URIs:{{/}} %q\n", uris) - - for _, u := range uris { - rpcEP := fmt.Sprintf("%s/ext/bc/%s/rpc", u, blockchainID) - subnetEVMRPCEps = append(subnetEVMRPCEps, rpcEP) - outf("{{blue}}avalanche subnet-evm RPC:{{/}} %q\n", rpcEP) - } - - pid := os.Getpid() - outf("{{blue}}{{bold}}writing output %q with PID %d{{/}}\n", utils.GetOutputPath(), pid) - ci := clusterInfo{ - URIs: uris, - Endpoint: fmt.Sprintf("/ext/bc/%s", blockchainID), - PID: pid, - LogsDir: logsDir, - } - gomega.Expect(ci.Save(utils.GetOutputPath())).Should(gomega.BeNil()) - - b, err := os.ReadFile(utils.GetOutputPath()) - gomega.Expect(err).Should(gomega.BeNil()) - outf("\n{{blue}}$ cat %s:{{/}}\n%s\n", utils.GetOutputPath(), string(b)) -}) - -var _ = ginkgo.AfterSuite(func() { - if utils.GetSkipNetworkRunnerShutdown() { - return - } - - // if cluster is running, shut it down - running := runner.IsRunnerUp() - if running { - err := runner.StopNetwork() - gomega.Expect(err).Should(gomega.BeNil()) - } - err := runner.ShutdownClient() - gomega.Expect(err).Should(gomega.BeNil()) -}) - -// Outputs to stdout. -// -// e.g., -// Out("{{green}}{{bold}}hi there %q{{/}}", "aa") -// Out("{{magenta}}{{bold}}hi therea{{/}} {{cyan}}{{underline}}b{{/}}") -// -// ref. -// https://github.com/onsi/ginkgo/blob/v2.0.0/formatter/formatter.go#L52-L73 -// -func outf(format string, args ...interface{}) { - s := formatter.F(format, args...) - fmt.Fprint(formatter.ColorableStdOut, s) -} - -// clusterInfo represents the local cluster information. -type clusterInfo struct { - URIs []string `json:"uris"` - Endpoint string `json:"endpoint"` - PID int `json:"pid"` - LogsDir string `json:"logsDir"` -} - -const fsModeWrite = 0o600 - -func (ci clusterInfo) Save(p string) error { - ob, err := yaml.Marshal(ci) - if err != nil { - return err - } - return os.WriteFile(p, ob, fsModeWrite) -} diff --git a/tests/e2e/genesis/contract_native_minter.json b/tests/e2e/genesis/contract_native_minter.json deleted file mode 100644 index 6d34c8b52e..0000000000 --- a/tests/e2e/genesis/contract_native_minter.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "config": { - "chainId": 99999, - "homesteadBlock": 0, - "eip150Block": 0, - "eip150Hash": "0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0", - "eip155Block": 0, - "eip158Block": 0, - "byzantiumBlock": 0, - "constantinopleBlock": 0, - "petersburgBlock": 0, - "istanbulBlock": 0, - "muirGlacierBlock": 0, - "subnetEVMTimestamp": 0, - "feeConfig": { - "gasLimit": 20000000, - "minBaseFee": 1000000000, - "targetGas": 100000000, - "baseFeeChangeDenominator": 48, - "minBlockGasCost": 0, - "maxBlockGasCost": 10000000, - "targetBlockRate": 2, - "blockGasCostStep": 500000 - }, - "contractNativeMinterConfig": { - "blockTimestamp": 0, - "adminAddresses": [ - "0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC" - ] - } - }, - "alloc": { - "8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC": { - "balance": "0x52B7D2DCC80CD2E4000000" - }, - "0x0Fa8EA536Be85F32724D57A37758761B86416123": { - "balance": "0x52B7D2DCC80CD2E4000000" - } - }, - "nonce": "0x0", - "timestamp": "0x0", - "extraData": "0x00", - "gasLimit": "0x1312D00", - "difficulty": "0x0", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "coinbase": "0x0000000000000000000000000000000000000000", - "number": "0x0", - "gasUsed": "0x0", - "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" -} diff --git a/tests/e2e/genesis/deployer_allow_list.json b/tests/e2e/genesis/deployer_allow_list.json deleted file mode 100644 index e63bae1339..0000000000 --- a/tests/e2e/genesis/deployer_allow_list.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "config": { - "chainId": 99999, - "homesteadBlock": 0, - "eip150Block": 0, - "eip150Hash": "0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0", - "eip155Block": 0, - "eip158Block": 0, - "byzantiumBlock": 0, - "constantinopleBlock": 0, - "petersburgBlock": 0, - "istanbulBlock": 0, - "muirGlacierBlock": 0, - "subnetEVMTimestamp": 0, - "feeConfig": { - "gasLimit": 20000000, - "minBaseFee": 1000000000, - "targetGas": 100000000, - "baseFeeChangeDenominator": 48, - "minBlockGasCost": 0, - "maxBlockGasCost": 10000000, - "targetBlockRate": 2, - "blockGasCostStep": 500000 - }, - "contractDeployerAllowListConfig": { - "blockTimestamp": 0, - "adminAddresses": [ - "0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC" - ] - } - }, - "alloc": { - "8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC": { - "balance": "0x52B7D2DCC80CD2E4000000" - }, - "0x0Fa8EA536Be85F32724D57A37758761B86416123": { - "balance": "0x52B7D2DCC80CD2E4000000" - } - }, - "nonce": "0x0", - "timestamp": "0x0", - "extraData": "0x00", - "gasLimit": "0x1312D00", - "difficulty": "0x0", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "coinbase": "0x0000000000000000000000000000000000000000", - "number": "0x0", - "gasUsed": "0x0", - "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" -} diff --git a/tests/e2e/genesis/fee_manager.json b/tests/e2e/genesis/fee_manager.json deleted file mode 100644 index 673dfb1346..0000000000 --- a/tests/e2e/genesis/fee_manager.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "config": { - "chainId": 99999, - "homesteadBlock": 0, - "eip150Block": 0, - "eip150Hash": "0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0", - "eip155Block": 0, - "eip158Block": 0, - "byzantiumBlock": 0, - "constantinopleBlock": 0, - "petersburgBlock": 0, - "istanbulBlock": 0, - "muirGlacierBlock": 0, - "subnetEVMTimestamp": 0, - "feeConfig": { - "gasLimit": 20000000, - "minBaseFee": 1000000000, - "targetGas": 100000000, - "baseFeeChangeDenominator": 48, - "minBlockGasCost": 0, - "maxBlockGasCost": 10000000, - "targetBlockRate": 2, - "blockGasCostStep": 500000 - }, - "feeManagerConfig": { - "blockTimestamp": 0, - "adminAddresses": [ - "0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC" - ] - } - }, - "alloc": { - "8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC": { - "balance": "0x52B7D2DCC80CD2E4000000" - }, - "0x0Fa8EA536Be85F32724D57A37758761B86416123": { - "balance": "0x52B7D2DCC80CD2E4000000" - } - }, - "nonce": "0x0", - "timestamp": "0x0", - "extraData": "0x00", - "gasLimit": "0x1312D00", - "difficulty": "0x0", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "coinbase": "0x0000000000000000000000000000000000000000", - "number": "0x0", - "gasUsed": "0x0", - "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" -} diff --git a/tests/e2e/genesis/tx_allow_list.json b/tests/e2e/genesis/tx_allow_list.json deleted file mode 100644 index c525d72056..0000000000 --- a/tests/e2e/genesis/tx_allow_list.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "config": { - "chainId": 99999, - "homesteadBlock": 0, - "eip150Block": 0, - "eip150Hash": "0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0", - "eip155Block": 0, - "eip158Block": 0, - "byzantiumBlock": 0, - "constantinopleBlock": 0, - "petersburgBlock": 0, - "istanbulBlock": 0, - "muirGlacierBlock": 0, - "subnetEVMTimestamp": 0, - "feeConfig": { - "gasLimit": 20000000, - "minBaseFee": 1000000000, - "targetGas": 100000000, - "baseFeeChangeDenominator": 48, - "minBlockGasCost": 0, - "maxBlockGasCost": 10000000, - "targetBlockRate": 2, - "blockGasCostStep": 500000 - }, - "txAllowListConfig": { - "blockTimestamp": 0, - "adminAddresses": [ - "0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC" - ] - } - }, - "alloc": { - "8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC": { - "balance": "0x52B7D2DCC80CD2E4000000" - } - }, - "nonce": "0x0", - "timestamp": "0x0", - "extraData": "0x00", - "gasLimit": "0x1312D00", - "difficulty": "0x0", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "coinbase": "0x0000000000000000000000000000000000000000", - "number": "0x0", - "gasUsed": "0x0", - "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" -} \ No newline at end of file diff --git a/tests/e2e/ping/suites.go b/tests/e2e/ping/suites.go deleted file mode 100644 index dd4c2f1e76..0000000000 --- a/tests/e2e/ping/suites.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -// Implements ping tests, requires network-runner cluster. -package ping - -import ( - "context" - "time" - - "github.com/ava-labs/subnet-evm/tests/e2e/runner" - "github.com/ava-labs/subnet-evm/tests/e2e/utils" - - ginkgo "github.com/onsi/ginkgo/v2" - "github.com/onsi/gomega" -) - -var _ = utils.DescribeLocal("[Ping]", func() { - ginkgo.It("can ping network-runner RPC server", func() { - runnerCli := runner.GetClient() - gomega.Expect(runnerCli).ShouldNot(gomega.BeNil()) - - ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) - _, err := runnerCli.Ping(ctx) - cancel() - gomega.Expect(err).Should(gomega.BeNil()) - }) -}) diff --git a/tests/e2e/runner/runner.go b/tests/e2e/runner/runner.go deleted file mode 100644 index fd49faa613..0000000000 --- a/tests/e2e/runner/runner.go +++ /dev/null @@ -1,218 +0,0 @@ -package runner - -import ( - "context" - "errors" - "fmt" - "os" - "time" - - "github.com/ava-labs/avalanche-network-runner/client" - "github.com/ava-labs/avalanche-network-runner/rpcpb" - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/utils/logging" - "github.com/ava-labs/subnet-evm/tests/e2e/utils" - "github.com/onsi/ginkgo/v2/formatter" - - "sigs.k8s.io/yaml" -) - -var ( - execPath string - - cli client.Client -) - -type clusterInfo struct { - URIs []string `json:"uris"` - Endpoint string `json:"endpoint"` - PID int `json:"pid"` - LogsDir string `json:"logsDir"` -} - -const fsModeWrite = 0o600 - -func (ci clusterInfo) Save(p string) error { - ob, err := yaml.Marshal(ci) - if err != nil { - return err - } - return os.WriteFile(p, ob, fsModeWrite) -} - -func GetClient() client.Client { - return cli -} - -func InitializeRunner(execPath_ string, grpcEp string, networkRunnerLogLevel string) error { - execPath = execPath_ - - // Create the logger - logLevel, err := logging.ToLevel(networkRunnerLogLevel) - if err != nil { - return err - } - - logFactory := logging.NewFactory(logging.Config{ - DisplayLevel: logLevel, - LogLevel: logging.Off, // Disable writing logs to files in favor of only writing logs to display - }) - log, err := logFactory.Make("main") - if err != nil { - return err - } - - cli, err = client.New(client.Config{ - Endpoint: grpcEp, - DialTimeout: 10 * time.Second, - }, log) - return err -} - -func startRunner(vmName string, genesisPath string, pluginDir string) error { - fmt.Println("calling start API via network runner") - outf("{{green}}sending 'start' with binary path:{{/}} %q\n", execPath) - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) - resp, err := cli.Start( - ctx, - execPath, - client.WithPluginDir(pluginDir), - client.WithBlockchainSpecs([]*rpcpb.BlockchainSpec{ - { - VmName: vmName, - Genesis: genesisPath, - }, - }), - ) - cancel() - if err != nil { - return err - } - outf("{{green}}successfully started:{{/}} %+v\n", resp.ClusterInfo.NodeNames) - return nil -} - -func WaitForCustomVm(vmId ids.ID) (string, string, error) { - blockchainID, logsDir := "", "" - - // wait up to 5-minute for custom VM installation - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) -done: - for ctx.Err() == nil { - select { - case <-ctx.Done(): - break done - case <-time.After(5 * time.Second): - } - - outf("{{magenta}}checking custom VM status{{/}}\n") - cctx, ccancel := context.WithTimeout(context.Background(), 2*time.Minute) - resp, err := cli.Health(cctx) - ccancel() - if err != nil { - cancel() - return "", "", err - } - - if !resp.ClusterInfo.Healthy { - continue - } - - if !resp.ClusterInfo.CustomChainsHealthy { - continue - } - - // all logs are stored under root data dir - logsDir = resp.GetClusterInfo().GetRootDataDir() - - for chainID, chainInfo := range resp.ClusterInfo.CustomChains { - if chainInfo.VmId == vmId.String() { - blockchainID = chainID - outf("{{blue}}subnet-evm is ready:{{/}} %+v\n", chainInfo) - break done - } - } - } - err := ctx.Err() - if err != nil { - cancel() - return "", "", err - } - cancel() - - if blockchainID == "" { - return "", "", errors.New("BlockchainId not found") - } - if logsDir == "" { - return "", "", errors.New("logsDir not found") - } - return blockchainID, logsDir, nil -} - -func GetClusterInfo(blockchainId string, logsDir string) (clusterInfo, error) { - cctx, ccancel := context.WithTimeout(context.Background(), 2*time.Minute) - uris, err := cli.URIs(cctx) - ccancel() - if err != nil { - return clusterInfo{}, err - } - outf("{{blue}}avalanche HTTP RPCs URIs:{{/}} %q\n", uris) - - subnetEVMRPCEps := make([]string, 0) - for _, u := range uris { - rpcEP := fmt.Sprintf("%s/ext/bc/%s/rpc", u, blockchainId) - subnetEVMRPCEps = append(subnetEVMRPCEps, rpcEP) - outf("{{blue}}avalanche subnet-evm RPC:{{/}} %q\n", rpcEP) - } - - pid := os.Getpid() - ci := clusterInfo{ - URIs: uris, - Endpoint: fmt.Sprintf("/ext/bc/%s", blockchainId), - PID: pid, - LogsDir: logsDir, - } - err = ci.Save(utils.GetOutputPath()) - if err != nil { - return clusterInfo{}, err - } - return ci, nil -} - -func StartNetwork(vmId ids.ID, vmName string, genesisPath string, pluginDir string) (clusterInfo, error) { - fmt.Println("Starting network") - startRunner(vmName, genesisPath, pluginDir) - - blockchainId, logsDir, err := WaitForCustomVm(vmId) - if err != nil { - return clusterInfo{}, err - } - fmt.Println("Got custom vm") - - return GetClusterInfo(blockchainId, logsDir) -} - -func StopNetwork() error { - outf("{{red}}shutting down network{{/}}\n") - ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) - _, err := cli.Stop(ctx) - cancel() - return err -} - -func ShutdownClient() error { - outf("{{red}}shutting down client{{/}}\n") - return cli.Close() -} - -func outf(format string, args ...interface{}) { - s := formatter.F(format, args...) - fmt.Fprint(formatter.ColorableStdOut, s) -} - -func IsRunnerUp() bool { - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - _, err := cli.Health(ctx) - cancel() - return err == nil -} diff --git a/tests/e2e/solidity/suites.go b/tests/e2e/solidity/suites.go deleted file mode 100644 index ef07428e7e..0000000000 --- a/tests/e2e/solidity/suites.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -// Implements solidity tests. -package solidity - -import ( - "fmt" - "os/exec" - - "github.com/ava-labs/subnet-evm/plugin/evm" - "github.com/ava-labs/subnet-evm/tests/e2e/runner" - "github.com/ava-labs/subnet-evm/tests/e2e/utils" - - ginkgo "github.com/onsi/ginkgo/v2" - "github.com/onsi/gomega" -) - -const vmName = "subnetevm" - -func runHardhatTests(test string) { - cmd := exec.Command("npx", "hardhat", "test", test, "--network", "e2e") - cmd.Dir = "./contract-examples" - out, err := cmd.Output() - fmt.Println(string(out)) - gomega.Expect(err).Should(gomega.BeNil()) -} - -// startSubnet starts a test network and launches a subnetEVM instance with the genesis file at [genesisPath] -func startSubnet(genesisPath string) error { - _, err := runner.StartNetwork(evm.ID, vmName, genesisPath, utils.GetPluginDir()) - gomega.Expect(err).Should(gomega.BeNil()) - return utils.UpdateHardhatConfig() -} - -// stopSubnet stops the test network. -func stopSubnet() { - err := runner.StopNetwork() - gomega.Expect(err).Should(gomega.BeNil()) -} - -var _ = utils.DescribePrecompile(func() { - ginkgo.It("tx allow list", func() { - err := startSubnet("./tests/e2e/genesis/tx_allow_list.json") - gomega.Expect(err).Should(gomega.BeNil()) - running := runner.IsRunnerUp() - gomega.Expect(running).Should(gomega.BeTrue()) - runHardhatTests("./test/ExampleTxAllowList.ts") - stopSubnet() - running = runner.IsRunnerUp() - gomega.Expect(running).Should(gomega.BeFalse()) - }) - - ginkgo.It("deployer allow list", func() { - err := startSubnet("./tests/e2e/genesis/deployer_allow_list.json") - gomega.Expect(err).Should(gomega.BeNil()) - running := runner.IsRunnerUp() - gomega.Expect(running).Should(gomega.BeTrue()) - runHardhatTests("./test/ExampleDeployerList.ts") - stopSubnet() - running = runner.IsRunnerUp() - gomega.Expect(running).Should(gomega.BeFalse()) - }) - - ginkgo.It("contract native minter", func() { - err := startSubnet("./tests/e2e/genesis/contract_native_minter.json") - gomega.Expect(err).Should(gomega.BeNil()) - running := runner.IsRunnerUp() - gomega.Expect(running).Should(gomega.BeTrue()) - runHardhatTests("./test/ERC20NativeMinter.ts") - stopSubnet() - running = runner.IsRunnerUp() - gomega.Expect(running).Should(gomega.BeFalse()) - }) - - ginkgo.It("fee manager", func() { - err := startSubnet("./tests/e2e/genesis/fee_manager.json") - gomega.Expect(err).Should(gomega.BeNil()) - running := runner.IsRunnerUp() - gomega.Expect(running).Should(gomega.BeTrue()) - runHardhatTests("./test/ExampleFeeManager.ts") - stopSubnet() - running = runner.IsRunnerUp() - gomega.Expect(running).Should(gomega.BeFalse()) - }) - - // ADD YOUR PRECOMPILE HERE - /* - ginkgo.It("your precompile", func() { - err := startSubnet("./tests/e2e/genesis/{your_precompile}.json") - gomega.Expect(err).Should(gomega.BeNil()) - running := runner.IsRunnerUp() - gomega.Expect(running).Should(gomega.BeTrue()) - runHardhatTests("./test/Example{YourPrecompile}Test.ts") - stopSubnet() - running = runner.IsRunnerUp() - gomega.Expect(running).Should(gomega.BeFalse()) - }) - */ -}) diff --git a/tests/e2e/utils/describe.go b/tests/e2e/utils/describe.go deleted file mode 100644 index cde6ee371c..0000000000 --- a/tests/e2e/utils/describe.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package utils - -import ( - ginkgo "github.com/onsi/ginkgo/v2" -) - -// DescribeLocal annotates the tests that requires local network-runner. -// Can only run with local cluster. -func DescribeLocal(text string, body func()) bool { - return ginkgo.Describe("[Local] "+text, body) -} - -func DescribePrecompile(body func()) bool { - return ginkgo.Describe("[Precompiles]", ginkgo.Ordered, body) -} diff --git a/tests/e2e/utils/params.go b/tests/e2e/utils/params.go deleted file mode 100644 index 9e0badaea8..0000000000 --- a/tests/e2e/utils/params.go +++ /dev/null @@ -1,98 +0,0 @@ -package utils - -import "sync" - -var ( - mu sync.RWMutex - - outputFile string - pluginDir string - - // executable path for "avalanchego" - execPath string - - vmGenesisPath string - - skipNetworkRunnerStart bool - skipNetworkRunnerShutdown bool -) - -func SetOutputFile(filepath string) { - mu.Lock() - outputFile = filepath - mu.Unlock() -} - -func GetOutputPath() string { - mu.RLock() - e := outputFile - mu.RUnlock() - return e -} - -// Sets the executable path for "avalanchego". -func SetExecPath(p string) { - mu.Lock() - execPath = p - mu.Unlock() -} - -// Loads the executable path for "avalanchego". -func GetExecPath() string { - mu.RLock() - e := execPath - mu.RUnlock() - return e -} - -func SetPluginDir(dir string) { - mu.Lock() - pluginDir = dir - mu.Unlock() -} - -func GetPluginDir() string { - mu.RLock() - p := pluginDir - mu.RUnlock() - return p -} - -func SetVmGenesisPath(p string) { - mu.Lock() - vmGenesisPath = p - mu.Unlock() -} - -func GetVmGenesisPath() string { - mu.RLock() - p := vmGenesisPath - mu.RUnlock() - return p -} - -func SetSkipNetworkRunnerStart(b bool) { - mu.Lock() - skipNetworkRunnerStart = b - mu.Unlock() -} - -func GetSkipNetworkRunnerStart() bool { - mu.RLock() - b := skipNetworkRunnerStart - mu.RUnlock() - return b -} - -func SetSkipNetworkRunnerShutdown(b bool) { - mu.Lock() - skipNetworkRunnerShutdown = b - mu.Unlock() -} - -func GetSkipNetworkRunnerShutdown() bool { - mu.RLock() - b := skipNetworkRunnerShutdown - mu.RUnlock() - return b -} diff --git a/tests/e2e/utils/parser.go b/tests/e2e/utils/parser.go deleted file mode 100644 index d2c80999c0..0000000000 --- a/tests/e2e/utils/parser.go +++ /dev/null @@ -1,75 +0,0 @@ -// (c) 2022 Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package utils - -import ( - "encoding/json" - "fmt" - "io/ioutil" - - "github.com/fatih/color" - "gopkg.in/yaml.v2" -) - -/* -===Example File=== - -endpoint: /ext/bc/2Z36RnQuk1hvsnFeGWzfZUfXNr7w1SjzmDQ78YxfTVNAkDq3nZ -logsDir: /var/folders/mp/6jm81gc11dv3xtcwxmrd8mcr0000gn/T/runnerlogs2984620995 -pid: 55547 -uris: -- http://localhost:61278 -- http://localhost:61280 -- http://localhost:61282 -- http://localhost:61284 -- http://localhost:61286 -*/ - -type output struct { - Endpoint string `yaml:"endpoint"` - Logs string `yaml:"logsDir"` - PID int `yaml:"pid"` - URIs []string `yaml:"uris"` -} - -type rpcFile struct { - Rpc string `json:"rpc"` -} - -const ( - DYNAMIC_RPC_FILE = "contract-examples/dynamic_rpc.json" -) - -func writeRPC(rpcUrl string) error { - rpcFileData := rpcFile{ - Rpc: rpcUrl, - } - - file, err := json.MarshalIndent(rpcFileData, "", " ") - if err != nil { - return err - } - - err = ioutil.WriteFile(DYNAMIC_RPC_FILE, file, 0644) - return err -} - -func UpdateHardhatConfig() error { - yamlFile, err := ioutil.ReadFile(outputFile) - if err != nil { - return err - } - var o output - if err := yaml.Unmarshal(yamlFile, &o); err != nil { - return err - } - - color.Yellow("Updating hardhat config with RPC URL: %s%s/rpc", o.URIs[0], o.Endpoint) - - rpc := fmt.Sprintf("%s%s/rpc", o.URIs[0], o.Endpoint) - if err = writeRPC(rpc); err != nil { - return err - } - return nil -}