From 219c0bd643b076eb4c536463614d051865145cdf Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 14 Dec 2022 16:09:07 -0500 Subject: [PATCH 01/55] Simplify e2e tests --- contract-examples/hardhat.config.ts | 43 +-- contract-examples/local_rpc.example.json | 4 - ...iveMinter.ts => contract_native_minter.ts} | 0 go.mod | 38 ++- go.sum | 86 ++++- scripts/run_ginkgo.sh | 27 ++ scripts/run_single_node.sh | 41 +++ tests/curl.go | 181 ----------- tests/curl_test.go | 45 --- tests/e2e/e2e_test.go | 294 +++--------------- tests/e2e/ping/suites.go | 27 -- tests/e2e/runner/runner.go | 226 -------------- tests/e2e/solidity/suites.go | 217 ++++++++----- tests/e2e/utils/command.go | 17 +- tests/e2e/utils/constants.go | 8 + tests/e2e/utils/describe.go | 18 -- tests/e2e/utils/evm_client.go | 31 +- tests/e2e/utils/out.go | 24 -- tests/e2e/utils/params.go | 142 --------- tests/e2e/utils/parser.go | 80 ----- 20 files changed, 397 insertions(+), 1152 deletions(-) delete mode 100644 contract-examples/local_rpc.example.json rename contract-examples/test/{ERC20NativeMinter.ts => contract_native_minter.ts} (100%) create mode 100755 scripts/run_ginkgo.sh create mode 100755 scripts/run_single_node.sh delete mode 100644 tests/curl.go delete mode 100644 tests/curl_test.go delete mode 100644 tests/e2e/ping/suites.go delete mode 100644 tests/e2e/runner/runner.go create mode 100644 tests/e2e/utils/constants.go delete mode 100644 tests/e2e/utils/describe.go delete mode 100644 tests/e2e/utils/out.go delete mode 100644 tests/e2e/utils/params.go delete mode 100644 tests/e2e/utils/parser.go diff --git a/contract-examples/hardhat.config.ts b/contract-examples/hardhat.config.ts index ab17286bcf..dab6abd093 100644 --- a/contract-examples/hardhat.config.ts +++ b/contract-examples/hardhat.config.ts @@ -1,19 +1,10 @@ import "@nomiclabs/hardhat-waffle" import "./tasks.ts" -import { existsSync } from "fs" -// Import the dynamic rpc url if the file exists -let testRpc = "" -if (existsSync("./dynamic_rpc.json")) { - const importedRpc = require("./dynamic_rpc.json") - testRpc = importedRpc.rpc -} - -var localConf -if (existsSync("./local_rpc.json")) { - const importedRpc = require("./local_rpc.json") - localConf = importedRpc -} +// HardHat users must populate these environment variables in order to connect to their subnet-evm instance +// Since the blockchainID is not necessarily known, there's no good default to use here. +var local_rpc_uri = process.env.RPC_URI || "http://127.0.0.1:9650/ext/bc/subnet-evm-chain/rpc" +var local_chain_id = process.env.CHAIN_ID || 99999 export default { solidity: { @@ -38,26 +29,9 @@ export default { networks: { local: { //"http://{ip}:{port}/ext/bc/{chainID}/rpc - // modify this in the local_rpc.json - url: localConf.rpc, - chainId: localConf.chainId, - accounts: [ - "0x56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027", - "0x7b4198529994b0dc604278c99d153cfd069d594753d471171a1d102a10438e07", - "0x15614556be13730e9e8d6eacc1603143e7b96987429df8726384c2ec4502ef6e", - "0x31b571bf6894a248831ff937bb49f7754509fe93bbd2517c9c73c4144c0e97dc", - "0x6934bef917e01692b789da754a0eae31a8536eb465e7bff752ea291dad88c675", - "0xe700bdbdbc279b808b1ec45f8c2370e4616d3a02c336e68d85d4668e08f53cff", - "0xbbc2865b76ba28016bc2255c7504d000e046ae01934b04c694592a6276988630", - "0xcdbfd34f687ced8c6968854f8a99ae47712c4f4183b78dcc4a903d1bfe8cbf60", - "0x86f78c5416151fe3546dece84fda4b4b1e36089f2dbc48496faf3a950f16157c", - "0x750839e9dbbd2a0910efe40f50b2f3b2f2f59f5580bb4b83bd8c1201cf9a010a" - ] - }, - e2e: { - //"http://{ip}:{port}/ext/bc/{chainID}/rpc - url: testRpc, - chainId: 99999, + // expected to be populated by the environment variables above + url: local_rpc_uri, + chainId: local_chain_id, accounts: [ "0x56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027", "0x7b4198529994b0dc604278c99d153cfd069d594753d471171a1d102a10438e07", @@ -69,7 +43,8 @@ export default { "0xcdbfd34f687ced8c6968854f8a99ae47712c4f4183b78dcc4a903d1bfe8cbf60", "0x86f78c5416151fe3546dece84fda4b4b1e36089f2dbc48496faf3a950f16157c", "0x750839e9dbbd2a0910efe40f50b2f3b2f2f59f5580bb4b83bd8c1201cf9a010a" - ] + ], + pollingInterval: "2s" }, } } diff --git a/contract-examples/local_rpc.example.json b/contract-examples/local_rpc.example.json deleted file mode 100644 index bcd2516399..0000000000 --- a/contract-examples/local_rpc.example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "rpc": "http://127.0.0.1:9650/ext/bc/dRTfPJh4jEaRZoGkPc7xreeYbDGBrGWRV48WAYVyUgApsmzGo/rpc", - "chainId": 43214 -} diff --git a/contract-examples/test/ERC20NativeMinter.ts b/contract-examples/test/contract_native_minter.ts similarity index 100% rename from contract-examples/test/ERC20NativeMinter.ts rename to contract-examples/test/contract_native_minter.ts diff --git a/go.mod b/go.mod index 6e2183b9fb..777a4470ab 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-sdk v0.3.0 - github.com/ava-labs/avalanchego v1.9.4 + github.com/ava-labs/avalanchego v1.9.5-rc.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.26 - github.com/fatih/color v1.13.0 github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 github.com/fsnotify/fsnotify v1.6.0 github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 @@ -46,28 +43,46 @@ require ( golang.org/x/text v0.4.0 golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac gopkg.in/urfave/cli.v1 v1.20.0 - gopkg.in/yaml.v2 v2.4.0 - sigs.k8s.io/yaml v1.3.0 ) require ( + github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect + 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/avalanche-ledger-go v0.0.13 // indirect + github.com/ava-labs/coreth v0.11.5-0.20221213204439-7bd1eeaeaa9c // 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/cenkalti/backoff/v4 v4.1.3 // 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/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // 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.9 // 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.12.0 // indirect @@ -79,7 +94,12 @@ 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/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 @@ -100,6 +120,7 @@ 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/subosito/gotenv v1.3.0 // indirect @@ -108,6 +129,8 @@ require ( github.com/tklauser/numcpus v0.2.2 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect + github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266 // indirect + github.com/zondax/ledger-go v0.13.0 // indirect go.opentelemetry.io/otel v1.11.0 // indirect go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.0 // indirect @@ -129,5 +152,8 @@ 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 ) + +replace github.com/ava-labs/avalanchego => ../avalanchego diff --git a/go.sum b/go.sum index 9818ad469d..356f4d7496 100644 --- a/go.sum +++ b/go.sum @@ -44,9 +44,17 @@ 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/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec h1:1Qb69mGp/UtRPn422BH4/Y4Q3SLUrD9KHuDkm8iodFc= +github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec/go.mod h1:CD8UlnlLDiqb36L110uqiP2iSflVjx9g/3U9hCI4q2U= +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= @@ -58,10 +66,10 @@ 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-sdk v0.3.0 h1:TVi9JEdKNU/RevYZ9PyW4pULbEdS+KQDA9Ki2DUvuAs= -github.com/ava-labs/avalanche-network-runner-sdk v0.3.0/go.mod h1:SgKJvtqvgo/Bl/c8fxEHCLaSxEbzimYfBopcfrajxQk= -github.com/ava-labs/avalanchego v1.9.4 h1:z5tE/vUGzUQflqv3mn6X5E1VTCZHYhuD36idOyPNRrc= -github.com/ava-labs/avalanchego v1.9.4/go.mod h1:H4pMTYzgudfPs9WX+KXI0nCiUGNkdgPWOwm1nqzGibQ= +github.com/ava-labs/avalanche-ledger-go v0.0.13 h1:YTdaSuaZS/1ct1RGirBEJeo2tiSfVeJGaE12XtUSGnE= +github.com/ava-labs/avalanche-ledger-go v0.0.13/go.mod h1:LolCV2cdtkD67V/BSfy/ELUqleG1sbVyNdo5qe1u4y4= +github.com/ava-labs/coreth v0.11.5-0.20221213204439-7bd1eeaeaa9c h1:UtdPfozh/MU9QyFn9oilBPbBD73LKT2nVmP9XtvR/Zs= +github.com/ava-labs/coreth v0.11.5-0.20221213204439-7bd1eeaeaa9c/go.mod h1:S9aBkLc9fSakUVV5HQgaivqs+xgbpWnCy3ZyQxt9A50= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= 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= @@ -69,10 +77,32 @@ 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/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -97,19 +127,25 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/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= @@ -181,6 +217,8 @@ github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M= 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= @@ -224,6 +262,8 @@ 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= @@ -314,10 +354,18 @@ 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.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= 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= @@ -331,8 +379,13 @@ 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= @@ -403,13 +456,17 @@ 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.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= +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= @@ -484,9 +541,12 @@ 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= @@ -505,6 +565,7 @@ github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969/go.mod h1:RZL 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.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -546,6 +607,11 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266 h1:O9XLFXGkVswDFmH9LaYpqu+r/AAFWqr0DL6V00KEVFg= +github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.13.0 h1:3brWtvAlfKqpe27JSUC/t1f0CvVVOX8zR/f/3+ShPBY= +github.com/zondax/ledger-go v0.13.0/go.mod h1:KatxXrVDzgWwbssUWsF5+cOJHXPvzQ09YSlzGNuhOEo= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -580,6 +646,7 @@ 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.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= +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= @@ -632,6 +699,7 @@ 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= @@ -661,6 +729,7 @@ 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= @@ -739,10 +808,12 @@ 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= @@ -754,6 +825,7 @@ 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= @@ -1006,5 +1078,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/scripts/run_ginkgo.sh b/scripts/run_ginkgo.sh new file mode 100755 index 0000000000..9091edf4e6 --- /dev/null +++ b/scripts/run_ginkgo.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -e + +# Load the versions +SUBNET_EVM_PATH=$( + cd "$(dirname "${BASH_SOURCE[0]}")" + cd .. && pwd +) + +source "$SUBNET_EVM_PATH"/scripts/versions.sh + +run_ginkgo() { + echo "building e2e.test" + # to install the ginkgo binary (required for test build and run) + go install -v github.com/onsi/ginkgo/v2/ginkgo@${ginkgo_version} + + ACK_GINKGO_RC=true ginkgo build ./tests/e2e + + # By default, it runs all e2e test cases! + # Use "--ginkgo.skip" to skip tests. + # Use "--ginkgo.focus" to select tests. + ./tests/e2e/e2e.test \ + --ginkgo.vv \ + --ginkgo.label-filter=${GINKGO_LABEL_FILTER:-""} +} + +run_ginkgo \ No newline at end of file diff --git a/scripts/run_single_node.sh b/scripts/run_single_node.sh new file mode 100755 index 0000000000..cce9db624d --- /dev/null +++ b/scripts/run_single_node.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +set -e + +# This script starts a single node running the local network with staking disabled and expects the caller to take care of cleaning up the created AvalancheGo process. +# This script uses the data directory to use node configuration and populate data into a predictable location. +if ! [[ "$0" =~ scripts/run_single_node.sh ]]; then + echo "must be run from repository root, but got $0" + exit 255 +fi + +# Load the versions +SUBNET_EVM_PATH=$( + cd "$(dirname "${BASH_SOURCE[0]}")" + cd .. && pwd +) +source "$SUBNET_EVM_PATH"/scripts/versions.sh + +# Load the constants +source "$SUBNET_EVM_PATH"/scripts/constants.sh + +# Set up avalanche binary path and assume build directory is set +AVALANCHE_BINARY_PATH=${AVALANCHE_BINARY_PATH:-"$GOPATH/src/github.com/ava-labs/avalanchego/build/avalanchego"} +PLUGIN_DIR=${PLUGIN_DIR:-"$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins"} +DATA_DIR=${DATA_DIR:-/tmp/subnet-evm-start-node/$(date "+%Y-%m-%d%:%H:%M:%S")} + +# Create node config in DATA_DIR +echo "creating node config" +mkdir -p $DATA_DIR + cat <$DATA_DIR/config.json +{ + "network-id": "local", + "staking-enabled": false, + "network-health-min-conn-peers": 0, + "network-health-max-time-since-msg-received": 4611686018427387904, + "network-health-max-time-since-msg-sent": 4611686018427387904, + "health-check-frequency": "5s" +} +EOF + +# Run the node +$AVALANCHE_BINARY_PATH --data-dir=$DATA_DIR --config-file=$DATA_DIR/config.json 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 index 7ebe67e567..b0d366b41b 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -12,289 +12,83 @@ import ( "testing" "time" - runner_sdk "github.com/ava-labs/avalanche-network-runner-sdk" - runner_sdk_rpcpb "github.com/ava-labs/avalanche-network-runner-sdk/rpcpb" - "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/avalanchego/api/health" + "github.com/ava-labs/avalanchego/config" "github.com/ava-labs/subnet-evm/tests/e2e/utils" + "github.com/ethereum/go-ethereum/log" + "github.com/go-cmd/cmd" ginkgo "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" - _ "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") -} - -type networkClient struct { - client runner_sdk.Client -} - var ( - networkRunnerLogLevel string - gRPCEp string - gRPCGatewayEp string - // sets the "avalanchego" exec path - avalanchegoExecPath string - avalanchegoPluginDir string - avalanchegoLogLevel string - vmGenesisPath string + avalanchegoExecPath string + dataDir string + configFilePath string + + setupTimeout time.Duration - outputFile string + startCmd *cmd.Cmd - skipNetworkRunnerStart bool - skipNetworkRunnerShutdown bool + defaultConfigJSON = `{ + "network-id": "local", + "staking-enabled": false + }` ) 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", - ) - + // Assumes that the plugin directory will be found in a default location, so we do not set it here. flag.StringVar( &avalanchegoExecPath, "avalanchego-path", - "", + os.ExpandEnv("$GOPATH/src/github.com/ava-labs/avalanchego/build/avalanchego"), "avalanchego executable path", ) flag.StringVar( - &avalanchegoPluginDir, - "avalanchego-plugin-dir", - "", - "avalanchego plugin directory", - ) - flag.StringVar( - &avalanchegoLogLevel, - "avalanchego-log-level", - "info", - "avalanchego log level", + &dataDir, + config.DataDirKey, + fmt.Sprintf("/tmp/subnet-evm-e2e-test/%v", time.Now().Unix()), + "Data directory", ) flag.StringVar( - &vmGenesisPath, - "vm-genesis-path", + &configFilePath, + config.ConfigFileKey, "", - "VM genesis file path", + "Path to specify a config file", ) - 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", + flag.DurationVar( + &setupTimeout, + "setup-timeout", + time.Minute, + "Timeout for setting up the node for the e2e test (timeout for BeforeSuite to complete)", ) } -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) - } +func TestE2E(t *testing.T) { + gomega.RegisterFailHandler(ginkgo.Fail) + ginkgo.RunSpecs(t, "subnet-evm e2e test suites") } -var subnetEVMRPCEps []string - +// BeforeSuite starts an AvalancheGo process to use for the e2e tests var _ = ginkgo.BeforeSuite(func() { - networkClient := createNetworkClient() - - if skipNetworkRunnerStart { - utils.Outf("{{green}}skipped 'start'{{/}}\n") - return - } + ctx, cancel := context.WithTimeout(context.Background(), setupTimeout) + defer cancel() - networkClient.startNetwork() - networkClient.checkHealth() -}) - -func createNetworkClient() *networkClient { - runnerCli, err := runner_sdk.New(runner_sdk.Config{ - LogLevel: networkRunnerLogLevel, - Endpoint: gRPCEp, - DialTimeout: 10 * time.Second, - }) - gomega.Expect(err).Should(gomega.BeNil()) - - utils.SetOutputFile(outputFile) - utils.SetExecPath(avalanchegoExecPath) - utils.SetPluginDir(avalanchegoPluginDir) - utils.SetVmGenesisPath(vmGenesisPath) - utils.SetSkipNetworkRunnerShutdown(skipNetworkRunnerShutdown) - utils.SetClient(runnerCli) - - // Set AVALANCHEGO_PATH for the solidity suite - os.Setenv("AVALANCHEGO_PATH", avalanchegoExecPath) - - return &networkClient{client: runnerCli} -} - -func (n *networkClient) startNetwork() { - utils.Outf("{{green}}sending 'start' with binary path:{{/}} %q\n", utils.GetExecPath()) - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) - resp, err := n.client.Start( - ctx, - utils.GetExecPath(), - runner_sdk.WithPluginDir(utils.GetPluginDir()), - runner_sdk.WithGlobalNodeConfig(fmt.Sprintf(`{"log-level":"%s"}`, avalanchegoLogLevel)), - runner_sdk.WithNumNodes(5), - runner_sdk.WithBlockchainSpecs( - []*runner_sdk_rpcpb.BlockchainSpec{ - { - VmName: vmName, - Genesis: utils.GetVmGenesisPath(), - }, - }, - )) - cancel() - gomega.Expect(err).Should(gomega.BeNil()) - utils.Outf("{{green}}successfully started:{{/}} %+v\n", resp.ClusterInfo.NodeNames) -} - -func (n *networkClient) checkHealth() { - // 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 - utils.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 := n.client.Health(ctx) - cancel() - gomega.Expect(err).Should(gomega.BeNil()) - - subnetEVMRPCEps = make([]string, 0) - blockchainID, logsDir := "", "" - pid := 0 - - // wait up to 5-minute for custom VM installation - utils.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): - } - - utils.Outf("{{magenta}}checking custom VM status{{/}}\n") - cctx, ccancel := context.WithTimeout(context.Background(), 2*time.Minute) - resp, err := n.client.Status(cctx) - ccancel() - gomega.Expect(err).Should(gomega.BeNil()) - - // all logs are stored under root data dir - logsDir = resp.GetClusterInfo().GetRootDataDir() - - // ANR server pid - pid = int(resp.GetClusterInfo().GetPid()) - - for blkChainID, vmInfo := range resp.ClusterInfo.CustomChains { - if vmInfo.VmId == vmID.String() { - blockchainID = blkChainID - utils.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 := n.client.URIs(cctx) - ccancel() + var err error + log.Info("Starting AvalancheGo node") + startCmd, err = utils.RunCommand("./scripts/run_single_node.sh") gomega.Expect(err).Should(gomega.BeNil()) - utils.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) - utils.Outf("{{blue}}avalanche subnet-evm RPC:{{/}} %q\n", rpcEP) - } - - utils.Outf("{{blue}}{{bold}}writing output %q with PID %d{{/}}\n", utils.GetOutputPath(), pid) - ci := utils.ClusterInfo{ - URIs: uris, - Endpoint: fmt.Sprintf("/ext/bc/%s", blockchainID), - PID: pid, - LogsDir: logsDir, - SubnetEVMRPCEndpoints: subnetEVMRPCEps, - } - utils.SetClusterInfo(ci) - gomega.Expect(ci.Save(utils.GetOutputPath())).Should(gomega.BeNil()) - - b, err := os.ReadFile(utils.GetOutputPath()) + healthClient := health.NewClient(utils.DefaultLocalNodeURI) + healthy, err := healthClient.AwaitReady(ctx, 5*time.Second) gomega.Expect(err).Should(gomega.BeNil()) - utils.Outf("\n{{blue}}$ cat %s:{{/}}\n%s\n", utils.GetOutputPath(), string(b)) -} + gomega.Expect(healthy).Should(gomega.BeTrue()) + log.Info("AvalancheGo node is healthy") +}) var _ = ginkgo.AfterSuite(func() { - if utils.GetSkipNetworkRunnerShutdown() { - return - } - - // if cluster is running, shut it down - if isRunnerUp() { - gomega.Expect(stopNetwork()).Should(gomega.BeNil()) - } - gomega.Expect(closeClient()).Should(gomega.BeNil()) + gomega.Expect(startCmd).ShouldNot(gomega.BeNil()) + gomega.Expect(startCmd.Stop()).Should(gomega.BeNil()) }) - -func isRunnerUp() bool { - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - _, err := utils.GetClient().Health(ctx) - cancel() - return err == nil -} - -func stopNetwork() error { - utils.Outf("{{red}}shutting down network{{/}}\n") - ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) - _, err := utils.GetClient().Stop(ctx) - cancel() - return err -} - -func closeClient() error { - utils.Outf("{{red}}shutting down client{{/}}\n") - return utils.GetClient().Close() -} diff --git a/tests/e2e/ping/suites.go b/tests/e2e/ping/suites.go deleted file mode 100644 index 62cd7a6e61..0000000000 --- a/tests/e2e/ping/suites.go +++ /dev/null @@ -1,27 +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/utils" - - ginkgo "github.com/onsi/ginkgo/v2" - "github.com/onsi/gomega" -) - -var _ = utils.DescribeLocal("[Ping]", func() { - ginkgo.It("can ping network-runner RPC server", ginkgo.Label("ping"), func() { - runnerCli := utils.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 377814b71d..0000000000 --- a/tests/e2e/runner/runner.go +++ /dev/null @@ -1,226 +0,0 @@ -package runner - -import ( - "context" - "errors" - "fmt" - "os" - "time" - - client "github.com/ava-labs/avalanche-network-runner-sdk" - "github.com/ava-labs/avalanche-network-runner-sdk/rpcpb" - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/subnet-evm/tests/e2e/utils" - - "sigs.k8s.io/yaml" -) - -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 startRunner(grpcEp string, execPath string, vmName string, genesisPath string, pluginDir string) error { - cli, err := client.New(client.Config{ - LogLevel: "info", - Endpoint: grpcEp, - DialTimeout: 10 * time.Second, - }) - if err != nil { - return err - } - - utils.Outf("{{green}}tests/e2e/runner 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 - } - utils.Outf("{{green}}successfully started:{{/}} %+v\n", resp.ClusterInfo.NodeNames) - return nil -} - -func WaitForCustomVm(grpcEp string, vmId ids.ID) (string, string, int, error) { - cli, err := client.New(client.Config{ - LogLevel: "info", - Endpoint: grpcEp, - DialTimeout: 10 * time.Second, - }) - if err != nil { - return "", "", 0, err - } - - blockchainID, logsDir := "", "" - pid := 0 - - // 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): - } - - utils.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 "", "", 0, err - } - - if !resp.ClusterInfo.Healthy { - continue - } - - if !resp.ClusterInfo.CustomChainsHealthy { - continue - } - - // all logs are stored under root data dir - logsDir = resp.GetClusterInfo().GetRootDataDir() - - // ANR server pid - pid = int(resp.GetClusterInfo().GetPid()) - - for chainID, chainInfo := range resp.ClusterInfo.CustomChains { - if chainInfo.VmId == vmId.String() { - blockchainID = chainID - utils.Outf("{{blue}}subnet-evm is ready:{{/}} %+v\n", chainInfo) - break done - } - } - } - err = ctx.Err() - if err != nil { - cancel() - return "", "", 0, err - } - cancel() - - if blockchainID == "" { - return "", "", 0, errors.New("BlockchainId not found") - } - if logsDir == "" { - return "", "", 0, errors.New("logsDir not found") - } - if pid == 0 { - return "", "", pid, errors.New("pid not found") - } - return blockchainID, logsDir, pid, nil -} - -func SaveClusterInfo(grpcEp string, blockchainId string, logsDir string, pid int) (clusterInfo, error) { - cli, err := client.New(client.Config{ - LogLevel: "info", - Endpoint: grpcEp, - DialTimeout: 10 * time.Second, - }) - if err != nil { - return clusterInfo{}, err - } - - cctx, ccancel := context.WithTimeout(context.Background(), 2*time.Minute) - uris, err := cli.URIs(cctx) - ccancel() - if err != nil { - return clusterInfo{}, err - } - utils.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) - utils.Outf("{{blue}}avalanche subnet-evm RPC:{{/}} %q\n", rpcEP) - } - - 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(grpcEp string, execPath string, vmId ids.ID, vmName string, genesisPath string, pluginDir string) (clusterInfo, error) { - fmt.Println("Starting network") - startRunner(grpcEp, execPath, vmName, genesisPath, pluginDir) - - blockchainId, logsDir, pid, err := WaitForCustomVm(grpcEp, vmId) - if err != nil { - return clusterInfo{}, err - } - fmt.Println("Got custom vm") - - return SaveClusterInfo(grpcEp, blockchainId, logsDir, pid) -} - -func StopNetwork(grpcEp string) error { - cli, err := client.New(client.Config{ - LogLevel: "info", - Endpoint: grpcEp, - DialTimeout: 10 * time.Second, - }) - if err != nil { - return err - } - - utils.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 { - utils.Outf("{{red}}shutting down client{{/}}\n") - return nil -} - -func IsRunnerUp(grpcEp string) bool { - cli, err := client.New(client.Config{ - LogLevel: "info", - Endpoint: grpcEp, - DialTimeout: 10 * time.Second, - }) - if err != nil { - return false - } - - 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 index 0d641112ff..2f68ebd53f 100644 --- a/tests/e2e/solidity/suites.go +++ b/tests/e2e/solidity/suites.go @@ -5,103 +5,174 @@ package solidity import ( + "context" "fmt" "os" - "os/exec" + "strings" + "time" + "github.com/ava-labs/avalanchego/api/health" + "github.com/ava-labs/avalanchego/genesis" + "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/avalanchego/vms/secp256k1fx" + wallet "github.com/ava-labs/avalanchego/wallet/subnet/primary" "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" - + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" ginkgo "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" ) -const vmName = "subnetevm" +var localURI = "http://127.0.0.1:9650" -// network-runner-grpc-endpoint from run script -const grpcEp = "0.0.0.0:12342" +var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { + ginkgo.It("ping the network", ginkgo.Label("setup"), func() { + client := health.NewClient(localURI) + healthy, err := client.Readiness(context.Background()) + gomega.Expect(err).Should(gomega.BeNil()) + gomega.Expect(healthy.Healthy).Should(gomega.BeTrue()) + }) +}) -func runHardhatTests(test string) { - cmd := exec.Command("npx", "hardhat", "test", test, "--network", "e2e") - cmd.Dir = "./contract-examples" - out, err := cmd.Output() - if err != nil { - fmt.Println(string(out)) - fmt.Println(err) - } +func runHardhatTests(test string, rpcURI string) { + log.Info("Sleeping to wait for test ping", "rpcURI", rpcURI) + time.Sleep(time.Minute) + client, err := utils.NewEvmClient(rpcURI, 225, 2) // TODO this is failing because the Avalanche engine does not start bootstrapping of subnets when staking is disabled 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 { - fmt.Println("AVALANCHEGO_PATH:", os.Getenv("AVALANCHEGO_PATH")) - _, err := runner.StartNetwork(grpcEp, os.Getenv("AVALANCHEGO_PATH"), evm.ID, vmName, genesisPath, utils.GetPluginDir()) + bal, err := client.FetchBalance(context.Background(), common.HexToAddress("")) gomega.Expect(err).Should(gomega.BeNil()) - return utils.UpdateHardhatConfig() + gomega.Expect(bal).Should(gomega.Equal(common.Big0)) + + // err := os.Setenv("RPC_URI", rpcURI) + // gomega.Expect(err).Should(gomega.BeNil()) + + // utils.RunCommand(fmt.Sprintf("npx hardhat test %s", "--network=local")) + // cmd := exec.Command("npx", "hardhat", "test", test, "--network", "local") + // cmd.Env = append(cmd.Env, fmt.Sprintf("RPC_URI=%s", rpcURI)) + // cmd.Dir = "./contract-examples" + // out, err := cmd.Output() + // if err != nil { + // fmt.Println(string(out)) + // fmt.Println(err) + // } + // gomega.Expect(err).Should(gomega.BeNil()) } -// stopSubnet stops the test network. -func stopSubnet() { - err := runner.StopNetwork(grpcEp) +func executeHardHatTestOnNewBlockchain(ctx context.Context, test string) { + log.Info("Executing HardHat tests on a new blockchain", "test", test) + kc := secp256k1fx.NewKeychain(genesis.EWOQKey) + + // NewWalletFromURI fetches the available UTXOs owned by [kc] on the network + // that [LocalAPIURI] is hosting. + wallet, err := wallet.NewWalletFromURI(ctx, utils.DefaultLocalNodeURI, kc) + gomega.Expect(err).Should(gomega.BeNil()) + + pWallet := wallet.P() + + owner := &secp256k1fx.OutputOwners{ + Threshold: 1, + Addrs: []ids.ShortID{ + genesis.EWOQKey.PublicKey().Address(), + }, + } + + wd, err := os.Getwd() + gomega.Expect(err).Should(gomega.BeNil()) + genesisFilePath := fmt.Sprintf("./tests/e2e/genesis/%s.json", test) + log.Info("Reading genesis file", "filePath", genesisFilePath, "pwd", wd) + genesisBytes, err := os.ReadFile(genesisFilePath) + gomega.Expect(err).Should(gomega.BeNil()) + + log.Info("Creating new subnet") + createSubnetTxID, err := pWallet.IssueCreateSubnetTx(owner) gomega.Expect(err).Should(gomega.BeNil()) + + log.Info("Creating new blockchain", "genesis", genesisBytes) + createChainTx, err := pWallet.IssueCreateChainTx( + createSubnetTxID, + genesisBytes, + evm.ID, + nil, + strings.ReplaceAll(test, "_", ""), + ) + gomega.Expect(err).Should(gomega.BeNil()) + + // Confirm the new blockchain is ready by waiting for the readiness endpoint + healthClient := health.NewClient(utils.DefaultLocalNodeURI) + healthy, err := healthClient.AwaitReady(ctx, 5*time.Second) + gomega.Expect(err).Should(gomega.BeNil()) + gomega.Expect(healthy).Should(gomega.BeTrue()) + + // Confirm the new blockchain is up + chainURI := fmt.Sprintf("%s/ext/bc/%s/rpc", utils.DefaultLocalNodeURI, createChainTx.String()) + + runHardhatTests(test, chainURI) } -var _ = utils.DescribePrecompile(func() { - ginkgo.It("tx allow list", ginkgo.Label("solidity-with-npx"), func() { - err := startSubnet("./tests/e2e/genesis/tx_allow_list.json") - gomega.Expect(err).Should(gomega.BeNil()) - running := runner.IsRunnerUp(grpcEp) - gomega.Expect(running).Should(gomega.BeTrue()) - runHardhatTests("./test/ExampleTxAllowList.ts") - stopSubnet() - running = runner.IsRunnerUp(grpcEp) - gomega.Expect(running).Should(gomega.BeFalse()) - }) +var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { + ginkgo.It("create blockchain", ginkgo.Label("test"), func() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() - ginkgo.It("deployer allow list", ginkgo.Label("solidity-with-npx"), func() { - err := startSubnet("./tests/e2e/genesis/deployer_allow_list.json") - gomega.Expect(err).Should(gomega.BeNil()) - running := runner.IsRunnerUp(grpcEp) - gomega.Expect(running).Should(gomega.BeTrue()) - runHardhatTests("./test/ExampleDeployerList.ts") - stopSubnet() - running = runner.IsRunnerUp(grpcEp) - gomega.Expect(running).Should(gomega.BeFalse()) + executeHardHatTestOnNewBlockchain(ctx, "contract_native_minter") }) - ginkgo.It("contract native minter", ginkgo.Label("solidity-with-npx"), func() { - err := startSubnet("./tests/e2e/genesis/contract_native_minter.json") - gomega.Expect(err).Should(gomega.BeNil()) - running := runner.IsRunnerUp(grpcEp) - gomega.Expect(running).Should(gomega.BeTrue()) - runHardhatTests("./test/ERC20NativeMinter.ts") - stopSubnet() - running = runner.IsRunnerUp(grpcEp) - gomega.Expect(running).Should(gomega.BeFalse()) - }) + // ginkgo.It("tx allow list", ginkgo.Label("solidity-with-npx"), func() { + // err := startSubnet("./tests/e2e/genesis/tx_allow_list.json") + // gomega.Expect(err).Should(gomega.BeNil()) + // running := runner.IsRunnerUp(grpcEp) + // gomega.Expect(running).Should(gomega.BeTrue()) + // runHardhatTests("./test/ExampleTxAllowList.ts") + // stopSubnet() + // running = runner.IsRunnerUp(grpcEp) + // gomega.Expect(running).Should(gomega.BeFalse()) + // }) - ginkgo.It("fee manager", ginkgo.Label("solidity-with-npx"), func() { - err := startSubnet("./tests/e2e/genesis/fee_manager.json") - gomega.Expect(err).Should(gomega.BeNil()) - running := runner.IsRunnerUp(grpcEp) - gomega.Expect(running).Should(gomega.BeTrue()) - runHardhatTests("./test/ExampleFeeManager.ts") - stopSubnet() - running = runner.IsRunnerUp(grpcEp) - gomega.Expect(running).Should(gomega.BeFalse()) - }) + // ginkgo.It("deployer allow list", ginkgo.Label("solidity-with-npx"), func() { + // err := startSubnet("./tests/e2e/genesis/deployer_allow_list.json") + // gomega.Expect(err).Should(gomega.BeNil()) + // running := runner.IsRunnerUp(grpcEp) + // gomega.Expect(running).Should(gomega.BeTrue()) + // runHardhatTests("./test/ExampleDeployerList.ts") + // stopSubnet() + // running = runner.IsRunnerUp(grpcEp) + // gomega.Expect(running).Should(gomega.BeFalse()) + // }) - ginkgo.It("reward manager", ginkgo.Label("solidity-with-npx"), func() { - err := startSubnet("./tests/e2e/genesis/reward_manager.json") - gomega.Expect(err).Should(gomega.BeNil()) - running := runner.IsRunnerUp(grpcEp) - gomega.Expect(running).Should(gomega.BeTrue()) - runHardhatTests("./test/ExampleRewardManager.ts") - stopSubnet() - running = runner.IsRunnerUp(grpcEp) - gomega.Expect(running).Should(gomega.BeFalse()) - }) + // ginkgo.It("contract native minter", ginkgo.Label("solidity-with-npx"), func() { + // err := startSubnet("./tests/e2e/genesis/contract_native_minter.json") + // gomega.Expect(err).Should(gomega.BeNil()) + // running := runner.IsRunnerUp(grpcEp) + // gomega.Expect(running).Should(gomega.BeTrue()) + // runHardhatTests("./test/ERC20NativeMinter.ts") + // stopSubnet() + // running = runner.IsRunnerUp(grpcEp) + // gomega.Expect(running).Should(gomega.BeFalse()) + // }) + + // ginkgo.It("fee manager", ginkgo.Label("solidity-with-npx"), func() { + // err := startSubnet("./tests/e2e/genesis/fee_manager.json") + // gomega.Expect(err).Should(gomega.BeNil()) + // running := runner.IsRunnerUp(grpcEp) + // gomega.Expect(running).Should(gomega.BeTrue()) + // runHardhatTests("./test/ExampleFeeManager.ts") + // stopSubnet() + // running = runner.IsRunnerUp(grpcEp) + // gomega.Expect(running).Should(gomega.BeFalse()) + // }) + + // ginkgo.It("reward manager", ginkgo.Label("solidity-with-npx"), func() { + // err := startSubnet("./tests/e2e/genesis/reward_manager.json") + // gomega.Expect(err).Should(gomega.BeNil()) + // running := runner.IsRunnerUp(grpcEp) + // gomega.Expect(running).Should(gomega.BeTrue()) + // runHardhatTests("./test/ExampleRewardManager.ts") + // stopSubnet() + // running = runner.IsRunnerUp(grpcEp) + // gomega.Expect(running).Should(gomega.BeFalse()) + // }) // ADD YOUR PRECOMPILE HERE /* diff --git a/tests/e2e/utils/command.go b/tests/e2e/utils/command.go index 4f6cb6fcf5..747fe69655 100644 --- a/tests/e2e/utils/command.go +++ b/tests/e2e/utils/command.go @@ -4,19 +4,20 @@ package utils import ( - "context" "fmt" "strings" "time" + "github.com/ethereum/go-ethereum/log" "github.com/go-cmd/cmd" ) -func RunCommand(ctx context.Context, bin string, args ...string) (cmd.Status, error) { - Outf("{{green}}running '%s %s'{{/}}\n", bin, strings.Join(args, " ")) +// RunCommand starts the command [bin] with the given [args] and returns the command to the caller +func RunCommand(bin string, args ...string) (*cmd.Cmd, error) { + log.Info("Executing", "cmd", fmt.Sprintf("%s %s", bin, strings.Join(args, " "))) curCmd := cmd.NewCmd(bin, args...) - statusChan := curCmd.Start() + _ = curCmd.Start() // to stream outputs ticker := time.NewTicker(10 * time.Millisecond) @@ -38,11 +39,5 @@ func RunCommand(ctx context.Context, bin string, args ...string) (cmd.Status, er } }() - select { - case s := <-statusChan: - return s, nil - case <-ctx.Done(): - curCmd.Stop() - return cmd.Status{}, ctx.Err() - } + return curCmd, nil } diff --git a/tests/e2e/utils/constants.go b/tests/e2e/utils/constants.go new file mode 100644 index 0000000000..55b526edd7 --- /dev/null +++ b/tests/e2e/utils/constants.go @@ -0,0 +1,8 @@ +// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package utils + +var ( + DefaultLocalNodeURI = "http://127.0.0.1:9650" +) 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/evm_client.go b/tests/e2e/utils/evm_client.go index 65dbe1785f..8017aac1f5 100644 --- a/tests/e2e/utils/evm_client.go +++ b/tests/e2e/utils/evm_client.go @@ -9,13 +9,11 @@ import ( "fmt" "log" "math/big" - "strings" "time" "github.com/ava-labs/subnet-evm/core/types" "github.com/ava-labs/subnet-evm/ethclient" "github.com/ava-labs/subnet-evm/params" - "github.com/ava-labs/subnet-evm/precompile" "github.com/ethereum/go-ethereum/common" ) @@ -38,8 +36,9 @@ func NewEvmClient(ep string, baseFee uint64, priorityFee uint64) (*EvmClient, er } ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + chainID, err := ethCli.ChainID(ctx) - cancel() if err != nil { return nil, err } @@ -113,6 +112,7 @@ func (ec *EvmClient) ConfirmTx(ctx context.Context, txHash common.Hash) (*big.In time.Sleep(time.Second) continue } + // XXX: this uses gas instead of gas used, so it may be incorrect if the transaction does more than a simple transfer return result.Cost(), nil } return nil, ctx.Err() @@ -128,18 +128,14 @@ func (ec *EvmClient) TransferTx( for ctx.Err() == nil { senderBal, err := ec.FetchBalance(ctx, sender) if err != nil { - log.Printf("could not get balance: %s", err.Error()) - time.Sleep(time.Second) - continue + return nil, fmt.Errorf("failed to fetch balance: %w", err) } if senderBal.Cmp(transferAmount) < 0 { return nil, fmt.Errorf("not enough balance %s to transfer %s", senderBal, transferAmount) } - cctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) - nonce, err := ec.FetchNonce(cctx, sender) - cancel() + nonce, err := ec.FetchNonce(ctx, sender) if err != nil { return nil, err } @@ -153,34 +149,23 @@ func (ec *EvmClient) TransferTx( GasFeeCap: ec.feeCap, GasTipCap: ec.priorityFee, Value: transferAmount, - Data: []byte{}, }), ec.signer, senderPriv, ) if err != nil { - log.Printf("failed to sign transaction: %v (key address %s)", err, sender) - time.Sleep(time.Second) - continue + return nil, fmt.Errorf("failed to sign transaction: %w", err) } if err := ec.ethClient.SendTransaction(ctx, signedTx); err != nil { log.Printf("failed to send transaction: %v (key address %s)", err, sender) - - if strings.Contains(err.Error(), precompile.ErrSenderAddressNotAllowListed.Error()) { - return nil, err - } - - time.Sleep(time.Second) - continue + return nil, err } txHash := signedTx.Hash() cost, err := ec.ConfirmTx(ctx, txHash) if err != nil { - log.Printf("failed to confirm %s: %v", txHash.Hex(), err) - time.Sleep(time.Second) - continue + return nil, err } senderBal = new(big.Int).Sub(senderBal, cost) diff --git a/tests/e2e/utils/out.go b/tests/e2e/utils/out.go deleted file mode 100644 index df718c40bc..0000000000 --- a/tests/e2e/utils/out.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package utils - -import ( - "fmt" - - "github.com/onsi/ginkgo/v2/formatter" -) - -// Outputs to stdout. -// -// e.g., -// Outf("{{green}}{{bold}}hi there %q{{/}}", "aa") -// Outf("{{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) -} diff --git a/tests/e2e/utils/params.go b/tests/e2e/utils/params.go deleted file mode 100644 index 1a2b935c18..0000000000 --- a/tests/e2e/utils/params.go +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package utils - -import ( - "os" - "sync" - - runner_sdk "github.com/ava-labs/avalanche-network-runner-sdk" - - "gopkg.in/yaml.v2" -) - -// 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"` - SubnetEVMRPCEndpoints []string `json:"subnetEVMRPCEndpoints"` -} - -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) -} - -var ( - mu sync.RWMutex - - cli runner_sdk.Client - - outputFile string - pluginDir string - - // executable path for "avalanchego" - execPath string - vmGenesisPath string - - skipNetworkRunnerShutdown bool - - clusterInfo ClusterInfo -) - -func SetClient(c runner_sdk.Client) { - mu.Lock() - cli = c - mu.Unlock() -} - -func GetClient() runner_sdk.Client { - mu.RLock() - c := cli - mu.RUnlock() - return c -} - -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 SetSkipNetworkRunnerShutdown(b bool) { - mu.Lock() - skipNetworkRunnerShutdown = b - mu.Unlock() -} - -func GetSkipNetworkRunnerShutdown() bool { - mu.RLock() - b := skipNetworkRunnerShutdown - mu.RUnlock() - return b -} - -func SetClusterInfo(c ClusterInfo) { - mu.Lock() - clusterInfo = c - mu.Unlock() -} - -func GetClusterInfo() ClusterInfo { - mu.RLock() - c := clusterInfo - mu.RUnlock() - return c -} diff --git a/tests/e2e/utils/parser.go b/tests/e2e/utils/parser.go deleted file mode 100644 index 103114b8a8..0000000000 --- a/tests/e2e/utils/parser.go +++ /dev/null @@ -1,80 +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" - LOCAL_RPC_FILE = "contract-examples/local_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) - if err != nil { - return err - } - err = ioutil.WriteFile(LOCAL_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 -} From e8dbae2556da61ea624a1e95538945efff37f62a Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 14 Dec 2022 18:31:25 -0500 Subject: [PATCH 02/55] Add TODOs --- tests/e2e/e2e_test.go | 1 + tests/e2e/solidity/suites.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index b0d366b41b..9f63206690 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -89,6 +89,7 @@ var _ = ginkgo.BeforeSuite(func() { }) var _ = ginkgo.AfterSuite(func() { + // TODO add a new node to bootstrap off of the existing node and make sure we can bootstrap all of the data created in the test. gomega.Expect(startCmd).ShouldNot(gomega.BeNil()) gomega.Expect(startCmd.Stop()).Should(gomega.BeNil()) }) diff --git a/tests/e2e/solidity/suites.go b/tests/e2e/solidity/suites.go index 2f68ebd53f..cef1dc4754 100644 --- a/tests/e2e/solidity/suites.go +++ b/tests/e2e/solidity/suites.go @@ -26,6 +26,8 @@ import ( var localURI = "http://127.0.0.1:9650" +// TODO add general and configurable load test that can be run as a binary on an arbitrary N nodes and given blockchainID + var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { ginkgo.It("ping the network", ginkgo.Label("setup"), func() { client := health.NewClient(localURI) @@ -45,6 +47,7 @@ func runHardhatTests(test string, rpcURI string) { gomega.Expect(err).Should(gomega.BeNil()) gomega.Expect(bal).Should(gomega.Equal(common.Big0)) + // TODO fix this to run hardhat tests on a network // err := os.Setenv("RPC_URI", rpcURI) // gomega.Expect(err).Should(gomega.BeNil()) @@ -119,6 +122,8 @@ var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { executeHardHatTestOnNewBlockchain(ctx, "contract_native_minter") }) + // TODO: uncomment the rest of the precompile e2e tests + // TODO: can we move where we register the precompile e2e tests, so that they stay within their package // ginkgo.It("tx allow list", ginkgo.Label("solidity-with-npx"), func() { // err := startSubnet("./tests/e2e/genesis/tx_allow_list.json") // gomega.Expect(err).Should(gomega.BeNil()) From 6a8e7ca328425f70bb9e71181de0aeed495b6b48 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 15 Dec 2022 16:56:31 -0500 Subject: [PATCH 03/55] WIP --- tests/e2e/e2e_test.go | 2 +- tests/e2e/solidity/suites.go | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index 9f63206690..91ca58f08b 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -82,7 +82,7 @@ var _ = ginkgo.BeforeSuite(func() { startCmd, err = utils.RunCommand("./scripts/run_single_node.sh") gomega.Expect(err).Should(gomega.BeNil()) healthClient := health.NewClient(utils.DefaultLocalNodeURI) - healthy, err := healthClient.AwaitReady(ctx, 5*time.Second) + healthy, err := health.AwaitReady(ctx, healthClient, 5*time.Second) gomega.Expect(err).Should(gomega.BeNil()) gomega.Expect(healthy).Should(gomega.BeTrue()) log.Info("AvalancheGo node is healthy") diff --git a/tests/e2e/solidity/suites.go b/tests/e2e/solidity/suites.go index cef1dc4754..8e08231685 100644 --- a/tests/e2e/solidity/suites.go +++ b/tests/e2e/solidity/suites.go @@ -12,6 +12,7 @@ import ( "time" "github.com/ava-labs/avalanchego/api/health" + "github.com/ava-labs/avalanchego/api/info" "github.com/ava-labs/avalanchego/genesis" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/vms/secp256k1fx" @@ -93,7 +94,7 @@ func executeHardHatTestOnNewBlockchain(ctx context.Context, test string) { gomega.Expect(err).Should(gomega.BeNil()) log.Info("Creating new blockchain", "genesis", genesisBytes) - createChainTx, err := pWallet.IssueCreateChainTx( + createChainTxID, err := pWallet.IssueCreateChainTx( createSubnetTxID, genesisBytes, evm.ID, @@ -103,13 +104,13 @@ func executeHardHatTestOnNewBlockchain(ctx context.Context, test string) { gomega.Expect(err).Should(gomega.BeNil()) // Confirm the new blockchain is ready by waiting for the readiness endpoint - healthClient := health.NewClient(utils.DefaultLocalNodeURI) - healthy, err := healthClient.AwaitReady(ctx, 5*time.Second) + infoClient := info.NewClient(utils.DefaultLocalNodeURI) + bootstrapped, err := info.AwaitBootstrapped(ctx, infoClient, createChainTxID.String(), 5*time.Second) gomega.Expect(err).Should(gomega.BeNil()) - gomega.Expect(healthy).Should(gomega.BeTrue()) + gomega.Expect(bootstrapped).Should(gomega.BeTrue()) // Confirm the new blockchain is up - chainURI := fmt.Sprintf("%s/ext/bc/%s/rpc", utils.DefaultLocalNodeURI, createChainTx.String()) + chainURI := fmt.Sprintf("%s/ext/bc/%s/rpc", utils.DefaultLocalNodeURI, createChainTxID.String()) runHardhatTests(test, chainURI) } From f3f499832db229f9bc5609419dfb9bec2d573cc8 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Fri, 16 Dec 2022 09:46:05 -0500 Subject: [PATCH 04/55] Replace GetSubnetIDF --- plugin/evm/vm_test.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/plugin/evm/vm_test.go b/plugin/evm/vm_test.go index 839d0e7647..d69dff5772 100644 --- a/plugin/evm/vm_test.go +++ b/plugin/evm/vm_test.go @@ -35,13 +35,14 @@ import ( "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/choices" "github.com/ava-labs/avalanchego/snow/consensus/snowman" + "github.com/ava-labs/avalanchego/snow/validators" + avalancheConstants "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/avalanchego/utils/formatting" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/components/chain" engCommon "github.com/ava-labs/avalanchego/snow/engine/common" - avaConstants "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/subnet-evm/consensus/dummy" "github.com/ava-labs/subnet-evm/constants" @@ -119,11 +120,17 @@ func NewContext() *snow.Context { _ = aliaser.Alias(testCChainID, testCChainID.String()) _ = aliaser.Alias(testXChainID, "X") _ = aliaser.Alias(testXChainID, testXChainID.String()) - ctx.SNLookup = &snLookup{ - chainsToSubnet: map[ids.ID]ids.ID{ - avaConstants.PlatformChainID: avaConstants.PrimaryNetworkID, - testXChainID: avaConstants.PrimaryNetworkID, - testCChainID: avaConstants.PrimaryNetworkID, + ctx.ValidatorState = &validators.TestState{ + GetSubnetIDF: func(_ context.Context, chainID ids.ID) (ids.ID, error) { + subnetID, ok := map[ids.ID]ids.ID{ + avalancheConstants.PlatformChainID: avalancheConstants.PrimaryNetworkID, + testXChainID: avalancheConstants.PrimaryNetworkID, + testCChainID: avalancheConstants.PrimaryNetworkID, + }[chainID] + if !ok { + return ids.Empty, errors.New("unknown chain") + } + return subnetID, nil }, } return ctx From 8a4ed7f9188ac50d9fdba39fc2655a0254bf9b23 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 4 Jan 2023 09:14:10 -0500 Subject: [PATCH 05/55] Bump avalanchego to v1.9.6-rc.0 --- go.mod | 20 ++++---------------- go.sum | 32 +++++++++++--------------------- scripts/versions.sh | 2 +- 3 files changed, 16 insertions(+), 38 deletions(-) diff --git a/go.mod b/go.mod index 777a4470ab..817c811827 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/VictoriaMetrics/fastcache v1.10.0 - github.com/ava-labs/avalanchego v1.9.5-rc.0 + github.com/ava-labs/avalanchego v1.9.6-rc.0 github.com/cespare/cp v0.1.0 github.com/davecgh/go-spew v1.1.1 github.com/deckarep/golang-set v1.8.0 @@ -49,25 +49,16 @@ require ( github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect 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/avalanche-ledger-go v0.0.13 // indirect - github.com/ava-labs/coreth v0.11.5-0.20221213204439-7bd1eeaeaa9c // indirect + github.com/ava-labs/coreth v0.11.5 // 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/btcsuite/btcd/btcutil v1.1.3 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // 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 @@ -96,10 +87,7 @@ require ( 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/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 @@ -141,7 +129,7 @@ require ( go.opentelemetry.io/proto/otlp v0.19.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect - go.uber.org/zap v1.23.0 // indirect + go.uber.org/zap v1.24.0 // indirect golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5 // indirect golang.org/x/net v0.1.0 // indirect golang.org/x/term v0.1.0 // indirect diff --git a/go.sum b/go.sum index 356f4d7496..1476271f86 100644 --- a/go.sum +++ b/go.sum @@ -53,7 +53,6 @@ github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMo 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= @@ -68,8 +67,8 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/ava-labs/avalanche-ledger-go v0.0.13 h1:YTdaSuaZS/1ct1RGirBEJeo2tiSfVeJGaE12XtUSGnE= github.com/ava-labs/avalanche-ledger-go v0.0.13/go.mod h1:LolCV2cdtkD67V/BSfy/ELUqleG1sbVyNdo5qe1u4y4= -github.com/ava-labs/coreth v0.11.5-0.20221213204439-7bd1eeaeaa9c h1:UtdPfozh/MU9QyFn9oilBPbBD73LKT2nVmP9XtvR/Zs= -github.com/ava-labs/coreth v0.11.5-0.20221213204439-7bd1eeaeaa9c/go.mod h1:S9aBkLc9fSakUVV5HQgaivqs+xgbpWnCy3ZyQxt9A50= +github.com/ava-labs/coreth v0.11.5 h1:/FklgdJuaezIE3lOWCvTwOUQrJv1OYuYbx3zujvSCqo= +github.com/ava-labs/coreth v0.11.5/go.mod h1:4pelpPFzz3/M008s1WrpyQP4TLPdu2lw8ZyAVcttzJs= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= 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= @@ -79,29 +78,27 @@ github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+Wji 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.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= 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.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= +github.com/btcsuite/btcd/btcec/v2 v2.1.3/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/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= +github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= +github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= 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/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= @@ -144,8 +141,6 @@ github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200627015759-01fd2de07837/go. 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= @@ -360,11 +355,8 @@ github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7Bd 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.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= 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= @@ -384,8 +376,6 @@ github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALr 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= @@ -582,6 +572,7 @@ github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= github.com/supranational/blst v0.3.11-0.20220920110316-f72618070295 h1:rVKS9JjtqE4/PscoIsP46sRnJhfq8YFbjlk0fUJTRnY= github.com/supranational/blst v0.3.11-0.20220920110316-f72618070295/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI= github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= @@ -644,8 +635,8 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= -go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= 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= @@ -825,7 +816,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= diff --git a/scripts/versions.sh b/scripts/versions.sh index 5d34ff4ea4..922c006a39 100644 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -3,7 +3,7 @@ # Set up the versions to be used subnet_evm_version=${SUBNET_EVM_VERSION:-'v0.4.6'} # Don't export them as they're used in the context of other calls -avalanche_version=${AVALANCHE_VERSION:-'v1.9.4'} +avalanche_version=${AVALANCHE_VERSION:-'v1.9.6-rc.0'} network_runner_version=${NETWORK_RUNNER_VERSION:-'35be10cd3867a94fbe960a1c14a455f179de60d9'} ginkgo_version=${GINKGO_VERSION:-'v2.2.0'} From 315a6e43fc61704151107fa5c29bf4f4292c5813 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 4 Jan 2023 09:43:29 -0500 Subject: [PATCH 06/55] Working on tests --- contract-examples/hardhat.config.ts | 2 +- go.mod | 16 +++++++++++++--- go.sum | 16 ++++++++++++++++ tests/e2e/solidity/suites.go | 27 ++++++++++++--------------- 4 files changed, 42 insertions(+), 19 deletions(-) diff --git a/contract-examples/hardhat.config.ts b/contract-examples/hardhat.config.ts index dab6abd093..1381a6d0d8 100644 --- a/contract-examples/hardhat.config.ts +++ b/contract-examples/hardhat.config.ts @@ -3,7 +3,7 @@ import "./tasks.ts" // HardHat users must populate these environment variables in order to connect to their subnet-evm instance // Since the blockchainID is not necessarily known, there's no good default to use here. -var local_rpc_uri = process.env.RPC_URI || "http://127.0.0.1:9650/ext/bc/subnet-evm-chain/rpc" +var local_rpc_uri = process.env.RPC_URI || "http://127.0.0.1:9650/ext/bc/C/rpc" var local_chain_id = process.env.CHAIN_ID || 99999 export default { diff --git a/go.mod b/go.mod index 817c811827..5d2b3b580d 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/VictoriaMetrics/fastcache v1.10.0 - github.com/ava-labs/avalanchego v1.9.6-rc.0 + github.com/ava-labs/avalanchego v1.9.5 github.com/cespare/cp v0.1.0 github.com/davecgh/go-spew v1.1.1 github.com/deckarep/golang-set v1.8.0 @@ -49,16 +49,25 @@ require ( github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect 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/avalanche-ledger-go v0.0.13 // indirect github.com/ava-labs/coreth v0.11.5 // 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.3 // 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/cenkalti/backoff/v4 v4.1.3 // 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 @@ -87,7 +96,10 @@ require ( 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/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 @@ -143,5 +155,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/ava-labs/avalanchego => ../avalanchego diff --git a/go.sum b/go.sum index 1476271f86..c4bca301e5 100644 --- a/go.sum +++ b/go.sum @@ -53,6 +53,7 @@ github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMo 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= @@ -67,6 +68,8 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/ava-labs/avalanche-ledger-go v0.0.13 h1:YTdaSuaZS/1ct1RGirBEJeo2tiSfVeJGaE12XtUSGnE= github.com/ava-labs/avalanche-ledger-go v0.0.13/go.mod h1:LolCV2cdtkD67V/BSfy/ELUqleG1sbVyNdo5qe1u4y4= +github.com/ava-labs/avalanchego v1.9.5 h1:0uykbcKFocUL7U7SO/PGrXSMLX9RSt8xo5rj84bI3YY= +github.com/ava-labs/avalanchego v1.9.5/go.mod h1:1f/z4CBcz/VhNlOTj607dQj5ZQQaZQO/RO8sEa0EgvA= github.com/ava-labs/coreth v0.11.5 h1:/FklgdJuaezIE3lOWCvTwOUQrJv1OYuYbx3zujvSCqo= github.com/ava-labs/coreth v0.11.5/go.mod h1:4pelpPFzz3/M008s1WrpyQP4TLPdu2lw8ZyAVcttzJs= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= @@ -80,6 +83,7 @@ github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13P github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= 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.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= @@ -91,14 +95,18 @@ github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9E 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/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= @@ -141,6 +149,8 @@ github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200627015759-01fd2de07837/go. 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= @@ -355,8 +365,11 @@ github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7Bd 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.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= 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= @@ -376,6 +389,8 @@ github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALr 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= @@ -816,6 +831,7 @@ 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= diff --git a/tests/e2e/solidity/suites.go b/tests/e2e/solidity/suites.go index 8e08231685..b4afeddf17 100644 --- a/tests/e2e/solidity/suites.go +++ b/tests/e2e/solidity/suites.go @@ -8,6 +8,7 @@ import ( "context" "fmt" "os" + "os/exec" "strings" "time" @@ -40,28 +41,24 @@ var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { func runHardhatTests(test string, rpcURI string) { log.Info("Sleeping to wait for test ping", "rpcURI", rpcURI) - time.Sleep(time.Minute) client, err := utils.NewEvmClient(rpcURI, 225, 2) // TODO this is failing because the Avalanche engine does not start bootstrapping of subnets when staking is disabled gomega.Expect(err).Should(gomega.BeNil()) bal, err := client.FetchBalance(context.Background(), common.HexToAddress("")) gomega.Expect(err).Should(gomega.BeNil()) - gomega.Expect(bal).Should(gomega.Equal(common.Big0)) + gomega.Expect(bal.Cmp(common.Big0)).Should(gomega.Equal(0)) // TODO fix this to run hardhat tests on a network - // err := os.Setenv("RPC_URI", rpcURI) - // gomega.Expect(err).Should(gomega.BeNil()) - - // utils.RunCommand(fmt.Sprintf("npx hardhat test %s", "--network=local")) - // cmd := exec.Command("npx", "hardhat", "test", test, "--network", "local") - // cmd.Env = append(cmd.Env, fmt.Sprintf("RPC_URI=%s", rpcURI)) - // cmd.Dir = "./contract-examples" - // out, err := cmd.Output() - // if err != nil { - // fmt.Println(string(out)) - // fmt.Println(err) - // } - // gomega.Expect(err).Should(gomega.BeNil()) + + cmd := exec.Command("npx", "hardhat", "test", fmt.Sprintf("./test/%s.ts", test), "--network", "local") + cmd.Env = append(cmd.Env, fmt.Sprintf("RPC_URI=%s", rpcURI)) + cmd.Dir = "./contract-examples" + log.Info("Running hardhat command", "cmd", cmd.String()) + + time.Sleep(10 * time.Minute) + out, err := cmd.CombinedOutput() + fmt.Printf("\nCombined output:\n\n%s\n", string(out)) + gomega.Expect(err).Should(gomega.BeNil()) } func executeHardHatTestOnNewBlockchain(ctx context.Context, test string) { From 5457c13dc705d81c8890188a0881734c1b8fc808 Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Wed, 4 Jan 2023 09:25:36 -0800 Subject: [PATCH 07/55] Light client mode to unlock dynamic state sync --- go.mod | 4 ++-- go.sum | 9 ++++----- plugin/evm/message/syncable.go | 8 ++++---- plugin/evm/syncervm_client.go | 12 ++++++------ plugin/evm/syncervm_test.go | 19 ++++++++++--------- scripts/versions.sh | 2 +- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index 858efb956e..9c252a6ff5 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/VictoriaMetrics/fastcache v1.10.0 github.com/ava-labs/avalanche-network-runner-sdk v0.3.0 - github.com/ava-labs/avalanchego v1.9.5 + github.com/ava-labs/avalanchego v1.9.6-rc.0 github.com/cespare/cp v0.1.0 github.com/creack/pty v1.1.18 github.com/davecgh/go-spew v1.1.1 @@ -118,7 +118,7 @@ require ( go.opentelemetry.io/proto/otlp v0.19.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect - go.uber.org/zap v1.23.0 // indirect + go.uber.org/zap v1.24.0 // indirect golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5 // indirect golang.org/x/net v0.1.0 // indirect golang.org/x/term v0.1.0 // indirect diff --git a/go.sum b/go.sum index 718a7e5494..e15a68eb55 100644 --- a/go.sum +++ b/go.sum @@ -60,8 +60,8 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/ava-labs/avalanche-network-runner-sdk v0.3.0 h1:TVi9JEdKNU/RevYZ9PyW4pULbEdS+KQDA9Ki2DUvuAs= github.com/ava-labs/avalanche-network-runner-sdk v0.3.0/go.mod h1:SgKJvtqvgo/Bl/c8fxEHCLaSxEbzimYfBopcfrajxQk= -github.com/ava-labs/avalanchego v1.9.5 h1:0uykbcKFocUL7U7SO/PGrXSMLX9RSt8xo5rj84bI3YY= -github.com/ava-labs/avalanchego v1.9.5/go.mod h1:1f/z4CBcz/VhNlOTj607dQj5ZQQaZQO/RO8sEa0EgvA= +github.com/ava-labs/avalanchego v1.9.6-rc.0 h1:Jo5h3fbMV7C9CSNCrEgv6tZjRP6iPakcMiUDtyLhPS0= +github.com/ava-labs/avalanchego v1.9.6-rc.0/go.mod h1:L9mYGihm43ccnslbRGAUIbJ7pM9IIjqHjWx4xIcp298= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= 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= @@ -69,7 +69,6 @@ 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.23.1 h1:IB8cVQcC2X5mHbnfirLG5IZnkWYNTPlLZVrxUYSotbE= 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/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= @@ -578,8 +577,8 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= -go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= 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= diff --git a/plugin/evm/message/syncable.go b/plugin/evm/message/syncable.go index c9b73632ed..f79a9f2dfa 100644 --- a/plugin/evm/message/syncable.go +++ b/plugin/evm/message/syncable.go @@ -25,10 +25,10 @@ type SyncSummary struct { summaryID ids.ID bytes []byte - acceptImpl func(SyncSummary) (bool, error) + acceptImpl func(SyncSummary) (block.StateSyncMode, error) } -func NewSyncSummaryFromBytes(summaryBytes []byte, acceptImpl func(SyncSummary) (bool, error)) (SyncSummary, error) { +func NewSyncSummaryFromBytes(summaryBytes []byte, acceptImpl func(SyncSummary) (block.StateSyncMode, error)) (SyncSummary, error) { summary := SyncSummary{} if codecVersion, err := Codec.Unmarshal(summaryBytes, &summary); err != nil { return SyncSummary{}, err @@ -83,9 +83,9 @@ func (s SyncSummary) String() string { return fmt.Sprintf("SyncSummary(BlockHash=%s, BlockNumber=%d, BlockRoot=%s)", s.BlockHash, s.BlockNumber, s.BlockRoot) } -func (s SyncSummary) Accept(context.Context) (bool, error) { +func (s SyncSummary) Accept(context.Context) (block.StateSyncMode, error) { if s.acceptImpl == nil { - return false, fmt.Errorf("accept implementation not specified for summary: %s", s) + return block.StateSyncSkipped, fmt.Errorf("accept implementation not specified for summary: %s", s) } return s.acceptImpl(s) } diff --git a/plugin/evm/syncervm_client.go b/plugin/evm/syncervm_client.go index b56f1a30c6..bf185900c0 100644 --- a/plugin/evm/syncervm_client.go +++ b/plugin/evm/syncervm_client.go @@ -154,7 +154,7 @@ func (client *stateSyncerClient) stateSync(ctx context.Context) error { // acceptSyncSummary returns true if sync will be performed and launches the state sync process // in a goroutine. -func (client *stateSyncerClient) acceptSyncSummary(proposedSummary message.SyncSummary) (bool, error) { +func (client *stateSyncerClient) acceptSyncSummary(proposedSummary message.SyncSummary) (block.StateSyncMode, error) { isResume := proposedSummary.BlockHash == client.resumableSummary.BlockHash if !isResume { // Skip syncing if the blockchain is not significantly ahead of local state, @@ -167,12 +167,12 @@ func (client *stateSyncerClient) acceptSyncSummary(proposedSummary message.SyncS "syncableHeight", proposedSummary.Height(), ) if err := client.StateSyncClearOngoingSummary(); err != nil { - return false, fmt.Errorf("failed to clear ongoing summary after skipping state sync: %w", err) + return block.StateSyncSkipped, fmt.Errorf("failed to clear ongoing summary after skipping state sync: %w", err) } // Initialize snapshots if we're skipping state sync, since it will not have been initialized on // startup. client.chain.BlockChain().InitializeSnapshots() - return false, nil + return block.StateSyncSkipped, nil } // Wipe the snapshot completely if we are not resuming from an existing sync, so that we do not @@ -193,10 +193,10 @@ func (client *stateSyncerClient) acceptSyncSummary(proposedSummary message.SyncS // Note: this must be performed after WipeSnapshot finishes so that we do not start a state sync // session from a partially wiped snapshot. if err := client.metadataDB.Put(stateSyncSummaryKey, proposedSummary.Bytes()); err != nil { - return false, fmt.Errorf("failed to write state sync summary key to disk: %w", err) + return block.StateSyncSkipped, fmt.Errorf("failed to write state sync summary key to disk: %w", err) } if err := client.db.Commit(); err != nil { - return false, fmt.Errorf("failed to commit db: %w", err) + return block.StateSyncSkipped, fmt.Errorf("failed to commit db: %w", err) } log.Info("Starting state sync", "summary", proposedSummary) @@ -220,7 +220,7 @@ func (client *stateSyncerClient) acceptSyncSummary(proposedSummary message.SyncS log.Info("stateSync completed, notifying engine", "err", client.stateSyncErr) client.toEngine <- commonEng.StateSyncDone }() - return true, nil + return block.StateSyncStatic, nil } // syncBlocks fetches (up to) [parentsToGet] blocks from peers diff --git a/plugin/evm/syncervm_test.go b/plugin/evm/syncervm_test.go index d67ab92df0..b5a37194cb 100644 --- a/plugin/evm/syncervm_test.go +++ b/plugin/evm/syncervm_test.go @@ -20,6 +20,7 @@ import ( "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/choices" commonEng "github.com/ava-labs/avalanchego/snow/engine/common" + "github.com/ava-labs/avalanchego/snow/engine/snowman/block" "github.com/ava-labs/avalanchego/utils/set" "github.com/ava-labs/subnet-evm/accounts/keystore" @@ -44,7 +45,7 @@ func TestSkipStateSync(t *testing.T) { test := syncTest{ syncableInterval: 256, stateSyncMinBlocks: 300, // must be greater than [syncableInterval] to skip sync - shouldSync: false, + syncMode: block.StateSyncSkipped, } vmSetup := createSyncServerAndClientVMs(t, test) defer vmSetup.Teardown(t) @@ -57,7 +58,7 @@ func TestStateSyncFromScratch(t *testing.T) { test := syncTest{ syncableInterval: 256, stateSyncMinBlocks: 50, // must be less than [syncableInterval] to perform sync - shouldSync: true, + syncMode: block.StateSyncStatic, } vmSetup := createSyncServerAndClientVMs(t, test) defer vmSetup.Teardown(t) @@ -78,7 +79,7 @@ func TestStateSyncToggleEnabledToDisabled(t *testing.T) { test := syncTest{ syncableInterval: 256, stateSyncMinBlocks: 50, // must be less than [syncableInterval] to perform sync - shouldSync: true, + syncMode: block.StateSyncStatic, responseIntercept: func(syncerVM *VM, nodeID ids.NodeID, requestID uint32, response []byte) { lock.Lock() defer lock.Unlock() @@ -107,7 +108,7 @@ func TestStateSyncToggleEnabledToDisabled(t *testing.T) { // Perform sync resulting in early termination. testSyncerVM(t, vmSetup, test) - test.shouldSync = true + test.syncMode = block.StateSyncStatic test.responseIntercept = nil test.expectedErr = nil @@ -360,7 +361,7 @@ type syncTest struct { responseIntercept func(vm *VM, nodeID ids.NodeID, requestID uint32, response []byte) stateSyncMinBlocks uint64 syncableInterval uint64 - shouldSync bool + syncMode block.StateSyncMode expectedErr error } @@ -388,14 +389,14 @@ func testSyncerVM(t *testing.T, vmSetup *syncVMSetup, test syncTest) { } assert.Equal(t, summary, retrievedSummary) - shouldSync, err := parsedSummary.Accept(context.Background()) + syncMode, err := parsedSummary.Accept(context.Background()) if err != nil { t.Fatal("unexpected error accepting state summary", "err", err) } - if shouldSync != test.shouldSync { - t.Fatal("unexpected value returned from accept", "expected", test.shouldSync, "got", shouldSync) + if syncMode != test.syncMode { + t.Fatal("unexpected value returned from accept", "expected", test.syncMode, "got", syncMode) } - if !shouldSync { + if syncMode == block.StateSyncSkipped { return } msg := <-syncerEngineChan diff --git a/scripts/versions.sh b/scripts/versions.sh index d0b6c05a22..b159bebd11 100644 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -3,7 +3,7 @@ # Set up the versions to be used subnet_evm_version=${SUBNET_EVM_VERSION:-'v0.4.7'} # Don't export them as they're used in the context of other calls -avalanche_version=${AVALANCHE_VERSION:-'v1.9.5'} +avalanche_version=${AVALANCHE_VERSION:-'v1.9.6-rc.0'} network_runner_version=${NETWORK_RUNNER_VERSION:-'35be10cd3867a94fbe960a1c14a455f179de60d9'} ginkgo_version=${GINKGO_VERSION:-'v2.2.0'} From 7bc996aed46001b3a15ff42757fe67ee5914e228 Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Wed, 4 Jan 2023 09:49:08 -0800 Subject: [PATCH 08/55] revert version to pass ci (?) --- scripts/versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/versions.sh b/scripts/versions.sh index b159bebd11..d0b6c05a22 100644 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -3,7 +3,7 @@ # Set up the versions to be used subnet_evm_version=${SUBNET_EVM_VERSION:-'v0.4.7'} # Don't export them as they're used in the context of other calls -avalanche_version=${AVALANCHE_VERSION:-'v1.9.6-rc.0'} +avalanche_version=${AVALANCHE_VERSION:-'v1.9.5'} network_runner_version=${NETWORK_RUNNER_VERSION:-'35be10cd3867a94fbe960a1c14a455f179de60d9'} ginkgo_version=${GINKGO_VERSION:-'v2.2.0'} From a1f3af4c9372ce53ae454a4ca193503f2d9b1cdd Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Wed, 4 Jan 2023 10:00:29 -0800 Subject: [PATCH 09/55] fix simulator go.mod --- cmd/simulator/go.mod | 4 ++-- cmd/simulator/go.sum | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cmd/simulator/go.mod b/cmd/simulator/go.mod index b5144e9a0b..011157bf6a 100644 --- a/cmd/simulator/go.mod +++ b/cmd/simulator/go.mod @@ -15,7 +15,7 @@ replace github.com/ava-labs/subnet-evm => ../.. require ( github.com/VictoriaMetrics/fastcache v1.10.0 // indirect - github.com/ava-labs/avalanchego v1.9.5 // indirect + github.com/ava-labs/avalanchego v1.9.6-rc.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect @@ -62,7 +62,7 @@ require ( go.opentelemetry.io/proto/otlp v0.19.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect - go.uber.org/zap v1.23.0 // indirect + go.uber.org/zap v1.24.0 // indirect golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5 // indirect golang.org/x/net v0.1.0 // indirect diff --git a/cmd/simulator/go.sum b/cmd/simulator/go.sum index ad5ceadffe..ef8cef775d 100644 --- a/cmd/simulator/go.sum +++ b/cmd/simulator/go.sum @@ -45,14 +45,13 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/ava-labs/avalanchego v1.9.5 h1:0uykbcKFocUL7U7SO/PGrXSMLX9RSt8xo5rj84bI3YY= -github.com/ava-labs/avalanchego v1.9.5/go.mod h1:1f/z4CBcz/VhNlOTj607dQj5ZQQaZQO/RO8sEa0EgvA= +github.com/ava-labs/avalanchego v1.9.6-rc.0 h1:Jo5h3fbMV7C9CSNCrEgv6tZjRP6iPakcMiUDtyLhPS0= +github.com/ava-labs/avalanchego v1.9.6-rc.0/go.mod h1:L9mYGihm43ccnslbRGAUIbJ7pM9IIjqHjWx4xIcp298= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= 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/btcsuite/btcd v0.23.1 h1:IB8cVQcC2X5mHbnfirLG5IZnkWYNTPlLZVrxUYSotbE= 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/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= @@ -363,8 +362,8 @@ go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0 go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= -go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= 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= From dc9a2699914fa9727bf3137c11c7a5fb25d20601 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 4 Jan 2023 15:21:57 -0500 Subject: [PATCH 10/55] Set env variable using os setenv --- tests/e2e/solidity/suites.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/e2e/solidity/suites.go b/tests/e2e/solidity/suites.go index b4afeddf17..234edac7a8 100644 --- a/tests/e2e/solidity/suites.go +++ b/tests/e2e/solidity/suites.go @@ -48,14 +48,12 @@ func runHardhatTests(test string, rpcURI string) { gomega.Expect(err).Should(gomega.BeNil()) gomega.Expect(bal.Cmp(common.Big0)).Should(gomega.Equal(0)) - // TODO fix this to run hardhat tests on a network - + err = os.Setenv("RPC_URI", rpcURI) + gomega.Expect(err).Should(gomega.BeNil()) cmd := exec.Command("npx", "hardhat", "test", fmt.Sprintf("./test/%s.ts", test), "--network", "local") - cmd.Env = append(cmd.Env, fmt.Sprintf("RPC_URI=%s", rpcURI)) cmd.Dir = "./contract-examples" log.Info("Running hardhat command", "cmd", cmd.String()) - time.Sleep(10 * time.Minute) out, err := cmd.CombinedOutput() fmt.Printf("\nCombined output:\n\n%s\n", string(out)) gomega.Expect(err).Should(gomega.BeNil()) From 7afa66572e64718903f1e8a6fc4ff3eb35dbf551 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 4 Jan 2023 15:36:57 -0500 Subject: [PATCH 11/55] Needed renames to run all solidity precompile tests --- ...ist.ts => contract_deployer_allow_list.ts} | 0 .../{ExampleFeeManager.ts => fee_manager.ts} | 0 ...mpleRewardManager.ts => reward_manager.ts} | 0 ...ExampleTxAllowList.ts => tx_allow_list.ts} | 0 ...json => contract_deployer_allow_list.json} | 0 tests/e2e/solidity/suites.go | 104 +++++++----------- 6 files changed, 38 insertions(+), 66 deletions(-) rename contract-examples/test/{ExampleDeployerList.ts => contract_deployer_allow_list.ts} (100%) rename contract-examples/test/{ExampleFeeManager.ts => fee_manager.ts} (100%) rename contract-examples/test/{ExampleRewardManager.ts => reward_manager.ts} (100%) rename contract-examples/test/{ExampleTxAllowList.ts => tx_allow_list.ts} (100%) rename tests/e2e/genesis/{deployer_allow_list.json => contract_deployer_allow_list.json} (100%) diff --git a/contract-examples/test/ExampleDeployerList.ts b/contract-examples/test/contract_deployer_allow_list.ts similarity index 100% rename from contract-examples/test/ExampleDeployerList.ts rename to contract-examples/test/contract_deployer_allow_list.ts diff --git a/contract-examples/test/ExampleFeeManager.ts b/contract-examples/test/fee_manager.ts similarity index 100% rename from contract-examples/test/ExampleFeeManager.ts rename to contract-examples/test/fee_manager.ts diff --git a/contract-examples/test/ExampleRewardManager.ts b/contract-examples/test/reward_manager.ts similarity index 100% rename from contract-examples/test/ExampleRewardManager.ts rename to contract-examples/test/reward_manager.ts diff --git a/contract-examples/test/ExampleTxAllowList.ts b/contract-examples/test/tx_allow_list.ts similarity index 100% rename from contract-examples/test/ExampleTxAllowList.ts rename to contract-examples/test/tx_allow_list.ts diff --git a/tests/e2e/genesis/deployer_allow_list.json b/tests/e2e/genesis/contract_deployer_allow_list.json similarity index 100% rename from tests/e2e/genesis/deployer_allow_list.json rename to tests/e2e/genesis/contract_deployer_allow_list.json diff --git a/tests/e2e/solidity/suites.go b/tests/e2e/solidity/suites.go index 234edac7a8..e8d2ea978e 100644 --- a/tests/e2e/solidity/suites.go +++ b/tests/e2e/solidity/suites.go @@ -110,82 +110,54 @@ func executeHardHatTestOnNewBlockchain(ctx context.Context, test string) { runHardhatTests(test, chainURI) } +// TODO: can we move where we register the precompile e2e tests, so that they stay within their package var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { - ginkgo.It("create blockchain", ginkgo.Label("test"), func() { + // Each ginkgo It node specifies the name of the genesis file (in ./tests/e2e/genesis/) + //to use to launch the subnet and the name of the TS test file to run on the subnet (in ./contract-examples/tests/) + ginkgo.It("contract native minter", ginkgo.Label("solidity-with-npx"), func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() executeHardHatTestOnNewBlockchain(ctx, "contract_native_minter") }) - // TODO: uncomment the rest of the precompile e2e tests - // TODO: can we move where we register the precompile e2e tests, so that they stay within their package - // ginkgo.It("tx allow list", ginkgo.Label("solidity-with-npx"), func() { - // err := startSubnet("./tests/e2e/genesis/tx_allow_list.json") - // gomega.Expect(err).Should(gomega.BeNil()) - // running := runner.IsRunnerUp(grpcEp) - // gomega.Expect(running).Should(gomega.BeTrue()) - // runHardhatTests("./test/ExampleTxAllowList.ts") - // stopSubnet() - // running = runner.IsRunnerUp(grpcEp) - // gomega.Expect(running).Should(gomega.BeFalse()) - // }) - - // ginkgo.It("deployer allow list", ginkgo.Label("solidity-with-npx"), func() { - // err := startSubnet("./tests/e2e/genesis/deployer_allow_list.json") - // gomega.Expect(err).Should(gomega.BeNil()) - // running := runner.IsRunnerUp(grpcEp) - // gomega.Expect(running).Should(gomega.BeTrue()) - // runHardhatTests("./test/ExampleDeployerList.ts") - // stopSubnet() - // running = runner.IsRunnerUp(grpcEp) - // gomega.Expect(running).Should(gomega.BeFalse()) - // }) - - // ginkgo.It("contract native minter", ginkgo.Label("solidity-with-npx"), func() { - // err := startSubnet("./tests/e2e/genesis/contract_native_minter.json") - // gomega.Expect(err).Should(gomega.BeNil()) - // running := runner.IsRunnerUp(grpcEp) - // gomega.Expect(running).Should(gomega.BeTrue()) - // runHardhatTests("./test/ERC20NativeMinter.ts") - // stopSubnet() - // running = runner.IsRunnerUp(grpcEp) - // gomega.Expect(running).Should(gomega.BeFalse()) - // }) - - // ginkgo.It("fee manager", ginkgo.Label("solidity-with-npx"), func() { - // err := startSubnet("./tests/e2e/genesis/fee_manager.json") - // gomega.Expect(err).Should(gomega.BeNil()) - // running := runner.IsRunnerUp(grpcEp) - // gomega.Expect(running).Should(gomega.BeTrue()) - // runHardhatTests("./test/ExampleFeeManager.ts") - // stopSubnet() - // running = runner.IsRunnerUp(grpcEp) - // gomega.Expect(running).Should(gomega.BeFalse()) - // }) - - // ginkgo.It("reward manager", ginkgo.Label("solidity-with-npx"), func() { - // err := startSubnet("./tests/e2e/genesis/reward_manager.json") - // gomega.Expect(err).Should(gomega.BeNil()) - // running := runner.IsRunnerUp(grpcEp) - // gomega.Expect(running).Should(gomega.BeTrue()) - // runHardhatTests("./test/ExampleRewardManager.ts") - // stopSubnet() - // running = runner.IsRunnerUp(grpcEp) - // gomega.Expect(running).Should(gomega.BeFalse()) - // }) + ginkgo.It("tx allow list", ginkgo.Label("solidity-with-npx"), func() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + executeHardHatTestOnNewBlockchain(ctx, "tx_allow_list") + }) + + ginkgo.It("contract deployer allow list", ginkgo.Label("solidity-with-npx"), func() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + executeHardHatTestOnNewBlockchain(ctx, "contract_deployer_allow_list") + }) + + ginkgo.It("fee manager", ginkgo.Label("solidity-with-npx"), func() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + executeHardHatTestOnNewBlockchain(ctx, "fee_manager") + }) + + ginkgo.It("reward manager", ginkgo.Label("solidity-with-npx"), func() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + executeHardHatTestOnNewBlockchain(ctx, "reward_manager") + }) // ADD YOUR PRECOMPILE HERE /* - ginkgo.It("your precompile", ginkgo.Label("solidity-with-npx"), func() { - err := startSubnet("./tests/e2e/genesis/{your_precompile}.json") - gomega.Expect(err).Should(gomega.BeNil()) - running := runner.IsRunnerUp(grpcEp) - gomega.Expect(running).Should(gomega.BeTrue()) - runHardhatTests("./test/{YourPrecompileTest}.ts") - stopSubnet() - running = runner.IsRunnerUp(grpcEp) - gomega.Expect(running).Should(gomega.BeFalse()) + ginkgo.It("your precompile", ginkgo.Label("solidity-with-npx"), func() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + // Specify the name shared by the genesis file in ./tests/e2e/genesis/{your_precompile}.json + // and the test file in ./contract-examples/tests/{your_precompile}.ts + executeHardHatTestOnNewBlockchain(ctx, "your_precompile") }) */ }) From f3d851539a33ac180a4deff3791673276abe081f Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 4 Jan 2023 16:22:10 -0500 Subject: [PATCH 12/55] Cleanup --- contract-examples/hardhat.config.ts | 4 +- scripts/run_ginkgo.sh | 29 ++++++++------- tests/e2e/e2e_test.go | 58 +++-------------------------- tests/e2e/solidity/suites.go | 14 ++++--- 4 files changed, 31 insertions(+), 74 deletions(-) diff --git a/contract-examples/hardhat.config.ts b/contract-examples/hardhat.config.ts index 1381a6d0d8..be74e1ecb4 100644 --- a/contract-examples/hardhat.config.ts +++ b/contract-examples/hardhat.config.ts @@ -2,7 +2,7 @@ import "@nomiclabs/hardhat-waffle" import "./tasks.ts" // HardHat users must populate these environment variables in order to connect to their subnet-evm instance -// Since the blockchainID is not necessarily known, there's no good default to use here. +// Since the blockchainID is not known in advance, there's no good default to use and we use the C-Chain here. var local_rpc_uri = process.env.RPC_URI || "http://127.0.0.1:9650/ext/bc/C/rpc" var local_chain_id = process.env.CHAIN_ID || 99999 @@ -44,7 +44,7 @@ export default { "0x86f78c5416151fe3546dece84fda4b4b1e36089f2dbc48496faf3a950f16157c", "0x750839e9dbbd2a0910efe40f50b2f3b2f2f59f5580bb4b83bd8c1201cf9a010a" ], - pollingInterval: "2s" + pollingInterval: "1s" }, } } diff --git a/scripts/run_ginkgo.sh b/scripts/run_ginkgo.sh index 9091edf4e6..1cecc85d3a 100755 --- a/scripts/run_ginkgo.sh +++ b/scripts/run_ginkgo.sh @@ -1,6 +1,10 @@ #!/usr/bin/env bash set -e +# This script assumes that an AvalancheGo and Subnet-EVM binaries are available in the standard location +# within the $GOPATH +# The AvalancheGo and PluginDir paths can be specified via the environment variables used in ./scripts/run_single_node.sh. + # Load the versions SUBNET_EVM_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" @@ -9,19 +13,16 @@ SUBNET_EVM_PATH=$( source "$SUBNET_EVM_PATH"/scripts/versions.sh -run_ginkgo() { - echo "building e2e.test" - # to install the ginkgo binary (required for test build and run) - go install -v github.com/onsi/ginkgo/v2/ginkgo@${ginkgo_version} - - ACK_GINKGO_RC=true ginkgo build ./tests/e2e +# Build ginkgo +echo "building e2e.test" +# to install the ginkgo binary (required for test build and run) +go install -v github.com/onsi/ginkgo/v2/ginkgo@${ginkgo_version} - # By default, it runs all e2e test cases! - # Use "--ginkgo.skip" to skip tests. - # Use "--ginkgo.focus" to select tests. - ./tests/e2e/e2e.test \ - --ginkgo.vv \ - --ginkgo.label-filter=${GINKGO_LABEL_FILTER:-""} -} +ACK_GINKGO_RC=true ginkgo build ./tests/e2e -run_ginkgo \ No newline at end of file +# By default, it runs all e2e test cases! +# Use "--ginkgo.skip" to skip tests. +# Use "--ginkgo.focus" to select tests. +./tests/e2e/e2e.test \ + --ginkgo.vv \ + --ginkgo.label-filter=${GINKGO_LABEL_FILTER:-""} diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index 91ca58f08b..c0bc84b827 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -6,14 +6,10 @@ package e2e import ( "context" - "flag" - "fmt" - "os" "testing" "time" "github.com/ava-labs/avalanchego/api/health" - "github.com/ava-labs/avalanchego/config" "github.com/ava-labs/subnet-evm/tests/e2e/utils" "github.com/ethereum/go-ethereum/log" "github.com/go-cmd/cmd" @@ -23,49 +19,7 @@ import ( _ "github.com/ava-labs/subnet-evm/tests/e2e/solidity" ) -var ( - // sets the "avalanchego" exec path - avalanchegoExecPath string - dataDir string - configFilePath string - - setupTimeout time.Duration - - startCmd *cmd.Cmd - - defaultConfigJSON = `{ - "network-id": "local", - "staking-enabled": false - }` -) - -func init() { - // Assumes that the plugin directory will be found in a default location, so we do not set it here. - flag.StringVar( - &avalanchegoExecPath, - "avalanchego-path", - os.ExpandEnv("$GOPATH/src/github.com/ava-labs/avalanchego/build/avalanchego"), - "avalanchego executable path", - ) - flag.StringVar( - &dataDir, - config.DataDirKey, - fmt.Sprintf("/tmp/subnet-evm-e2e-test/%v", time.Now().Unix()), - "Data directory", - ) - flag.StringVar( - &configFilePath, - config.ConfigFileKey, - "", - "Path to specify a config file", - ) - flag.DurationVar( - &setupTimeout, - "setup-timeout", - time.Minute, - "Timeout for setting up the node for the e2e test (timeout for BeforeSuite to complete)", - ) -} +var startCmd *cmd.Cmd func TestE2E(t *testing.T) { gomega.RegisterFailHandler(ginkgo.Fail) @@ -74,22 +28,22 @@ func TestE2E(t *testing.T) { // BeforeSuite starts an AvalancheGo process to use for the e2e tests var _ = ginkgo.BeforeSuite(func() { - ctx, cancel := context.WithTimeout(context.Background(), setupTimeout) - defer cancel() - var err error log.Info("Starting AvalancheGo node") startCmd, err = utils.RunCommand("./scripts/run_single_node.sh") gomega.Expect(err).Should(gomega.BeNil()) + + // Assumes that startCmd will launch a node with HTTP Port at [utils.DefaultLocalNodeURI] healthClient := health.NewClient(utils.DefaultLocalNodeURI) - healthy, err := health.AwaitReady(ctx, healthClient, 5*time.Second) + healthy, err := health.AwaitReady(context.Background(), healthClient, 5*time.Second) gomega.Expect(err).Should(gomega.BeNil()) gomega.Expect(healthy).Should(gomega.BeTrue()) log.Info("AvalancheGo node is healthy") }) var _ = ginkgo.AfterSuite(func() { - // TODO add a new node to bootstrap off of the existing node and make sure we can bootstrap all of the data created in the test. gomega.Expect(startCmd).ShouldNot(gomega.BeNil()) gomega.Expect(startCmd.Stop()).Should(gomega.BeNil()) + // TODO add a new node to bootstrap off of the existing node and ensure it can bootstrap all subnets + // created during the test }) diff --git a/tests/e2e/solidity/suites.go b/tests/e2e/solidity/suites.go index e8d2ea978e..c402dfbb66 100644 --- a/tests/e2e/solidity/suites.go +++ b/tests/e2e/solidity/suites.go @@ -6,6 +6,7 @@ package solidity import ( "context" + "encoding/json" "fmt" "os" "os/exec" @@ -18,6 +19,7 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/vms/secp256k1fx" wallet "github.com/ava-labs/avalanchego/wallet/subnet/primary" + "github.com/ava-labs/subnet-evm/core" "github.com/ava-labs/subnet-evm/plugin/evm" "github.com/ava-labs/subnet-evm/tests/e2e/utils" "github.com/ethereum/go-ethereum/common" @@ -26,13 +28,9 @@ import ( "github.com/onsi/gomega" ) -var localURI = "http://127.0.0.1:9650" - -// TODO add general and configurable load test that can be run as a binary on an arbitrary N nodes and given blockchainID - var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { ginkgo.It("ping the network", ginkgo.Label("setup"), func() { - client := health.NewClient(localURI) + client := health.NewClient(utils.DefaultLocalNodeURI) healthy, err := client.Readiness(context.Background()) gomega.Expect(err).Should(gomega.BeNil()) gomega.Expect(healthy.Healthy).Should(gomega.BeTrue()) @@ -88,7 +86,11 @@ func executeHardHatTestOnNewBlockchain(ctx context.Context, test string) { createSubnetTxID, err := pWallet.IssueCreateSubnetTx(owner) gomega.Expect(err).Should(gomega.BeNil()) - log.Info("Creating new blockchain", "genesis", genesisBytes) + genesis := &core.Genesis{} + err = json.Unmarshal(genesisBytes, genesis) + gomega.Expect(err).Should(gomega.BeNil()) + + log.Info("Creating new Subnet-EVM blockchain", "genesis", genesis) createChainTxID, err := pWallet.IssueCreateChainTx( createSubnetTxID, genesisBytes, From 61a526d9dfcc903a3b279b218cdb2b8d19ae38dd Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 4 Jan 2023 20:12:59 -0500 Subject: [PATCH 13/55] E2E test GH Action --- .github/workflows/lint-tests-release.yml | 10 ++++- scripts/install_avalanchego_release.sh | 51 ++++++++++++++++++++++++ scripts/run_single_node.sh | 12 ++++-- 3 files changed, 68 insertions(+), 5 deletions(-) create mode 100755 scripts/install_avalanchego_release.sh diff --git a/.github/workflows/lint-tests-release.yml b/.github/workflows/lint-tests-release.yml index 51bf338e0c..68df213cef 100644 --- a/.github/workflows/lint-tests-release.yml +++ b/.github/workflows/lint-tests-release.yml @@ -63,9 +63,15 @@ jobs: - name: Yarn install run: yarn working-directory: ./contract-examples - - name: Run e2e tests + - name: Install AvalancheGo Release shell: bash - run: SKIP_NETWORK_RUNNER_START=true SKIP_NETWORK_RUNNER_SHUTDOWN=true ENABLE_SOLIDITY_TESTS=true scripts/run.sh + run: BASEDIR=/tmp/e2e-test AVAGO_FILEPATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh + - name: Build Subnet-EVM Plugin Binary + shell: bash + run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy + - uses: Run E2E Tests + shell: bash + run: AVALANCHE_BINARY_PATH=/tmp/e2e-test/avalanchego/avalanchego ./scripts/run_ginkgo.sh simulator_test: name: Load testing with simulator diff --git a/scripts/install_avalanchego_release.sh b/scripts/install_avalanchego_release.sh new file mode 100755 index 0000000000..edce4111bc --- /dev/null +++ b/scripts/install_avalanchego_release.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +set -e + +# Load the versions +SUBNET_EVM_PATH=$( + cd "$(dirname "${BASH_SOURCE[0]}")" + cd .. && pwd +) +source "$SUBNET_EVM_PATH"/scripts/versions.sh + +# Load the constants +source "$SUBNET_EVM_PATH"/scripts/constants.sh + +VERSION=$avalanche_version + +############################ +# download avalanchego +# https://github.com/ava-labs/avalanchego/releases +GOARCH=$(go env GOARCH) +GOOS=$(go env GOOS) +BASEDIR=${BASE_DIR:-"/tmp/avalanchego-release"} +mkdir -p ${BASEDIR} +AVAGO_DOWNLOAD_URL=https://github.com/ava-labs/avalanchego/releases/download/${VERSION}/avalanchego-linux-${GOARCH}-${VERSION}.tar.gz +AVAGO_DOWNLOAD_PATH=${BASEDIR}/avalanchego-linux-${GOARCH}-${VERSION}.tar.gz +if [[ ${GOOS} == "darwin" ]]; then + AVAGO_DOWNLOAD_URL=https://github.com/ava-labs/avalanchego/releases/download/${VERSION}/avalanchego-macos-${VERSION}.zip + AVAGO_DOWNLOAD_PATH=${BASEDIR}/avalanchego-macos-${VERSION}.zip +fi + +AVAGO_FILEPATH=${AVAGO_FILEPATH:-${BASEDIR}/avalanchego-${VERSION}} +mkdir -p $AVAGO_FILEPATH + +if [[ ! -f ${AVAGO_DOWNLOAD_PATH} ]]; then + echo "downloading avalanchego ${VERSION} at ${AVAGO_DOWNLOAD_URL} to ${AVAGO_DOWNLOAD_PATH}" + curl -L ${AVAGO_DOWNLOAD_URL} -o ${AVAGO_DOWNLOAD_PATH} +fi +echo "extracting downloaded avalanchego to ${AVAGO_FILEPATH}" +if [[ ${GOOS} == "linux" ]]; then + mkdir -p ${AVAGO_FILEPATH} && tar xzvf ${AVAGO_DOWNLOAD_PATH} --directory ${AVAGO_FILEPATH} --strip-components 1 +elif [[ ${GOOS} == "darwin" ]]; then + unzip ${AVAGO_DOWNLOAD_PATH} -d ${AVAGO_FILEPATH} + mv ${AVAGO_FILEPATH}/build/* ${AVAGO_FILEPATH} + rm -rf ${AVAGO_FILEPATH}/build/ +fi + +AVALANCHEGO_PATH=${AVAGO_FILEPATH}/avalanchego +AVALANCHEGO_PLUGIN_DIR=${AVAGO_FILEPATH}/plugins + +echo "Installed AvalancheGo release ${VERSION}" +echo "AvalancheGo Path: ${AVALANCHEGO_PATH}" +echo "Plugin Dir: ${AVALANCHEGO_PLUGIN_DIR}" diff --git a/scripts/run_single_node.sh b/scripts/run_single_node.sh index cce9db624d..9e25d4189b 100755 --- a/scripts/run_single_node.sh +++ b/scripts/run_single_node.sh @@ -20,13 +20,14 @@ source "$SUBNET_EVM_PATH"/scripts/constants.sh # Set up avalanche binary path and assume build directory is set AVALANCHE_BINARY_PATH=${AVALANCHE_BINARY_PATH:-"$GOPATH/src/github.com/ava-labs/avalanchego/build/avalanchego"} -PLUGIN_DIR=${PLUGIN_DIR:-"$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins"} DATA_DIR=${DATA_DIR:-/tmp/subnet-evm-start-node/$(date "+%Y-%m-%d%:%H:%M:%S")} # Create node config in DATA_DIR echo "creating node config" mkdir -p $DATA_DIR - cat <$DATA_DIR/config.json +CONFIG_FILE_PATH=$DATA_DIR/config.json + + cat <$CONFIG_FILE_PATH { "network-id": "local", "staking-enabled": false, @@ -37,5 +38,10 @@ mkdir -p $DATA_DIR } EOF +echo "Starting AvalancheGo node" +echo "AvalancheGo Binary Path: ${AVALANCHE_BINARY_PATH}" +echo "Data directory: ${DATA_DIR}" +echo "Config file: ${CONFIG_FILE_PATH}" + # Run the node -$AVALANCHE_BINARY_PATH --data-dir=$DATA_DIR --config-file=$DATA_DIR/config.json +$AVALANCHE_BINARY_PATH --data-dir=$DATA_DIR --config-file=$CONFIG_FILE_PATH From 0a54780d02011b225d397a70e8ef89ec16f11c48 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 4 Jan 2023 20:21:13 -0500 Subject: [PATCH 14/55] Remove simualtor from GH Actions --- .github/workflows/lint-tests-release.yml | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/lint-tests-release.yml b/.github/workflows/lint-tests-release.yml index 68df213cef..22046e9d91 100644 --- a/.github/workflows/lint-tests-release.yml +++ b/.github/workflows/lint-tests-release.yml @@ -73,25 +73,25 @@ jobs: shell: bash run: AVALANCHE_BINARY_PATH=/tmp/e2e-test/avalanchego/avalanchego ./scripts/run_ginkgo.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: Install dependencies with go module - shell: bash - run: go mod download - - name: Run simulator tests - shell: bash - # skip shutdown so external simulator binary can run against the existing cluster - 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: Install dependencies with go module + # shell: bash + # run: go mod download + # - name: Run simulator tests + # shell: bash + # # skip shutdown so external simulator binary can run against the existing cluster + # run: SKIP_NETWORK_RUNNER_SHUTDOWN=true RUN_SIMULATOR=true scripts/run.sh release: # needs: [lint_test, unit_test, e2e_test, simulator_test] From 6aa8d7d42a8a4314544637a296781dd598e38316 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 4 Jan 2023 21:52:08 -0500 Subject: [PATCH 15/55] Re-add simulator to GH Actions --- .github/workflows/lint-tests-release.yml | 37 ++++++++++++------------ 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/lint-tests-release.yml b/.github/workflows/lint-tests-release.yml index 22046e9d91..34495bb275 100644 --- a/.github/workflows/lint-tests-release.yml +++ b/.github/workflows/lint-tests-release.yml @@ -73,25 +73,24 @@ jobs: shell: bash run: AVALANCHE_BINARY_PATH=/tmp/e2e-test/avalanchego/avalanchego ./scripts/run_ginkgo.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: Install dependencies with go module - # shell: bash - # run: go mod download - # - name: Run simulator tests - # shell: bash - # # skip shutdown so external simulator binary can run against the existing cluster - # 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: Install dependencies with go module + shell: bash + run: go mod download + - name: Run simulator tests + shell: bash + run: RUN_SIMULATOR=true scripts/run.sh release: # needs: [lint_test, unit_test, e2e_test, simulator_test] From cedf89c678f359135a718599a41b7ed15944c746 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 5 Jan 2023 09:24:13 -0500 Subject: [PATCH 16/55] nits --- tests/e2e/solidity/suites.go | 19 ++++++++++++------- tests/e2e/utils/constants.go | 4 +--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/e2e/solidity/suites.go b/tests/e2e/solidity/suites.go index c402dfbb66..8ed1a79191 100644 --- a/tests/e2e/solidity/suites.go +++ b/tests/e2e/solidity/suites.go @@ -10,7 +10,6 @@ import ( "fmt" "os" "os/exec" - "strings" "time" "github.com/ava-labs/avalanchego/api/health" @@ -57,8 +56,7 @@ func runHardhatTests(test string, rpcURI string) { gomega.Expect(err).Should(gomega.BeNil()) } -func executeHardHatTestOnNewBlockchain(ctx context.Context, test string) { - log.Info("Executing HardHat tests on a new blockchain", "test", test) +func createNewSubnet(ctx context.Context, genesisFilePath string) string { kc := secp256k1fx.NewKeychain(genesis.EWOQKey) // NewWalletFromURI fetches the available UTXOs owned by [kc] on the network @@ -77,7 +75,6 @@ func executeHardHatTestOnNewBlockchain(ctx context.Context, test string) { wd, err := os.Getwd() gomega.Expect(err).Should(gomega.BeNil()) - genesisFilePath := fmt.Sprintf("./tests/e2e/genesis/%s.json", test) log.Info("Reading genesis file", "filePath", genesisFilePath, "pwd", wd) genesisBytes, err := os.ReadFile(genesisFilePath) gomega.Expect(err).Should(gomega.BeNil()) @@ -96,7 +93,7 @@ func executeHardHatTestOnNewBlockchain(ctx context.Context, test string) { genesisBytes, evm.ID, nil, - strings.ReplaceAll(test, "_", ""), + "testChain", ) gomega.Expect(err).Should(gomega.BeNil()) @@ -106,9 +103,17 @@ func executeHardHatTestOnNewBlockchain(ctx context.Context, test string) { gomega.Expect(err).Should(gomega.BeNil()) gomega.Expect(bootstrapped).Should(gomega.BeTrue()) - // Confirm the new blockchain is up - chainURI := fmt.Sprintf("%s/ext/bc/%s/rpc", utils.DefaultLocalNodeURI, createChainTxID.String()) + // Return the RPC Endpoint for the new blockchain + return fmt.Sprintf("%s/ext/bc/%s/rpc", utils.DefaultLocalNodeURI, createChainTxID.String()) +} + +func executeHardHatTestOnNewBlockchain(ctx context.Context, test string) { + log.Info("Executing HardHat tests on a new blockchain", "test", test) + + genesisFilePath := fmt.Sprintf("./tests/e2e/genesis/%s.json", test) + chainURI := createNewSubnet(ctx, genesisFilePath) + log.Info("Created subnet successfully", "ChainURI", chainURI) runHardhatTests(test, chainURI) } diff --git a/tests/e2e/utils/constants.go b/tests/e2e/utils/constants.go index 55b526edd7..faf5908016 100644 --- a/tests/e2e/utils/constants.go +++ b/tests/e2e/utils/constants.go @@ -3,6 +3,4 @@ package utils -var ( - DefaultLocalNodeURI = "http://127.0.0.1:9650" -) +var DefaultLocalNodeURI = "http://127.0.0.1:9650" From 6a3a8d76cda6686807a11e3321766d0ab669d88d Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 5 Jan 2023 10:29:00 -0500 Subject: [PATCH 17/55] Modify run script to support running a network and running simulator --- scripts/run.sh | 91 +++++++++++++++++--------------------------------- 1 file changed, 31 insertions(+), 60 deletions(-) diff --git a/scripts/run.sh b/scripts/run.sh index 5e851297aa..b4a091baaa 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -3,10 +3,10 @@ set -e # e.g., # -# run without e2e tests +# run a 5 node network with the avalanche-network-runner # ./scripts/run.sh # -# run without e2e tests, and with simulator +# run a 5 node network with the load simulator # RUN_SIMULATOR=true ./scripts/run.sh # # run without e2e tests with DEBUG log level @@ -35,37 +35,15 @@ GENESIS_ADDRESS=${GENESIS_ADDRESS-$DEFAULT_ACCOUNT} SKIP_NETWORK_RUNNER_START=${SKIP_NETWORK_RUNNER_START:-false} SKIP_NETWORK_RUNNER_SHUTDOWN=${SKIP_NETWORK_RUNNER_SHUTDOWN:-true} RUN_SIMULATOR=${RUN_SIMULATOR:-false} -ENABLE_SOLIDITY_TESTS=${ENABLE_SOLIDITY_TESTS:-false} -AVALANCHE_LOG_LEVEL=${AVALANCHE_LOG_LEVEL:-WARN} ANR_VERSION=$network_runner_version -GINKGO_VERSION=$ginkgo_version - -# by default, "run.sh" should not run any tests... -# simulator tests are not implemented in ginkgo -# it instead runs external binary "simulator" -# so we exclude all e2e tests here -# ref. https://onsi.github.io/ginkgo/#spec-labels -GINKGO_LABEL_FILTER="!precompile-upgrade && !solidity-with-npx && !solidity-counter" -if [[ ${RUN_SIMULATOR} == true ]]; then - # only run "ping" tests, no other test - # because simulator itself will generate loads and run tests - GINKGO_LABEL_FILTER="ping" -fi -if [[ ${ENABLE_SOLIDITY_TESTS} == true ]]; then - GINKGO_LABEL_FILTER="solidity-with-npx" -fi echo "Running with:" echo AVALANCHE_VERSION: ${VERSION} echo ANR_VERSION: ${ANR_VERSION} -echo GINKGO_VERSION: ${GINKGO_VERSION} echo GENESIS_ADDRESS: ${GENESIS_ADDRESS} echo SKIP_NETWORK_RUNNER_START: ${SKIP_NETWORK_RUNNER_START} echo SKIP_NETWORK_RUNNER_SHUTDOWN: ${SKIP_NETWORK_RUNNER_SHUTDOWN} echo RUN_SIMULATOR: ${RUN_SIMULATOR} -echo ENABLE_SOLIDITY_TESTS: ${ENABLE_SOLIDITY_TESTS} -echo GINKGO_LABEL_FILTER: ${GINKGO_LABEL_FILTER} -echo AVALANCHE_LOG_LEVEL: ${AVALANCHE_LOG_LEVEL} ############################ # download avalanchego @@ -91,6 +69,7 @@ if [[ ! -d ${AVAGO_FILEPATH} ]]; then if [[ ${GOOS} == "linux" ]]; then mkdir -p ${AVAGO_FILEPATH} && tar xzvf ${AVAGO_DOWNLOAD_PATH} --directory ${AVAGO_FILEPATH} --strip-components 1 elif [[ ${GOOS} == "darwin" ]]; then + echo 'unzip '${AVAGO_DOWNLOAD_PATH}' -d '${AVAGO_FILEPATH}'' unzip ${AVAGO_DOWNLOAD_PATH} -d ${AVAGO_FILEPATH} mv ${AVAGO_FILEPATH}/build/* ${AVAGO_FILEPATH} rm -rf ${AVAGO_FILEPATH}/build/ @@ -121,8 +100,10 @@ go build \ # Create genesis file to use in network (make sure to add your address to # "alloc") export CHAIN_ID=99999 +GENESIS_FILE_PATH=$BASEDIR/genesis.json + echo "creating genesis" - cat <$BASEDIR/genesis.json + cat <$GENESIS_FILE_PATH { "config": { "chainId": $CHAIN_ID, @@ -184,38 +165,15 @@ else BIN=${GOBIN}/avalanche-network-runner fi echo "launch avalanche-network-runner in the background" + +# Start network runner server $BIN server \ --log-level debug \ --port=":12342" \ --grpc-gateway-port=":12343" & PID=${!} -run_ginkgo() { - echo "building e2e.test" - # to install the ginkgo binary (required for test build and run) - go install -v github.com/onsi/ginkgo/v2/ginkgo@${GINKGO_VERSION} - ginkgo -h - - ACK_GINKGO_RC=true ginkgo build ./tests/e2e - - # By default, it runs all e2e test cases! - # Use "--ginkgo.skip" to skip tests. - # Use "--ginkgo.focus" to select tests. - echo "running e2e tests with SKIP_NETWORK_RUNNER_START ${SKIP_NETWORK_RUNNER_START}" - ./tests/e2e/e2e.test \ - --ginkgo.vv \ - --network-runner-log-level debug \ - --network-runner-grpc-endpoint="0.0.0.0:12342" \ - --avalanchego-path=${AVALANCHEGO_PATH} \ - --avalanchego-plugin-dir=${AVALANCHEGO_PLUGIN_DIR} \ - --avalanchego-log-level=${AVALANCHE_LOG_LEVEL} \ - --vm-genesis-path=$BASEDIR/genesis.json \ - --output-path=$BASEDIR/avalanchego-${VERSION}/output.yaml \ - --skip-network-runner-start=${SKIP_NETWORK_RUNNER_START} \ - --skip-network-runner-shutdown=${SKIP_NETWORK_RUNNER_SHUTDOWN} \ - --ginkgo.label-filter="${GINKGO_LABEL_FILTER}" -} - +# Define command to run the simulator run_simulator() { ################################# echo "building simulator" @@ -233,14 +191,14 @@ run_simulator() { --priority-fee=1 } - -# whether start network via parser/main.go or e2e.test ginkgo -# run the tests with label filter -echo "running ginkgo" -run_ginkgo -# to fail the script if ginkgo failed -EXIT_CODE=$? - +# Start the network with the defined blockchain specs +$BIN control start \ + --log-level debug \ + --endpoint="0.0.0.0:12342" \ + --number-of-nodes=5 \ + --avalanchego-path ${AVALANCHEGO_PATH} \ + --plugin-dir ${AVALANCHEGO_PLUGIN_DIR} \ + --blockchain-specs '[{"vm_name": "subnetevm", "genesis": "'$GENESIS_FILE_PATH'"]' # e.g., "RUN_SIMULATOR=true scripts/run.sh" to launch network runner + simulator if [[ ${RUN_SIMULATOR} == true ]]; then @@ -251,6 +209,14 @@ fi ################################# if [[ ${SKIP_NETWORK_RUNNER_SHUTDOWN} == false ]]; then + $BIN control stop \ + --log-level debug \ + --endpoint="0.0.0.0:12342" + + $BIN server stop \ + --log-level debug \ + --endpoint="0.0.0.0:12342" + # just in case tests are aborted, manually terminate them again echo "network-runner RPC server was running on PID ${PID} as test mode; terminating the process..." pkill -P ${PID} || true @@ -259,7 +225,12 @@ if [[ ${SKIP_NETWORK_RUNNER_SHUTDOWN} == false ]]; then else echo "network-runner RPC server is running on PID ${PID}..." echo "" - echo "use the following command to terminate:" + echo "use the following command to terminate via avalanche-network-runner:" + echo "" + echo ''$BIN' control stop --log-level debug --endpoint="0.0.0.0:12342"' + echo ''$BIN' server stop --log-level debug --endpoint="0.0.0.0:12342"' + echo "" + echo "use the following command to terminate forcefully:" echo "" echo "pkill -P ${PID} && kill -2 ${PID} && pkill -9 -f srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy" echo "" From 7998729b8d435a19d21a9fcb852ffcd88b2a4ceb Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 5 Jan 2023 12:28:36 -0500 Subject: [PATCH 18/55] Fix GH Actions file --- .github/workflows/lint-tests-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-tests-release.yml b/.github/workflows/lint-tests-release.yml index 34495bb275..c4d9c647e5 100644 --- a/.github/workflows/lint-tests-release.yml +++ b/.github/workflows/lint-tests-release.yml @@ -69,7 +69,7 @@ jobs: - name: Build Subnet-EVM Plugin Binary shell: bash run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy - - uses: Run E2E Tests + - name: Run E2E Tests shell: bash run: AVALANCHE_BINARY_PATH=/tmp/e2e-test/avalanchego/avalanchego ./scripts/run_ginkgo.sh From 8b907e0df2671481c769ccfb3cca7e776c1c45c0 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 11 Jan 2023 10:27:56 -0500 Subject: [PATCH 19/55] Bump avalanchego to v1.9.6-rc.2 --- scripts/versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/versions.sh b/scripts/versions.sh index b159bebd11..9916152027 100644 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -3,7 +3,7 @@ # Set up the versions to be used subnet_evm_version=${SUBNET_EVM_VERSION:-'v0.4.7'} # Don't export them as they're used in the context of other calls -avalanche_version=${AVALANCHE_VERSION:-'v1.9.6-rc.0'} +avalanche_version=${AVALANCHE_VERSION:-'v1.9.6-rc.2'} network_runner_version=${NETWORK_RUNNER_VERSION:-'35be10cd3867a94fbe960a1c14a455f179de60d9'} ginkgo_version=${GINKGO_VERSION:-'v2.2.0'} From e070d3dd4435d75039fa3034a23d9ccb39e0e6e9 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 12 Jan 2023 01:08:34 -0500 Subject: [PATCH 20/55] go mod tidy --- go.mod | 6 +----- go.sum | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index e64079dd2e..aecd753176 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.18 require ( github.com/VictoriaMetrics/fastcache v1.10.0 - github.com/ava-labs/avalanche-network-runner-sdk v0.3.0 github.com/ava-labs/avalanchego v1.9.6 github.com/cespare/cp v0.1.0 github.com/davecgh/go-spew v1.1.1 @@ -47,11 +46,10 @@ require ( ) require ( - github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect - github.com/ava-labs/avalanche-ledger-go v0.0.13 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/btcsuite/btcd/btcutil v1.1.3 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect @@ -112,8 +110,6 @@ require ( github.com/tklauser/numcpus v0.2.2 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266 // indirect - github.com/zondax/ledger-go v0.13.0 // indirect go.opentelemetry.io/otel v1.11.0 // indirect go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.0 // indirect diff --git a/go.sum b/go.sum index e8f43a9149..d763203316 100644 --- a/go.sum +++ b/go.sum @@ -44,8 +44,6 @@ 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/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec h1:1Qb69mGp/UtRPn422BH4/Y4Q3SLUrD9KHuDkm8iodFc= -github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec/go.mod h1:CD8UlnlLDiqb36L110uqiP2iSflVjx9g/3U9hCI4q2U= 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= @@ -63,8 +61,6 @@ 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-sdk v0.3.0 h1:TVi9JEdKNU/RevYZ9PyW4pULbEdS+KQDA9Ki2DUvuAs= -github.com/ava-labs/avalanche-network-runner-sdk v0.3.0/go.mod h1:SgKJvtqvgo/Bl/c8fxEHCLaSxEbzimYfBopcfrajxQk= github.com/ava-labs/avalanchego v1.9.6 h1:xDLo7iVf73ohgR3alhRJcEalM7B8Pi5HkgCesl8lkf8= github.com/ava-labs/avalanchego v1.9.6/go.mod h1:ckdSQHeoRN6PmQ3TLgWAe6Kh9tFpU4Lu6MgDW4GrU/Q= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= @@ -74,8 +70,18 @@ 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.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= +github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= +github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= +github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= +github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= +github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= +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/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= @@ -535,7 +541,6 @@ github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969/go.mod h1:RZL 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.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -578,11 +583,6 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266 h1:O9XLFXGkVswDFmH9LaYpqu+r/AAFWqr0DL6V00KEVFg= -github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.13.0 h1:3brWtvAlfKqpe27JSUC/t1f0CvVVOX8zR/f/3+ShPBY= -github.com/zondax/ledger-go v0.13.0/go.mod h1:KatxXrVDzgWwbssUWsF5+cOJHXPvzQ09YSlzGNuhOEo= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -617,6 +617,7 @@ 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.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +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= From e410de230369efc65a9b17eb7f089430419d8f7f Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 12 Jan 2023 01:09:39 -0500 Subject: [PATCH 21/55] Fix run script --- scripts/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run.sh b/scripts/run.sh index b4a091baaa..01d69330f2 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -198,7 +198,7 @@ $BIN control start \ --number-of-nodes=5 \ --avalanchego-path ${AVALANCHEGO_PATH} \ --plugin-dir ${AVALANCHEGO_PLUGIN_DIR} \ - --blockchain-specs '[{"vm_name": "subnetevm", "genesis": "'$GENESIS_FILE_PATH'"]' + --blockchain-specs '[{"vm_name": "subnetevm", "genesis": "'$GENESIS_FILE_PATH'"}]' # e.g., "RUN_SIMULATOR=true scripts/run.sh" to launch network runner + simulator if [[ ${RUN_SIMULATOR} == true ]]; then From 89bf2ba0c66d21a072daf135698e09eecaa8db0d Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 12 Jan 2023 01:25:33 -0500 Subject: [PATCH 22/55] Reduce ctx timeout for starting new subnet to 15s --- tests/e2e/solidity/suites.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/e2e/solidity/suites.go b/tests/e2e/solidity/suites.go index 8ed1a79191..2a950b47c9 100644 --- a/tests/e2e/solidity/suites.go +++ b/tests/e2e/solidity/suites.go @@ -111,7 +111,11 @@ func executeHardHatTestOnNewBlockchain(ctx context.Context, test string) { log.Info("Executing HardHat tests on a new blockchain", "test", test) genesisFilePath := fmt.Sprintf("./tests/e2e/genesis/%s.json", test) - chainURI := createNewSubnet(ctx, genesisFilePath) + + createSubnetCtx, cancel := context.WithTimeout(ctx, 15*time.Second) + defer cancel() + + chainURI := createNewSubnet(createSubnetCtx, genesisFilePath) log.Info("Created subnet successfully", "ChainURI", chainURI) runHardhatTests(test, chainURI) From be1a108ae19c7da3c331e8b8672ccccb141860f7 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 12 Jan 2023 01:25:42 -0500 Subject: [PATCH 23/55] Set data dir from github action --- .github/workflows/lint-tests-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-tests-release.yml b/.github/workflows/lint-tests-release.yml index c4d9c647e5..7475c9e046 100644 --- a/.github/workflows/lint-tests-release.yml +++ b/.github/workflows/lint-tests-release.yml @@ -71,7 +71,7 @@ jobs: run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy - name: Run E2E Tests shell: bash - run: AVALANCHE_BINARY_PATH=/tmp/e2e-test/avalanchego/avalanchego ./scripts/run_ginkgo.sh + run: AVALANCHE_BINARY_PATH=/tmp/e2e-test/avalanchego/avalanchego DATA_DIR=/tmp/e2e-test/avalanchego ./scripts/run_ginkgo.sh simulator_test: name: Load testing with simulator From e908d13d24f27c00594346bc5da7c98192c08dd3 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 12 Jan 2023 01:28:38 -0500 Subject: [PATCH 24/55] Update run script --- scripts/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run.sh b/scripts/run.sh index 01d69330f2..4507c77176 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -198,7 +198,7 @@ $BIN control start \ --number-of-nodes=5 \ --avalanchego-path ${AVALANCHEGO_PATH} \ --plugin-dir ${AVALANCHEGO_PLUGIN_DIR} \ - --blockchain-specs '[{"vm_name": "subnetevm", "genesis": "'$GENESIS_FILE_PATH'"}]' + --blockchain-specs '[{"vm_name": "subnetevm", "genesis": "'$GENESIS_FILE_PATH'"}]' & # e.g., "RUN_SIMULATOR=true scripts/run.sh" to launch network runner + simulator if [[ ${RUN_SIMULATOR} == true ]]; then From 1793101e8850ce9fb2a6002a27811a48e06336f7 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 12 Jan 2023 13:47:01 -0500 Subject: [PATCH 25/55] Create separate load test for ginkgo --- scripts/run.sh | 73 +------------------ scripts/run_ginkgo.sh | 10 ++- scripts/run_single_node.sh | 3 +- tests/load/load_test.go | 60 +++++++++++++++ .../genesis/contract_deployer_allow_list.json | 0 .../genesis/contract_native_minter.json | 0 .../genesis/fee_manager.json | 0 .../genesis/reward_manager.json | 0 .../genesis/tx_allow_list.json | 0 .../precompile_test.go} | 16 ++-- tests/{e2e => precompile}/solidity/suites.go | 48 ++++++------ tests/{e2e => precompile}/utils/command.go | 0 tests/{e2e => precompile}/utils/constants.go | 0 tests/{e2e => precompile}/utils/evm_client.go | 0 14 files changed, 108 insertions(+), 102 deletions(-) mode change 100755 => 100644 scripts/run.sh create mode 100644 tests/load/load_test.go rename tests/{e2e => precompile}/genesis/contract_deployer_allow_list.json (100%) rename tests/{e2e => precompile}/genesis/contract_native_minter.json (100%) rename tests/{e2e => precompile}/genesis/fee_manager.json (100%) rename tests/{e2e => precompile}/genesis/reward_manager.json (100%) rename tests/{e2e => precompile}/genesis/tx_allow_list.json (100%) rename tests/{e2e/e2e_test.go => precompile/precompile_test.go} (75%) rename tests/{e2e => precompile}/solidity/suites.go (80%) rename tests/{e2e => precompile}/utils/command.go (100%) rename tests/{e2e => precompile}/utils/constants.go (100%) rename tests/{e2e => precompile}/utils/evm_client.go (100%) diff --git a/scripts/run.sh b/scripts/run.sh old mode 100755 new mode 100644 index 4507c77176..e5e65db3f6 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -6,9 +6,6 @@ set -e # run a 5 node network with the avalanche-network-runner # ./scripts/run.sh # -# run a 5 node network with the load simulator -# RUN_SIMULATOR=true ./scripts/run.sh -# # run without e2e tests with DEBUG log level # AVALANCHE_LOG_LEVEL=DEBUG ./scripts/run.sh if ! [[ "$0" =~ scripts/run.sh ]]; then @@ -32,18 +29,12 @@ VERSION=$avalanche_version DEFAULT_ACCOUNT="0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC" GENESIS_ADDRESS=${GENESIS_ADDRESS-$DEFAULT_ACCOUNT} -SKIP_NETWORK_RUNNER_START=${SKIP_NETWORK_RUNNER_START:-false} -SKIP_NETWORK_RUNNER_SHUTDOWN=${SKIP_NETWORK_RUNNER_SHUTDOWN:-true} -RUN_SIMULATOR=${RUN_SIMULATOR:-false} ANR_VERSION=$network_runner_version echo "Running with:" echo AVALANCHE_VERSION: ${VERSION} echo ANR_VERSION: ${ANR_VERSION} echo GENESIS_ADDRESS: ${GENESIS_ADDRESS} -echo SKIP_NETWORK_RUNNER_START: ${SKIP_NETWORK_RUNNER_START} -echo SKIP_NETWORK_RUNNER_SHUTDOWN: ${SKIP_NETWORK_RUNNER_SHUTDOWN} -echo RUN_SIMULATOR: ${RUN_SIMULATOR} ############################ # download avalanchego @@ -159,81 +150,25 @@ go install -v ${ANR_REPO_PATH}@${ANR_VERSION} GOPATH=$(go env GOPATH) if [[ -z ${GOBIN+x} ]]; then # no gobin set - BIN=${GOPATH}/bin/avalanche-network-runner + ANR_BIN=${GOPATH}/bin/avalanche-network-runner else # gobin set - BIN=${GOBIN}/avalanche-network-runner + ANR_BIN=${GOBIN}/avalanche-network-runner fi echo "launch avalanche-network-runner in the background" # Start network runner server -$BIN server \ +$ANR_BIN server \ --log-level debug \ --port=":12342" \ --grpc-gateway-port=":12343" & PID=${!} -# Define command to run the simulator -run_simulator() { - ################################# - echo "building simulator" - pushd ./cmd/simulator - go install -v . - popd - - echo "running simulator" - simulator \ - --cluster-info-yaml=$BASEDIR/avalanchego-${VERSION}/output.yaml \ - --keys=./cmd/simulator/.simulator/keys \ - --timeout=30s \ - --concurrency=10 \ - --base-fee=25 \ - --priority-fee=1 -} - # Start the network with the defined blockchain specs -$BIN control start \ +$ANR_BIN control start \ --log-level debug \ --endpoint="0.0.0.0:12342" \ --number-of-nodes=5 \ --avalanchego-path ${AVALANCHEGO_PATH} \ --plugin-dir ${AVALANCHEGO_PLUGIN_DIR} \ --blockchain-specs '[{"vm_name": "subnetevm", "genesis": "'$GENESIS_FILE_PATH'"}]' & - -# e.g., "RUN_SIMULATOR=true scripts/run.sh" to launch network runner + simulator -if [[ ${RUN_SIMULATOR} == true ]]; then - run_simulator - # to fail the script if simulator failed - EXIT_CODE=$? -fi - -################################# -if [[ ${SKIP_NETWORK_RUNNER_SHUTDOWN} == false ]]; then - $BIN control stop \ - --log-level debug \ - --endpoint="0.0.0.0:12342" - - $BIN server stop \ - --log-level debug \ - --endpoint="0.0.0.0:12342" - - # just in case tests are aborted, manually terminate them again - echo "network-runner RPC server was running on PID ${PID} as test mode; terminating the process..." - pkill -P ${PID} || true - kill -2 ${PID} - pkill -9 -f srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy || true # in case pkill didn't work -else - echo "network-runner RPC server is running on PID ${PID}..." - echo "" - echo "use the following command to terminate via avalanche-network-runner:" - echo "" - echo ''$BIN' control stop --log-level debug --endpoint="0.0.0.0:12342"' - echo ''$BIN' server stop --log-level debug --endpoint="0.0.0.0:12342"' - echo "" - echo "use the following command to terminate forcefully:" - echo "" - echo "pkill -P ${PID} && kill -2 ${PID} && pkill -9 -f srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy" - echo "" -fi - -exit ${EXIT_CODE} diff --git a/scripts/run_ginkgo.sh b/scripts/run_ginkgo.sh index 1cecc85d3a..3def4706cd 100755 --- a/scripts/run_ginkgo.sh +++ b/scripts/run_ginkgo.sh @@ -14,15 +14,19 @@ SUBNET_EVM_PATH=$( source "$SUBNET_EVM_PATH"/scripts/versions.sh # Build ginkgo -echo "building e2e.test" +echo "building precompile.test" # to install the ginkgo binary (required for test build and run) go install -v github.com/onsi/ginkgo/v2/ginkgo@${ginkgo_version} -ACK_GINKGO_RC=true ginkgo build ./tests/e2e +ACK_GINKGO_RC=true ginkgo build ./tests/precompile ./tests/load # By default, it runs all e2e test cases! # Use "--ginkgo.skip" to skip tests. # Use "--ginkgo.focus" to select tests. -./tests/e2e/e2e.test \ +./tests/precompile/precompile.test \ + --ginkgo.vv \ + --ginkgo.label-filter=${GINKGO_LABEL_FILTER:-""} + +./tests/load/load.test \ --ginkgo.vv \ --ginkgo.label-filter=${GINKGO_LABEL_FILTER:-""} diff --git a/scripts/run_single_node.sh b/scripts/run_single_node.sh index 9e25d4189b..44110bc3ff 100755 --- a/scripts/run_single_node.sh +++ b/scripts/run_single_node.sh @@ -34,7 +34,8 @@ CONFIG_FILE_PATH=$DATA_DIR/config.json "network-health-min-conn-peers": 0, "network-health-max-time-since-msg-received": 4611686018427387904, "network-health-max-time-since-msg-sent": 4611686018427387904, - "health-check-frequency": "5s" + "health-check-frequency": "5s", + "plugin-dir": "$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins" } EOF diff --git a/tests/load/load_test.go b/tests/load/load_test.go new file mode 100644 index 0000000000..9f7b75d2b2 --- /dev/null +++ b/tests/load/load_test.go @@ -0,0 +1,60 @@ +// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +// e2e implements the e2e tests. +package load + +import ( + "context" + "os" + "testing" + "time" + + "github.com/ava-labs/avalanchego/api/health" + "github.com/ava-labs/subnet-evm/tests/precompile/utils" + "github.com/ethereum/go-ethereum/log" + "github.com/go-cmd/cmd" + ginkgo "github.com/onsi/ginkgo/v2" + "github.com/onsi/gomega" +) + +var startCmd *cmd.Cmd + +func TestE2E(t *testing.T) { + gomega.RegisterFailHandler(ginkgo.Fail) + ginkgo.RunSpecs(t, "subnet-evm e2e test suites") + // TODO: register a subpackage containing the specs +} + +var _ = ginkgo.Describe("[Fingers Crossed]", ginkgo.Ordered, func() { + ginkgo.It("don't break it", ginkgo.Label("lol"), func() { + log.Info("Wait wait don't tell me") + }) +}) + +// BeforeSuite starts an AvalancheGo process to use for the e2e tests +var _ = ginkgo.BeforeSuite(func() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + var err error + wd, err := os.Getwd() + gomega.Expect(err).Should(gomega.BeNil()) + log.Info("Starting AvalancheGo node", "wd", wd) + startCmd, err = utils.RunCommand("./scripts/run_single_node.sh") + gomega.Expect(err).Should(gomega.BeNil()) + + // Assumes that startCmd will launch a node with HTTP Port at [utils.DefaultLocalNodeURI] + healthClient := health.NewClient(utils.DefaultLocalNodeURI) + healthy, err := health.AwaitReady(ctx, healthClient, 5*time.Second) + gomega.Expect(err).Should(gomega.BeNil()) + gomega.Expect(healthy).Should(gomega.BeTrue()) + log.Info("AvalancheGo node is healthy") +}) + +var _ = ginkgo.AfterSuite(func() { + gomega.Expect(startCmd).ShouldNot(gomega.BeNil()) + gomega.Expect(startCmd.Stop()).Should(gomega.BeNil()) + // TODO add a new node to bootstrap off of the existing node and ensure it can bootstrap all subnets + // created during the test +}) diff --git a/tests/e2e/genesis/contract_deployer_allow_list.json b/tests/precompile/genesis/contract_deployer_allow_list.json similarity index 100% rename from tests/e2e/genesis/contract_deployer_allow_list.json rename to tests/precompile/genesis/contract_deployer_allow_list.json diff --git a/tests/e2e/genesis/contract_native_minter.json b/tests/precompile/genesis/contract_native_minter.json similarity index 100% rename from tests/e2e/genesis/contract_native_minter.json rename to tests/precompile/genesis/contract_native_minter.json diff --git a/tests/e2e/genesis/fee_manager.json b/tests/precompile/genesis/fee_manager.json similarity index 100% rename from tests/e2e/genesis/fee_manager.json rename to tests/precompile/genesis/fee_manager.json diff --git a/tests/e2e/genesis/reward_manager.json b/tests/precompile/genesis/reward_manager.json similarity index 100% rename from tests/e2e/genesis/reward_manager.json rename to tests/precompile/genesis/reward_manager.json diff --git a/tests/e2e/genesis/tx_allow_list.json b/tests/precompile/genesis/tx_allow_list.json similarity index 100% rename from tests/e2e/genesis/tx_allow_list.json rename to tests/precompile/genesis/tx_allow_list.json diff --git a/tests/e2e/e2e_test.go b/tests/precompile/precompile_test.go similarity index 75% rename from tests/e2e/e2e_test.go rename to tests/precompile/precompile_test.go index c0bc84b827..fffdc42eb3 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/precompile/precompile_test.go @@ -2,21 +2,22 @@ // See the file LICENSE for licensing terms. // e2e implements the e2e tests. -package e2e +package precompile import ( "context" + "os" "testing" "time" "github.com/ava-labs/avalanchego/api/health" - "github.com/ava-labs/subnet-evm/tests/e2e/utils" + "github.com/ava-labs/subnet-evm/tests/precompile/utils" "github.com/ethereum/go-ethereum/log" "github.com/go-cmd/cmd" ginkgo "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" - _ "github.com/ava-labs/subnet-evm/tests/e2e/solidity" + _ "github.com/ava-labs/subnet-evm/tests/precompile/solidity" ) var startCmd *cmd.Cmd @@ -28,14 +29,19 @@ func TestE2E(t *testing.T) { // BeforeSuite starts an AvalancheGo process to use for the e2e tests var _ = ginkgo.BeforeSuite(func() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + var err error - log.Info("Starting AvalancheGo node") + wd, err := os.Getwd() + gomega.Expect(err).Should(gomega.BeNil()) + log.Info("Starting AvalancheGo node", "wd", wd) startCmd, err = utils.RunCommand("./scripts/run_single_node.sh") gomega.Expect(err).Should(gomega.BeNil()) // Assumes that startCmd will launch a node with HTTP Port at [utils.DefaultLocalNodeURI] healthClient := health.NewClient(utils.DefaultLocalNodeURI) - healthy, err := health.AwaitReady(context.Background(), healthClient, 5*time.Second) + healthy, err := health.AwaitReady(ctx, healthClient, 5*time.Second) gomega.Expect(err).Should(gomega.BeNil()) gomega.Expect(healthy).Should(gomega.BeTrue()) log.Info("AvalancheGo node is healthy") diff --git a/tests/e2e/solidity/suites.go b/tests/precompile/solidity/suites.go similarity index 80% rename from tests/e2e/solidity/suites.go rename to tests/precompile/solidity/suites.go index 2a950b47c9..3cc631e391 100644 --- a/tests/e2e/solidity/suites.go +++ b/tests/precompile/solidity/suites.go @@ -20,7 +20,7 @@ import ( wallet "github.com/ava-labs/avalanchego/wallet/subnet/primary" "github.com/ava-labs/subnet-evm/core" "github.com/ava-labs/subnet-evm/plugin/evm" - "github.com/ava-labs/subnet-evm/tests/e2e/utils" + "github.com/ava-labs/subnet-evm/tests/precompile/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" ginkgo "github.com/onsi/ginkgo/v2" @@ -110,7 +110,7 @@ func createNewSubnet(ctx context.Context, genesisFilePath string) string { func executeHardHatTestOnNewBlockchain(ctx context.Context, test string) { log.Info("Executing HardHat tests on a new blockchain", "test", test) - genesisFilePath := fmt.Sprintf("./tests/e2e/genesis/%s.json", test) + genesisFilePath := fmt.Sprintf("./tests/precompile/genesis/%s.json", test) createSubnetCtx, cancel := context.WithTimeout(ctx, 15*time.Second) defer cancel() @@ -123,7 +123,7 @@ func executeHardHatTestOnNewBlockchain(ctx context.Context, test string) { // TODO: can we move where we register the precompile e2e tests, so that they stay within their package var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { - // Each ginkgo It node specifies the name of the genesis file (in ./tests/e2e/genesis/) + // Each ginkgo It node specifies the name of the genesis file (in ./tests/precompile/genesis/) //to use to launch the subnet and the name of the TS test file to run on the subnet (in ./contract-examples/tests/) ginkgo.It("contract native minter", ginkgo.Label("solidity-with-npx"), func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) @@ -132,33 +132,33 @@ var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { executeHardHatTestOnNewBlockchain(ctx, "contract_native_minter") }) - ginkgo.It("tx allow list", ginkgo.Label("solidity-with-npx"), func() { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() + // ginkgo.It("tx allow list", ginkgo.Label("solidity-with-npx"), func() { + // ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + // defer cancel() - executeHardHatTestOnNewBlockchain(ctx, "tx_allow_list") - }) + // executeHardHatTestOnNewBlockchain(ctx, "tx_allow_list") + // }) - ginkgo.It("contract deployer allow list", ginkgo.Label("solidity-with-npx"), func() { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() + // ginkgo.It("contract deployer allow list", ginkgo.Label("solidity-with-npx"), func() { + // ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + // defer cancel() - executeHardHatTestOnNewBlockchain(ctx, "contract_deployer_allow_list") - }) + // executeHardHatTestOnNewBlockchain(ctx, "contract_deployer_allow_list") + // }) - ginkgo.It("fee manager", ginkgo.Label("solidity-with-npx"), func() { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() + // ginkgo.It("fee manager", ginkgo.Label("solidity-with-npx"), func() { + // ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + // defer cancel() - executeHardHatTestOnNewBlockchain(ctx, "fee_manager") - }) + // executeHardHatTestOnNewBlockchain(ctx, "fee_manager") + // }) - ginkgo.It("reward manager", ginkgo.Label("solidity-with-npx"), func() { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() + // ginkgo.It("reward manager", ginkgo.Label("solidity-with-npx"), func() { + // ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + // defer cancel() - executeHardHatTestOnNewBlockchain(ctx, "reward_manager") - }) + // executeHardHatTestOnNewBlockchain(ctx, "reward_manager") + // }) // ADD YOUR PRECOMPILE HERE /* @@ -166,7 +166,7 @@ var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - // Specify the name shared by the genesis file in ./tests/e2e/genesis/{your_precompile}.json + // Specify the name shared by the genesis file in ./tests/precompile/genesis/{your_precompile}.json // and the test file in ./contract-examples/tests/{your_precompile}.ts executeHardHatTestOnNewBlockchain(ctx, "your_precompile") }) diff --git a/tests/e2e/utils/command.go b/tests/precompile/utils/command.go similarity index 100% rename from tests/e2e/utils/command.go rename to tests/precompile/utils/command.go diff --git a/tests/e2e/utils/constants.go b/tests/precompile/utils/constants.go similarity index 100% rename from tests/e2e/utils/constants.go rename to tests/precompile/utils/constants.go diff --git a/tests/e2e/utils/evm_client.go b/tests/precompile/utils/evm_client.go similarity index 100% rename from tests/e2e/utils/evm_client.go rename to tests/precompile/utils/evm_client.go From e00366bb689c8020e69b538aa1157b4b9d4230fa Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 12 Jan 2023 17:15:14 -0500 Subject: [PATCH 26/55] Refactor scripts --- go.mod | 29 ++-- go.sum | 66 ++++++--- scripts/build.sh | 8 +- scripts/build_image.sh | 10 +- scripts/constants.sh | 22 +-- scripts/install_anr_release.sh | 30 ++++ scripts/install_avalanchego_release.sh | 2 +- scripts/run.sh | 53 ++----- scripts/run_ginkgo.sh | 2 +- scripts/run_single_node.sh | 9 +- scripts/versions.sh | 12 +- tests/load/load_test.go | 189 ++++++++++++++++++++----- 12 files changed, 292 insertions(+), 140 deletions(-) create mode 100644 scripts/install_anr_release.sh diff --git a/go.mod b/go.mod index aecd753176..f421489fa9 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.18 require ( github.com/VictoriaMetrics/fastcache v1.10.0 + github.com/ava-labs/avalanche-network-runner v1.3.5 github.com/ava-labs/avalanchego v1.9.6 github.com/cespare/cp v0.1.0 github.com/davecgh/go-spew v1.1.1 @@ -13,7 +14,7 @@ require ( github.com/fsnotify/fsnotify v1.6.0 github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 github.com/go-cmd/cmd v1.4.1 - github.com/google/uuid v1.2.0 + github.com/google/uuid v1.3.0 github.com/gorilla/rpc v1.2.0 github.com/gorilla/websocket v1.4.2 github.com/hashicorp/go-bexpr v0.1.10 @@ -23,10 +24,10 @@ 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.4.0 - github.com/onsi/gomega v1.24.0 - github.com/prometheus/client_golang v1.13.0 - github.com/prometheus/client_model v0.2.0 + github.com/onsi/ginkgo/v2 v2.6.1 + github.com/onsi/gomega v1.24.2 + github.com/prometheus/client_golang v1.14.0 + github.com/prometheus/client_model v0.3.0 github.com/rjeczalik/notify v0.9.2 github.com/shirou/gopsutil v3.21.11+incompatible github.com/spf13/cast v1.5.0 @@ -39,14 +40,16 @@ require ( github.com/urfave/cli/v2 v2.10.2 golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d golang.org/x/sync v0.1.0 - golang.org/x/sys v0.1.0 - golang.org/x/text v0.4.0 + golang.org/x/sys v0.3.0 + golang.org/x/text v0.5.0 golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac gopkg.in/urfave/cli.v1 v1.20.0 ) require ( + github.com/Microsoft/go-winio v0.5.2 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect + github.com/ava-labs/coreth v0.11.6-rc.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/btcutil v1.1.3 // indirect @@ -71,7 +74,7 @@ require ( 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.12.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // 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 @@ -80,6 +83,7 @@ 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/magiconair/properties v1.8.6 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect @@ -91,6 +95,7 @@ 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.9.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 @@ -122,11 +127,11 @@ require ( go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.24.0 // indirect golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5 // indirect - golang.org/x/net v0.1.0 // indirect - golang.org/x/term v0.1.0 // indirect + golang.org/x/net v0.4.0 // indirect + golang.org/x/term v0.3.0 // indirect gonum.org/v1/gonum v0.11.0 // indirect - google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c // indirect - google.golang.org/grpc v1.51.0-dev // indirect + google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 // indirect + google.golang.org/grpc v1.53.0-dev // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/ini.v1 v1.66.4 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect diff --git a/go.sum b/go.sum index d763203316..6276681748 100644 --- a/go.sum +++ b/go.sum @@ -44,6 +44,8 @@ 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= @@ -61,8 +63,12 @@ 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.3.5 h1:l5rHPQBXrApXRtGrTq2ZIJ5a7f/sFjlkeheQ4kYjjtI= +github.com/ava-labs/avalanche-network-runner v1.3.5/go.mod h1:nrlPZ+vPCZ8lNF9XXwYtgZ57dkEpwF+sgRRppass0pE= github.com/ava-labs/avalanchego v1.9.6 h1:xDLo7iVf73ohgR3alhRJcEalM7B8Pi5HkgCesl8lkf8= github.com/ava-labs/avalanchego v1.9.6/go.mod h1:ckdSQHeoRN6PmQ3TLgWAe6Kh9tFpU4Lu6MgDW4GrU/Q= +github.com/ava-labs/coreth v0.11.6-rc.0 h1:P8g/vqVx7nZBUHhM95oq9bcsY37P1Y7NNVb7RPe0mW8= +github.com/ava-labs/coreth v0.11.6-rc.0/go.mod h1:xgjjJdl50zhHlWPP+3Ux5LxfvFcbSG60tGK6QUkFDhI= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= 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= @@ -72,6 +78,7 @@ github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+Wji 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.0 h1:V2/ZgjfDFIygAX3ZapeigkVBoVUtOJKSwrhZdlpSvaA= github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= @@ -281,8 +288,8 @@ github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= @@ -299,8 +306,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92Bcuy 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.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.12.0 h1:kr3j8iIMR4ywO/O0rvksXaJvauGGCMg2zAZIiNZ9uIQ= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.12.0/go.mod h1:ummNFgdgLhhX7aIiy35vVmQNS0rWXknfPE0qe6fmFXg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 h1:1JYBfzqrWPcCclBwxFCPAou9n+q86mfnu7NAeHfte7A= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0/go.mod h1:YDZoGHuwE+ov0c8smSH49WLF3F2LaWnYYuDVd+EWrc0= 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,6 +347,8 @@ 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= @@ -440,20 +449,27 @@ github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vv 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.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= -github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= +github.com/onsi/ginkgo/v2 v2.6.1 h1:1xQPCjcqYw/J5LchOcp4/2q/jzJFjiAOc25chhnDw+Q= +github.com/onsi/ginkgo/v2 v2.6.1/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo= 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= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.24.0 h1:+0glovB9Jd6z3VR+ScSwQqXVTIfJcGA9UBM8yzQxhqg= -github.com/onsi/gomega v1.24.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= +github.com/onsi/gomega v1.24.2 h1:J/tulyYK6JwBldPViHJReihxxZ+22FHs0piGjQAvoUE= +github.com/onsi/gomega v1.24.2/go.mod h1:gs3J10IS7Z7r7eXRoNJIrNqU4ToQukCJhFtKrWgHWnk= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= 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.9.0 h1:7KFNiCgZ91Ru4qW4CWPf/7jqtxLagGRmIxWldPP9VY4= +github.com/otiai10/copy v1.9.0/go.mod h1:hsfX19wcn0UWIHUQ3/4fHuehhk2UyArQ9dVFAn3FczI= +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.4.0 h1:umwcf7gbpEwf7WFzqmWwSv0CzbeMsae2u9ZvpP8j2q4= +github.com/otiai10/mint v1.4.0/go.mod h1:gifjb2MYOoULtKLqUAEILUG/9KONW6f7YsJ6vQLTlFI= 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= @@ -477,13 +493,14 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= -github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= @@ -518,6 +535,7 @@ 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= @@ -541,6 +559,7 @@ github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969/go.mod h1:RZL 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.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -714,8 +733,8 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -810,14 +829,15 @@ golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -827,8 +847,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -969,8 +989,8 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c h1:QgY/XxIAIeccR+Ca/rDdKubLIU9rcJ3xfy1DC/Wd2Oo= -google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= +google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 h1:jmIfw8+gSvXcZSgaFAGyInDXeWzUhvYH57G/5GKMn70= +google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -991,8 +1011,8 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.51.0-dev h1:JIZpGUpbGAukP4rGiKJ/AnpK9BqMYV6Rdx94XWZckHY= -google.golang.org/grpc v1.51.0-dev/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.53.0-dev h1:Bi96+XIrXJLXPJUff19tRXb7mIijir7agn12zNMaPAg= +google.golang.org/grpc v1.53.0-dev/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/scripts/build.sh b/scripts/build.sh index deb5713e0d..d6da71d6ed 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -40,14 +40,14 @@ source "$SUBNET_EVM_PATH"/scripts/versions.sh source "$SUBNET_EVM_PATH"/scripts/constants.sh if [[ $# -eq 1 ]]; then - binary_path=$1 + BINARY_PATH=$1 elif [[ $# -eq 0 ]]; then - binary_path="$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy" + BINARY_PATH="$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy" else echo "Invalid arguments to build subnet-evm. Requires zero (default location) or one argument to specify binary location." exit 1 fi # Build Subnet EVM, which is run as a subprocess -echo "Building Subnet EVM Version: $subnet_evm_version at $binary_path" -go build -ldflags "-X github.com/ava-labs/subnet-evm/plugin/evm.GitCommit=$subnet_evm_commit -X github.com/ava-labs/subnet-evm/plugin/evm.Version=$subnet_evm_version $static_ld_flags" -o "$binary_path" "plugin/"*.go +echo "Building Subnet EVM Version: $SUBNET_EVM_VERSION at $BINARY_PATH" +go build -ldflags "-X github.com/ava-labs/subnet-evm/plugin/evm.GitCommit=$SUBNET_EVM_COMMIT -X github.com/ava-labs/subnet-evm/plugin/evm.Version=$SUBNET_EVM_VERSION $STATIC_LD_FLAGS" -o "$BINARY_PATH" "plugin/"*.go diff --git a/scripts/build_image.sh b/scripts/build_image.sh index 06e2705b38..48c3b93117 100755 --- a/scripts/build_image.sh +++ b/scripts/build_image.sh @@ -13,8 +13,8 @@ source "$SUBNET_EVM_PATH"/scripts/versions.sh # Load the constants source "$SUBNET_EVM_PATH"/scripts/constants.sh -echo "Building Docker Image: $dockerhub_repo:$build_image_id based of $avalanche_version" -docker build -t "$dockerhub_repo:$build_image_id" "$SUBNET_EVM_PATH" -f "$SUBNET_EVM_PATH/Dockerfile" \ - --build-arg AVALANCHE_VERSION="$avalanche_version" \ - --build-arg SUBNET_EVM_COMMIT="$subnet_evm_commit" \ - --build-arg CURRENT_BRANCH="$current_branch" +echo "Building Docker Image: $DOCKERHUB_REPO:$BUILD_IMAGE_ID based of $AVALANCHEGO_VERSION" +docker build -t "$DOCKERHUB_REPO:$BUILD_IMAGE_ID" "$SUBNET_EVM_PATH" -f "$SUBNET_EVM_PATH/Dockerfile" \ + --build-arg AVALANCHE_VERSION="$AVALANCHEGO_VERSION" \ + --build-arg SUBNET_EVM_COMMIT="$SUBNET_EVM_COMMIT" \ + --build-arg CURRENT_BRANCH="$CURRENT_BRANCH" diff --git a/scripts/constants.sh b/scripts/constants.sh index a58f910926..3a8aca35df 100644 --- a/scripts/constants.sh +++ b/scripts/constants.sh @@ -4,37 +4,37 @@ GOPATH="$(go env GOPATH)" # Avalabs docker hub -dockerhub_repo="avaplatform/avalanchego" +DOCKERHUB_REPO="avaplatform/avalanchego" # if this isn't a git repository (say building from a release), don't set our git constants. if [ ! -d .git ] then - current_branch="" - subnet_evm_commit="" - subnet_evm_commit_id="" + CURRENT_BRANCH="" + SUBNET_EVM_COMMIT="" + SUBNET_EVM_COMMIT_ID="" else # Current branch - current_branch=${CURRENT_BRANCH:-$(git describe --tags --exact-match 2> /dev/null || git symbolic-ref -q --short HEAD || git rev-parse --short HEAD || :)} + CURRENT_BRANCH=${CURRENT_BRANCH:-$(git describe --tags --exact-match 2> /dev/null || git symbolic-ref -q --short HEAD || git rev-parse --short HEAD || :)} # Image build id # # Use an abbreviated version of the full commit to tag the image. # WARNING: this will use the most recent commit even if there are un-committed changes present - subnet_evm_commit="$(git --git-dir="$SUBNET_EVM_PATH/.git" rev-parse HEAD || :)" - subnet_evm_commit_id="${subnet_evm_commit::8}" + SUBNET_EVM_COMMIT="$(git --git-dir="$SUBNET_EVM_PATH/.git" rev-parse HEAD || :)" + SUBNET_EVM_COMMIT_ID="${SUBNET_EVM_COMMIT::8}" fi -echo "Using branch: ${current_branch}" +echo "Using branch: ${CURRENT_BRANCH}" -build_image_id=${BUILD_IMAGE_ID:-"$avalanche_version-$subnet_evm_commit_id"} +BUILD_IMAGE_ID=${BUILD_IMAGE_ID:-"$AVALANCHEGO_VERSION-$SUBNET_EVM_COMMIT_ID"} # Static compilation -static_ld_flags='' +STATIC_LD_FLAGS='' if [ "${STATIC_COMPILATION:-}" = 1 ] then export CC=musl-gcc command -v $CC || ( echo $CC must be available for static compilation && exit 1 ) - static_ld_flags=' -extldflags "-static" -linkmode external ' + STATIC_LD_FLAGS=' -extldflags "-static" -linkmode external ' fi # Set the CGO flags to use the portable version of BLST diff --git a/scripts/install_anr_release.sh b/scripts/install_anr_release.sh new file mode 100644 index 0000000000..d962c60ca1 --- /dev/null +++ b/scripts/install_anr_release.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -e + +# Load the versions +SUBNET_EVM_PATH=$( + cd "$(dirname "${BASH_SOURCE[0]}")" + cd .. && pwd +) +source "$SUBNET_EVM_PATH"/scripts/versions.sh + +# Load the constants +source "$SUBNET_EVM_PATH"/scripts/constants.sh + +################################# +# download avalanche-network-runner +# https://github.com/ava-labs/avalanche-network-runner +ANR_REPO_PATH=github.com/ava-labs/avalanche-network-runner +# version set +go install -v ${ANR_REPO_PATH}@${ANR_VERSION} + +################################# +# run "avalanche-network-runner" server +GOPATH=$(go env GOPATH) +if [[ -z ${GOBIN+x} ]]; then + # no gobin set + ANR_BIN=${GOPATH}/bin/avalanche-network-runner +else + # gobin set + ANR_BIN=${GOBIN}/avalanche-network-runner +fi \ No newline at end of file diff --git a/scripts/install_avalanchego_release.sh b/scripts/install_avalanchego_release.sh index edce4111bc..1cb381d254 100755 --- a/scripts/install_avalanchego_release.sh +++ b/scripts/install_avalanchego_release.sh @@ -11,7 +11,7 @@ source "$SUBNET_EVM_PATH"/scripts/versions.sh # Load the constants source "$SUBNET_EVM_PATH"/scripts/constants.sh -VERSION=$avalanche_version +VERSION=$AVALANCHEGO_VERSION ############################ # download avalanchego diff --git a/scripts/run.sh b/scripts/run.sh index e5e65db3f6..457b730dcf 100644 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -23,13 +23,9 @@ source "$SUBNET_EVM_PATH"/scripts/versions.sh # Load the constants source "$SUBNET_EVM_PATH"/scripts/constants.sh -VERSION=$avalanche_version +VERSION=$AVALANCHEGO_VERSION -# "ewoq" key -DEFAULT_ACCOUNT="0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC" -GENESIS_ADDRESS=${GENESIS_ADDRESS-$DEFAULT_ACCOUNT} - -ANR_VERSION=$network_runner_version +ANR_VERSION=$NETWORK_RUNNER_VERSION echo "Running with:" echo AVALANCHE_VERSION: ${VERSION} @@ -37,51 +33,28 @@ echo ANR_VERSION: ${ANR_VERSION} echo GENESIS_ADDRESS: ${GENESIS_ADDRESS} ############################ -# download avalanchego -# https://github.com/ava-labs/avalanchego/releases -GOARCH=$(go env GOARCH) -GOOS=$(go env GOOS) -BASEDIR=/tmp/subnet-evm-runner -mkdir -p ${BASEDIR} -AVAGO_DOWNLOAD_URL=https://github.com/ava-labs/avalanchego/releases/download/${VERSION}/avalanchego-linux-${GOARCH}-${VERSION}.tar.gz -AVAGO_DOWNLOAD_PATH=${BASEDIR}/avalanchego-linux-${GOARCH}-${VERSION}.tar.gz -if [[ ${GOOS} == "darwin" ]]; then - AVAGO_DOWNLOAD_URL=https://github.com/ava-labs/avalanchego/releases/download/${VERSION}/avalanchego-macos-${VERSION}.zip - AVAGO_DOWNLOAD_PATH=${BASEDIR}/avalanchego-macos-${VERSION}.zip -fi +# Download AvalancheGo release and populate environment variables +source "$SUBNET_EVM_PATH/scripts/install_avalanchego_release.sh" +echo "Installed AvalancheGo release ${VERSION}" +echo "AvalancheGo Path: ${AVALANCHEGO_PATH}" +echo "Plugin Dir: ${AVALANCHEGO_PLUGIN_DIR}" -AVAGO_FILEPATH=${BASEDIR}/avalanchego-${VERSION} -if [[ ! -d ${AVAGO_FILEPATH} ]]; then - if [[ ! -f ${AVAGO_DOWNLOAD_PATH} ]]; then - echo "downloading avalanchego ${VERSION} at ${AVAGO_DOWNLOAD_URL} to ${AVAGO_DOWNLOAD_PATH}" - curl -L ${AVAGO_DOWNLOAD_URL} -o ${AVAGO_DOWNLOAD_PATH} - fi - echo "extracting downloaded avalanchego to ${AVAGO_FILEPATH}" - if [[ ${GOOS} == "linux" ]]; then - mkdir -p ${AVAGO_FILEPATH} && tar xzvf ${AVAGO_DOWNLOAD_PATH} --directory ${AVAGO_FILEPATH} --strip-components 1 - elif [[ ${GOOS} == "darwin" ]]; then - echo 'unzip '${AVAGO_DOWNLOAD_PATH}' -d '${AVAGO_FILEPATH}'' - unzip ${AVAGO_DOWNLOAD_PATH} -d ${AVAGO_FILEPATH} - mv ${AVAGO_FILEPATH}/build/* ${AVAGO_FILEPATH} - rm -rf ${AVAGO_FILEPATH}/build/ - fi - find ${BASEDIR}/avalanchego-${VERSION} -fi +# "ewoq" key +DEFAULT_ACCOUNT="0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC" +GENESIS_ADDRESS=${GENESIS_ADDRESS-$DEFAULT_ACCOUNT} -AVALANCHEGO_PATH=${AVAGO_FILEPATH}/avalanchego -AVALANCHEGO_PLUGIN_DIR=${AVAGO_FILEPATH}/plugins ################################# # compile subnet-evm # Check if SUBNET_EVM_COMMIT is set, if not retrieve the last commit from the repo. # This is used in the Dockerfile to allow a commit hash to be passed in without # including the .git/ directory within the Docker image. -subnet_evm_commit=${SUBNET_EVM_COMMIT:-$(git rev-list -1 HEAD)} +SUBNET_EVM_COMMIT=${SUBNET_EVM_COMMIT:-$(git rev-list -1 HEAD)} # Build Subnet EVM, which is run as a subprocess -echo "Building Subnet EVM Version: $subnet_evm_version; GitCommit: $subnet_evm_commit" +echo "Building Subnet EVM Version: $SUBNET_EVM_VERSION; GitCommit: $SUBNET_EVM_COMMIT" go build \ - -ldflags "-X github.com/ava-labs/subnet_evm/plugin/evm.GitCommit=$subnet_evm_commit -X github.com/ava-labs/subnet_evm/plugin/evm.Version=$subnet_evm_version" \ + -ldflags "-X github.com/ava-labs/subnet_evm/plugin/evm.GitCommit=$SUBNET_EVM_COMMIT -X github.com/ava-labs/subnet_evm/plugin/evm.Version=$SUBNET_EVM_VERSION" \ -o $AVALANCHEGO_PLUGIN_DIR/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy \ "plugin/"*.go diff --git a/scripts/run_ginkgo.sh b/scripts/run_ginkgo.sh index 3def4706cd..38db56aa8b 100755 --- a/scripts/run_ginkgo.sh +++ b/scripts/run_ginkgo.sh @@ -16,7 +16,7 @@ source "$SUBNET_EVM_PATH"/scripts/versions.sh # Build ginkgo echo "building precompile.test" # to install the ginkgo binary (required for test build and run) -go install -v github.com/onsi/ginkgo/v2/ginkgo@${ginkgo_version} +go install -v github.com/onsi/ginkgo/v2/ginkgo@${GINKGO_VERSION} ACK_GINKGO_RC=true ginkgo build ./tests/precompile ./tests/load diff --git a/scripts/run_single_node.sh b/scripts/run_single_node.sh index 44110bc3ff..47b160e526 100755 --- a/scripts/run_single_node.sh +++ b/scripts/run_single_node.sh @@ -19,7 +19,8 @@ source "$SUBNET_EVM_PATH"/scripts/versions.sh source "$SUBNET_EVM_PATH"/scripts/constants.sh # Set up avalanche binary path and assume build directory is set -AVALANCHE_BINARY_PATH=${AVALANCHE_BINARY_PATH:-"$GOPATH/src/github.com/ava-labs/avalanchego/build/avalanchego"} +AVALANCHEGO_PATH=${AVALANCHEGO_PATH:-"$GOPATH/src/github.com/ava-labs/avalanchego/build/avalanchego"} +AVALANCHEGO_PLUGIN_DIR=${AVALANCHEGO_PATH:-"$AVALANCHEGO_PATH/plugins"} DATA_DIR=${DATA_DIR:-/tmp/subnet-evm-start-node/$(date "+%Y-%m-%d%:%H:%M:%S")} # Create node config in DATA_DIR @@ -35,14 +36,14 @@ CONFIG_FILE_PATH=$DATA_DIR/config.json "network-health-max-time-since-msg-received": 4611686018427387904, "network-health-max-time-since-msg-sent": 4611686018427387904, "health-check-frequency": "5s", - "plugin-dir": "$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins" + "plugin-dir": "$AVALANCHEGO_PLUGIN_DIR" } EOF echo "Starting AvalancheGo node" -echo "AvalancheGo Binary Path: ${AVALANCHE_BINARY_PATH}" +echo "AvalancheGo Binary Path: ${AVALANCHEGO_PATH}" echo "Data directory: ${DATA_DIR}" echo "Config file: ${CONFIG_FILE_PATH}" # Run the node -$AVALANCHE_BINARY_PATH --data-dir=$DATA_DIR --config-file=$CONFIG_FILE_PATH +$AVALANCHEGO_PATH --data-dir=$DATA_DIR --config-file=$CONFIG_FILE_PATH diff --git a/scripts/versions.sh b/scripts/versions.sh index efda33f826..21917e12a3 100644 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash -# Set up the versions to be used -subnet_evm_version=${SUBNET_EVM_VERSION:-'v0.4.8'} +# Set up the versions to be used - populate ENV variables only if they are not already populated +SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-'v0.4.8'} # Don't export them as they're used in the context of other calls -avalanche_version=${AVALANCHE_VERSION:-'v1.9.6'} -network_runner_version=${NETWORK_RUNNER_VERSION:-'v1.3.5'} -ginkgo_version=${GINKGO_VERSION:-'v2.2.0'} +AVALANCHEGO_VERSION=${AVALANCHE_VERSION:-'v1.9.6'} +NETWORK_RUNNER_VERSION=${NETWORK_RUNNER_VERSION:-'v1.3.5'} +GINKGO_VERSION=${GINKGO_VERSION:-'v2.2.0'} # This won't be used, but it's here to make code syncs easier -latest_coreth_version=0.11.3 +LATEST_CORETH_VERSION=0.11.3 diff --git a/tests/load/load_test.go b/tests/load/load_test.go index 9f7b75d2b2..ca4c4e7f17 100644 --- a/tests/load/load_test.go +++ b/tests/load/load_test.go @@ -6,55 +6,178 @@ package load import ( "context" + "flag" + "fmt" "os" "testing" "time" - "github.com/ava-labs/avalanchego/api/health" - "github.com/ava-labs/subnet-evm/tests/precompile/utils" - "github.com/ethereum/go-ethereum/log" - "github.com/go-cmd/cmd" + "github.com/ava-labs/avalanche-network-runner/client" + "github.com/ava-labs/avalanche-network-runner/rpcpb" + "github.com/ava-labs/avalanche-network-runner/utils/constants" + "github.com/ava-labs/avalanche-network-runner/ux" + "github.com/ava-labs/avalanchego/utils/logging" ginkgo "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" ) -var startCmd *cmd.Cmd - func TestE2E(t *testing.T) { gomega.RegisterFailHandler(ginkgo.Fail) - ginkgo.RunSpecs(t, "subnet-evm e2e test suites") - // TODO: register a subpackage containing the specs + ginkgo.RunSpecs(t, "load test") } -var _ = ginkgo.Describe("[Fingers Crossed]", ginkgo.Ordered, func() { - ginkgo.It("don't break it", ginkgo.Label("lol"), func() { - log.Info("Wait wait don't tell me") - }) -}) +// What do I need to be present here? +// AvalancheGo +// Plugin directory with plugin binary -// BeforeSuite starts an AvalancheGo process to use for the e2e tests -var _ = ginkgo.BeforeSuite(func() { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() +var ( + logLevel string + logDir string + gRPCEp string + gRPCGatewayEp string + execPath1 string + execPath2 string + subnetEvmPath string + + newNodeName = "test-add-node" + customNodeConfigs = map[string]string{ + "node1": `{"api-admin-enabled":true}`, + "node2": `{"api-admin-enabled":true}`, + "node3": `{"api-admin-enabled":true}`, + "node4": `{"api-admin-enabled":false}`, + "node5": `{"api-admin-enabled":false}`, + "node6": `{"api-admin-enabled":false}`, + "node7": `{"api-admin-enabled":false}`, + } + numNodes = uint32(5) +) + +func init() { + flag.StringVar( + &logLevel, + "log-level", + logging.Info.String(), + "log level", + ) + flag.StringVar( + &logDir, + "log-dir", + "", + "log directory", + ) + flag.StringVar( + &gRPCEp, + "grpc-endpoint", + "0.0.0.0:8080", + "gRPC server endpoint", + ) + flag.StringVar( + &gRPCGatewayEp, + "grpc-gateway-endpoint", + "0.0.0.0:8081", + "gRPC gateway endpoint", + ) + flag.StringVar( + &execPath1, + "avalanchego-path-1", + "", + "avalanchego executable path (to upgrade from)", + ) + flag.StringVar( + &execPath2, + "avalanchego-path-2", + "", + "avalanchego executable path (to upgrade to)", + ) + flag.StringVar( + &subnetEvmPath, + "subnet-evm-path", + "", + "path to subnet-evm binary", + ) +} + +var ( + cli client.Client + log logging.Logger +) + +var _ = ginkgo.BeforeSuite(func() { var err error - wd, err := os.Getwd() - gomega.Expect(err).Should(gomega.BeNil()) - log.Info("Starting AvalancheGo node", "wd", wd) - startCmd, err = utils.RunCommand("./scripts/run_single_node.sh") - gomega.Expect(err).Should(gomega.BeNil()) - - // Assumes that startCmd will launch a node with HTTP Port at [utils.DefaultLocalNodeURI] - healthClient := health.NewClient(utils.DefaultLocalNodeURI) - healthy, err := health.AwaitReady(ctx, healthClient, 5*time.Second) - gomega.Expect(err).Should(gomega.BeNil()) - gomega.Expect(healthy).Should(gomega.BeTrue()) - log.Info("AvalancheGo node is healthy") + logDir, err = os.MkdirTemp("", fmt.Sprintf("subnet-evm-load-test-%d", time.Now().Unix())) + gomega.Ω(err).Should(gomega.BeNil()) + lvl, err := logging.ToLevel(logLevel) + gomega.Ω(err).Should(gomega.BeNil()) + lcfg := logging.Config{ + DisplayLevel: lvl, + } + logFactory := logging.NewFactory(lcfg) + log, err = logFactory.Make(constants.LogNameTest) + gomega.Ω(err).Should(gomega.BeNil()) + + cli, err = client.New(client.Config{ + Endpoint: gRPCEp, + DialTimeout: 10 * time.Second, + }, log) + gomega.Ω(err).Should(gomega.BeNil()) }) var _ = ginkgo.AfterSuite(func() { - gomega.Expect(startCmd).ShouldNot(gomega.BeNil()) - gomega.Expect(startCmd.Stop()).Should(gomega.BeNil()) - // TODO add a new node to bootstrap off of the existing node and ensure it can bootstrap all subnets - // created during the test + ux.Print(log, logging.Red.Wrap("shutting down cluster")) + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) + _, err := cli.Stop(ctx) + cancel() + gomega.Ω(err).Should(gomega.BeNil()) + + ux.Print(log, logging.Red.Wrap("shutting down client")) + err = cli.Close() + gomega.Ω(err).Should(gomega.BeNil()) }) + +var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() { + ginkgo.It("test", func() { + ginkgo.By("start with blockchain specs", func() { + ux.Print(log, logging.Green.Wrap("sending 'start' with the valid binary path: %s"), execPath1) + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + resp, err := cli.Start(ctx, execPath1, + client.WithBlockchainSpecs([]*rpcpb.BlockchainSpec{ + { + VmName: "subnetevm", + Genesis: "tests/e2e/subnet-evm-genesis.json", + }, + }), + ) + cancel() + gomega.Ω(err).Should(gomega.BeNil()) + ux.Print(log, logging.Green.Wrap("successfully started, node-names: %s"), resp.ClusterInfo.NodeNames) + }) + }) +}) + +func waitForCustomChainsHealthy() string { + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) + var created bool + continueLoop := true + for continueLoop { + select { + case <-ctx.Done(): + continueLoop = false + case <-time.After(5 * time.Second): + cctx, ccancel := context.WithTimeout(context.Background(), 15*time.Second) + status, err := cli.Status(cctx) + ccancel() + gomega.Ω(err).Should(gomega.BeNil()) + created = status.ClusterInfo.CustomChainsHealthy + if created { + existingSubnetID := status.ClusterInfo.GetSubnets()[0] + gomega.Ω(existingSubnetID).Should(gomega.Not(gomega.BeNil())) + cancel() + return existingSubnetID + } + } + } + cancel() + gomega.Ω(created).Should(gomega.Equal(true)) + return "" +} From 8d734ebbe2f818cbda8054a77cfdf0d08a3309d7 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Fri, 13 Jan 2023 10:50:01 -0500 Subject: [PATCH 27/55] Fix up env variables in run single node script --- scripts/run_single_node.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/run_single_node.sh b/scripts/run_single_node.sh index 47b160e526..b4701ac661 100755 --- a/scripts/run_single_node.sh +++ b/scripts/run_single_node.sh @@ -19,8 +19,9 @@ source "$SUBNET_EVM_PATH"/scripts/versions.sh source "$SUBNET_EVM_PATH"/scripts/constants.sh # Set up avalanche binary path and assume build directory is set -AVALANCHEGO_PATH=${AVALANCHEGO_PATH:-"$GOPATH/src/github.com/ava-labs/avalanchego/build/avalanchego"} -AVALANCHEGO_PLUGIN_DIR=${AVALANCHEGO_PATH:-"$AVALANCHEGO_PATH/plugins"} +AVALANCHEGO_BUILD_PATH=${AVALANCHEGO_BUILD_PATH:-"$GOPATH/src/github.com/ava-labs/avalanchego/build/"} +AVALANCHEGO_PATH=${AVALANCHEGO_PATH:-"$AVALANCHEGO_BUILD_PATH/avalanchego"} +AVALANCHEGO_PLUGIN_DIR=${AVALANCHEGO_PLUGIN_DIR:-"$AVALANCHEGO_BUILD_PATH/plugins"} DATA_DIR=${DATA_DIR:-/tmp/subnet-evm-start-node/$(date "+%Y-%m-%d%:%H:%M:%S")} # Create node config in DATA_DIR From de9ee7565ad0b3e9bc021f0cd4e69d4080cd3e49 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Mon, 23 Jan 2023 13:32:43 -0500 Subject: [PATCH 28/55] WIP --- scripts/run.sh | 4 +++- scripts/run_cli.sh | 24 ++++++++++++++++++++++++ scripts/versions.sh | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 scripts/run_cli.sh diff --git a/scripts/run.sh b/scripts/run.sh index 457b730dcf..d69459fa1b 100644 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -144,4 +144,6 @@ $ANR_BIN control start \ --number-of-nodes=5 \ --avalanchego-path ${AVALANCHEGO_PATH} \ --plugin-dir ${AVALANCHEGO_PLUGIN_DIR} \ - --blockchain-specs '[{"vm_name": "subnetevm", "genesis": "'$GENESIS_FILE_PATH'"}]' & + --blockchain-specs '[{"vm_name": "subnetevm", "genesis": "'$GENESIS_FILE_PATH'"}]' + +echo "" diff --git a/scripts/run_cli.sh b/scripts/run_cli.sh new file mode 100755 index 0000000000..d7c9ff8092 --- /dev/null +++ b/scripts/run_cli.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +set -e + +if ! [[ "$0" =~ scripts/run_cli.sh ]]; then + echo "must be run from repository root" + exit 255 +fi + +# Load the versions +SUBNET_EVM_PATH=$( + cd "$(dirname "${BASH_SOURCE[0]}")" + cd .. && pwd +) +source "$SUBNET_EVM_PATH"/scripts/versions.sh + +# Load the constants +source "$SUBNET_EVM_PATH"/scripts/constants.sh + +# Place avalanche-cli in +BUILD_DIR=${AVALANCHE_CLI_BIN:-"$SUBNET_EVM_PATH/build"} +AVALANCHE_CLI_BIN="$BUILD_DIR/avalanche" # No override - since install script places avalanche binary in specified BUILD_DIR + +curl -sSfL https://raw.githubusercontent.com/ava-labs/avalanche-cli/main/scripts/install.sh | sh -s -- -b $BUILD_DIR $AVALANCHE_CLI_VERSION + diff --git a/scripts/versions.sh b/scripts/versions.sh index 21917e12a3..dada2ed59e 100644 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -5,6 +5,7 @@ SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-'v0.4.8'} # Don't export them as they're used in the context of other calls AVALANCHEGO_VERSION=${AVALANCHE_VERSION:-'v1.9.6'} NETWORK_RUNNER_VERSION=${NETWORK_RUNNER_VERSION:-'v1.3.5'} +AVALANCHE_CLI_VERSION=${AVALANCHE_CLI_VERSION:-'v1.0.5'} GINKGO_VERSION=${GINKGO_VERSION:-'v2.2.0'} # This won't be used, but it's here to make code syncs easier From 8d36bc8201642ea31d257d81f61c0b3599bdad13 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Tue, 24 Jan 2023 11:03:19 -0500 Subject: [PATCH 29/55] Add install_cli.sh script --- scripts/install_cli.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 scripts/install_cli.sh diff --git a/scripts/install_cli.sh b/scripts/install_cli.sh new file mode 100755 index 0000000000..9b1469fe0f --- /dev/null +++ b/scripts/install_cli.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -e + +if ! [[ "$0" =~ scripts/install_cli.sh ]]; then + echo "must be run from repository root" + exit 255 +fi + +# Load the versions +SUBNET_EVM_PATH=$( + cd "$(dirname "${BASH_SOURCE[0]}")" + cd .. && pwd +) +source "$SUBNET_EVM_PATH"/scripts/versions.sh + +# Load the constants +source "$SUBNET_EVM_PATH"/scripts/constants.sh + +# Place avalanche-cli in +BUILD_DIR=${AVALANCHE_CLI_BIN:-"$SUBNET_EVM_PATH/build"} +AVALANCHE_CLI_BIN="$BUILD_DIR/avalanche" # No override - since install script places avalanche binary in specified BUILD_DIR + +curl -sSfL https://raw.githubusercontent.com/ava-labs/avalanche-cli/main/scripts/install.sh | sh -s -- -b $BUILD_DIR $AVALANCHE_CLI_VERSION From 90f72c1cd4f7c442198f80d1a98ecb1b738c2ec5 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Tue, 24 Jan 2023 13:52:57 -0500 Subject: [PATCH 30/55] Create 1 script to start a non-staking network of nodes in a subshell --- accounts/abi/bind/precompile_template.go | 2 +- scripts/install_anr_release.sh | 30 ---- scripts/install_cli.sh | 23 --- scripts/run.sh | 184 +++++++---------------- scripts/run_cli.sh | 24 --- scripts/run_single_node.sh | 50 ------ scripts/versions.sh | 4 +- 7 files changed, 57 insertions(+), 260 deletions(-) delete mode 100644 scripts/install_anr_release.sh delete mode 100755 scripts/install_cli.sh mode change 100644 => 100755 scripts/run.sh delete mode 100755 scripts/run_cli.sh delete mode 100755 scripts/run_single_node.sh diff --git a/accounts/abi/bind/precompile_template.go b/accounts/abi/bind/precompile_template.go index 58c96f35ab..66340b4117 100644 --- a/accounts/abi/bind/precompile_template.go +++ b/accounts/abi/bind/precompile_template.go @@ -38,7 +38,7 @@ Typically, custom codes are required in only those areas. 7- Write solidity tests for your precompile in contract-examples/test 8- Create your genesis with your precompile enabled in tests/e2e/genesis/ 9- Create e2e test for your solidity test in tests/e2e/solidity/suites.go -10- Run your e2e precompile Solidity tests with 'E2E=true ./scripts/run.sh' +10- Run your e2e precompile Solidity tests with './scripts/run_ginkgo.sh' */ diff --git a/scripts/install_anr_release.sh b/scripts/install_anr_release.sh deleted file mode 100644 index d962c60ca1..0000000000 --- a/scripts/install_anr_release.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -set -e - -# Load the versions -SUBNET_EVM_PATH=$( - cd "$(dirname "${BASH_SOURCE[0]}")" - cd .. && pwd -) -source "$SUBNET_EVM_PATH"/scripts/versions.sh - -# Load the constants -source "$SUBNET_EVM_PATH"/scripts/constants.sh - -################################# -# download avalanche-network-runner -# https://github.com/ava-labs/avalanche-network-runner -ANR_REPO_PATH=github.com/ava-labs/avalanche-network-runner -# version set -go install -v ${ANR_REPO_PATH}@${ANR_VERSION} - -################################# -# run "avalanche-network-runner" server -GOPATH=$(go env GOPATH) -if [[ -z ${GOBIN+x} ]]; then - # no gobin set - ANR_BIN=${GOPATH}/bin/avalanche-network-runner -else - # gobin set - ANR_BIN=${GOBIN}/avalanche-network-runner -fi \ No newline at end of file diff --git a/scripts/install_cli.sh b/scripts/install_cli.sh deleted file mode 100755 index 9b1469fe0f..0000000000 --- a/scripts/install_cli.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -set -e - -if ! [[ "$0" =~ scripts/install_cli.sh ]]; then - echo "must be run from repository root" - exit 255 -fi - -# Load the versions -SUBNET_EVM_PATH=$( - cd "$(dirname "${BASH_SOURCE[0]}")" - cd .. && pwd -) -source "$SUBNET_EVM_PATH"/scripts/versions.sh - -# Load the constants -source "$SUBNET_EVM_PATH"/scripts/constants.sh - -# Place avalanche-cli in -BUILD_DIR=${AVALANCHE_CLI_BIN:-"$SUBNET_EVM_PATH/build"} -AVALANCHE_CLI_BIN="$BUILD_DIR/avalanche" # No override - since install script places avalanche binary in specified BUILD_DIR - -curl -sSfL https://raw.githubusercontent.com/ava-labs/avalanche-cli/main/scripts/install.sh | sh -s -- -b $BUILD_DIR $AVALANCHE_CLI_VERSION diff --git a/scripts/run.sh b/scripts/run.sh old mode 100644 new mode 100755 index d69459fa1b..7a9158dab0 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -1,15 +1,10 @@ #!/usr/bin/env bash set -e -# e.g., -# -# run a 5 node network with the avalanche-network-runner -# ./scripts/run.sh -# -# run without e2e tests with DEBUG log level -# AVALANCHE_LOG_LEVEL=DEBUG ./scripts/run.sh -if ! [[ "$0" =~ scripts/run.sh ]]; then - echo "must be run from repository root" +# This script starts a single node running the local network with staking disabled and expects the caller to take care of cleaning up the created AvalancheGo process. +# This script uses the data directory to use node configuration and populate data into a predictable location. +if ! [[ "$0" =~ scripts/run_single_node.sh ]]; then + echo "must be run from repository root, but got $0" exit 255 fi @@ -23,127 +18,58 @@ source "$SUBNET_EVM_PATH"/scripts/versions.sh # Load the constants source "$SUBNET_EVM_PATH"/scripts/constants.sh -VERSION=$AVALANCHEGO_VERSION - -ANR_VERSION=$NETWORK_RUNNER_VERSION - -echo "Running with:" -echo AVALANCHE_VERSION: ${VERSION} -echo ANR_VERSION: ${ANR_VERSION} -echo GENESIS_ADDRESS: ${GENESIS_ADDRESS} - -############################ -# Download AvalancheGo release and populate environment variables -source "$SUBNET_EVM_PATH/scripts/install_avalanchego_release.sh" -echo "Installed AvalancheGo release ${VERSION}" -echo "AvalancheGo Path: ${AVALANCHEGO_PATH}" -echo "Plugin Dir: ${AVALANCHEGO_PLUGIN_DIR}" - -# "ewoq" key -DEFAULT_ACCOUNT="0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC" -GENESIS_ADDRESS=${GENESIS_ADDRESS-$DEFAULT_ACCOUNT} - - -################################# -# compile subnet-evm -# Check if SUBNET_EVM_COMMIT is set, if not retrieve the last commit from the repo. -# This is used in the Dockerfile to allow a commit hash to be passed in without -# including the .git/ directory within the Docker image. -SUBNET_EVM_COMMIT=${SUBNET_EVM_COMMIT:-$(git rev-list -1 HEAD)} - -# Build Subnet EVM, which is run as a subprocess -echo "Building Subnet EVM Version: $SUBNET_EVM_VERSION; GitCommit: $SUBNET_EVM_COMMIT" -go build \ - -ldflags "-X github.com/ava-labs/subnet_evm/plugin/evm.GitCommit=$SUBNET_EVM_COMMIT -X github.com/ava-labs/subnet_evm/plugin/evm.Version=$SUBNET_EVM_VERSION" \ - -o $AVALANCHEGO_PLUGIN_DIR/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy \ - "plugin/"*.go - -################################# -# write subnet-evm genesis - -# Create genesis file to use in network (make sure to add your address to -# "alloc") -export CHAIN_ID=99999 -GENESIS_FILE_PATH=$BASEDIR/genesis.json - -echo "creating genesis" - cat <$GENESIS_FILE_PATH -{ - "config": { - "chainId": $CHAIN_ID, - "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 - } - }, - "alloc": { - "${GENESIS_ADDRESS:2}": { - "balance": "0x52B7D2DCC80CD2E4000000" - } - }, - "nonce": "0x0", - "timestamp": "0x0", - "extraData": "0x00", - "gasLimit": "0x1312D00", - "difficulty": "0x0", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "coinbase": "0x0000000000000000000000000000000000000000", - "number": "0x0", - "gasUsed": "0x0", - "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" -} +# Set up avalanche binary path and assume build directory is set +AVALANCHEGO_BUILD_PATH=${AVALANCHEGO_BUILD_PATH:-"$GOPATH/src/github.com/ava-labs/avalanchego/build"} +AVALANCHEGO_PATH=${AVALANCHEGO_PATH:-"$AVALANCHEGO_BUILD_PATH/avalanchego"} +AVALANCHEGO_PLUGIN_DIR=${AVALANCHEGO_PLUGIN_DIR:-"$AVALANCHEGO_BUILD_PATH/plugins"} +DATA_DIR=${DATA_DIR:-/tmp/subnet-evm-start-node/$(date "+%Y-%m-%d%:%H:%M:%S")} + +# Set the config file contents for the path passed in as the first argument +function _set_config(){ + cat <$1 + { + "network-id": "local", + "staking-enabled": false, + "health-check-frequency": "5s", + "plugin-dir": "$AVALANCHEGO_PLUGIN_DIR" + } EOF +} -################################# -# download avalanche-network-runner -# https://github.com/ava-labs/avalanche-network-runner -ANR_REPO_PATH=github.com/ava-labs/avalanche-network-runner -# version set -go install -v ${ANR_REPO_PATH}@${ANR_VERSION} - -################################# -# run "avalanche-network-runner" server -GOPATH=$(go env GOPATH) -if [[ -z ${GOBIN+x} ]]; then - # no gobin set - ANR_BIN=${GOPATH}/bin/avalanche-network-runner -else - # gobin set - ANR_BIN=${GOBIN}/avalanche-network-runner -fi -echo "launch avalanche-network-runner in the background" - -# Start network runner server -$ANR_BIN server \ - --log-level debug \ - --port=":12342" \ - --grpc-gateway-port=":12343" & -PID=${!} +DATA_DIRS=("$DATA_DIR/node1" "$DATA_DIR/node2" "$DATA_DIR/node3" "$DATA_DIR/node4" "$DATA_DIR/node5") +CMDS=() +for (( i=0; i <5; i++ )) +do + echo "Creating data directory: ${DATA_DIRS[i]}" + mkdir -p ${DATA_DIRS[i]} + NODE_DATA_DIR=${DATA_DIRS[i]} + NODE_CONFIG_FILE_PATH="$NODE_DATA_DIR/config.json" + _set_config $NODE_CONFIG_FILE_PATH + + CMD="$AVALANCHEGO_PATH --data-dir=$NODE_DATA_DIR" + if [ $i -gt 0 ]; then + echo "Adding CLI options for node$(($i+1))" + CMD="$CMD --staking-port=$((9651+2*$i)) --http-port=$((9650+2*$i)) --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=NodeID-5Q84knz4UyG4AkUdo7r2KiUiK6FHKxA8Z" + fi + + echo "Created command $CMD" + CMDS+=("$CMD") +done + + +echo "Starting AvalancheGo network with the commands:" +echo "" +for (( i=0; i<5; i++ )) +do + echo "CMD $i : ${CMDS[i]}" + echo "" +done + +# cleanup sends SIGINT to each tracked process +function cleanup_process_group(){ + echo "Terminating AvalancheGo network process group" + kill 0 +} -# Start the network with the defined blockchain specs -$ANR_BIN control start \ - --log-level debug \ - --endpoint="0.0.0.0:12342" \ - --number-of-nodes=5 \ - --avalanchego-path ${AVALANCHEGO_PATH} \ - --plugin-dir ${AVALANCHEGO_PLUGIN_DIR} \ - --blockchain-specs '[{"vm_name": "subnetevm", "genesis": "'$GENESIS_FILE_PATH'"}]' -echo "" +(trap 'cleanup_process_group' SIGINT; ${CMDS[0]} & ${CMDS[1]} & ${CMDS[2]} & ${CMDS[3]} & ${CMDS[4]} & wait) diff --git a/scripts/run_cli.sh b/scripts/run_cli.sh deleted file mode 100755 index d7c9ff8092..0000000000 --- a/scripts/run_cli.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -set -e - -if ! [[ "$0" =~ scripts/run_cli.sh ]]; then - echo "must be run from repository root" - exit 255 -fi - -# Load the versions -SUBNET_EVM_PATH=$( - cd "$(dirname "${BASH_SOURCE[0]}")" - cd .. && pwd -) -source "$SUBNET_EVM_PATH"/scripts/versions.sh - -# Load the constants -source "$SUBNET_EVM_PATH"/scripts/constants.sh - -# Place avalanche-cli in -BUILD_DIR=${AVALANCHE_CLI_BIN:-"$SUBNET_EVM_PATH/build"} -AVALANCHE_CLI_BIN="$BUILD_DIR/avalanche" # No override - since install script places avalanche binary in specified BUILD_DIR - -curl -sSfL https://raw.githubusercontent.com/ava-labs/avalanche-cli/main/scripts/install.sh | sh -s -- -b $BUILD_DIR $AVALANCHE_CLI_VERSION - diff --git a/scripts/run_single_node.sh b/scripts/run_single_node.sh deleted file mode 100755 index b4701ac661..0000000000 --- a/scripts/run_single_node.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash -set -e - -# This script starts a single node running the local network with staking disabled and expects the caller to take care of cleaning up the created AvalancheGo process. -# This script uses the data directory to use node configuration and populate data into a predictable location. -if ! [[ "$0" =~ scripts/run_single_node.sh ]]; then - echo "must be run from repository root, but got $0" - exit 255 -fi - -# Load the versions -SUBNET_EVM_PATH=$( - cd "$(dirname "${BASH_SOURCE[0]}")" - cd .. && pwd -) -source "$SUBNET_EVM_PATH"/scripts/versions.sh - -# Load the constants -source "$SUBNET_EVM_PATH"/scripts/constants.sh - -# Set up avalanche binary path and assume build directory is set -AVALANCHEGO_BUILD_PATH=${AVALANCHEGO_BUILD_PATH:-"$GOPATH/src/github.com/ava-labs/avalanchego/build/"} -AVALANCHEGO_PATH=${AVALANCHEGO_PATH:-"$AVALANCHEGO_BUILD_PATH/avalanchego"} -AVALANCHEGO_PLUGIN_DIR=${AVALANCHEGO_PLUGIN_DIR:-"$AVALANCHEGO_BUILD_PATH/plugins"} -DATA_DIR=${DATA_DIR:-/tmp/subnet-evm-start-node/$(date "+%Y-%m-%d%:%H:%M:%S")} - -# Create node config in DATA_DIR -echo "creating node config" -mkdir -p $DATA_DIR -CONFIG_FILE_PATH=$DATA_DIR/config.json - - cat <$CONFIG_FILE_PATH -{ - "network-id": "local", - "staking-enabled": false, - "network-health-min-conn-peers": 0, - "network-health-max-time-since-msg-received": 4611686018427387904, - "network-health-max-time-since-msg-sent": 4611686018427387904, - "health-check-frequency": "5s", - "plugin-dir": "$AVALANCHEGO_PLUGIN_DIR" -} -EOF - -echo "Starting AvalancheGo node" -echo "AvalancheGo Binary Path: ${AVALANCHEGO_PATH}" -echo "Data directory: ${DATA_DIR}" -echo "Config file: ${CONFIG_FILE_PATH}" - -# Run the node -$AVALANCHEGO_PATH --data-dir=$DATA_DIR --config-file=$CONFIG_FILE_PATH diff --git a/scripts/versions.sh b/scripts/versions.sh index dada2ed59e..1529317685 100644 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -3,9 +3,7 @@ # Set up the versions to be used - populate ENV variables only if they are not already populated SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-'v0.4.8'} # Don't export them as they're used in the context of other calls -AVALANCHEGO_VERSION=${AVALANCHE_VERSION:-'v1.9.6'} -NETWORK_RUNNER_VERSION=${NETWORK_RUNNER_VERSION:-'v1.3.5'} -AVALANCHE_CLI_VERSION=${AVALANCHE_CLI_VERSION:-'v1.0.5'} +AVALANCHEGO_VERSION=${AVALANCHE_VERSION:-'v1.9.7'} GINKGO_VERSION=${GINKGO_VERSION:-'v2.2.0'} # This won't be used, but it's here to make code syncs easier From 1024824c74f2d29956885d3aede227d1a44aeee8 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Tue, 24 Jan 2023 18:26:48 -0500 Subject: [PATCH 31/55] Fix run script to run 5 node non-staking network and add simple load script --- scripts/run.sh | 40 ++++-- scripts/run_simulator.sh | 17 +++ tests/load/load_test.go | 197 ++++++---------------------- tests/precompile/precompile_test.go | 2 +- tests/precompile/utils/constants.go | 5 +- 5 files changed, 93 insertions(+), 168 deletions(-) create mode 100644 scripts/run_simulator.sh diff --git a/scripts/run.sh b/scripts/run.sh index 7a9158dab0..099a72ff12 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash set -e -# This script starts a single node running the local network with staking disabled and expects the caller to take care of cleaning up the created AvalancheGo process. -# This script uses the data directory to use node configuration and populate data into a predictable location. -if ! [[ "$0" =~ scripts/run_single_node.sh ]]; then +# This script starts N nodes (TODO N instead of 5) and waits for ctrl-c to shutdown the process group of AvalancheGo processes +# Uses data directory to store all AvalancheGo data neatly in one location with minimal config overhead +if ! [[ "$0" =~ scripts/run.sh ]]; then echo "must be run from repository root, but got $0" exit 255 fi @@ -24,6 +24,12 @@ AVALANCHEGO_PATH=${AVALANCHEGO_PATH:-"$AVALANCHEGO_BUILD_PATH/avalanchego"} AVALANCHEGO_PLUGIN_DIR=${AVALANCHEGO_PLUGIN_DIR:-"$AVALANCHEGO_BUILD_PATH/plugins"} DATA_DIR=${DATA_DIR:-/tmp/subnet-evm-start-node/$(date "+%Y-%m-%d%:%H:%M:%S")} +# Base64 encoded Staking TLS Cert and Key File Contents for AvalancheGo local staking node 1 (published key content used for testing) +STAKING_TLS_KEY_FILE_CONTENT="LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlKS0FJQkFBS0NBZ0VBeW1Fa2NQMXRHS1dCL3pFMElZaGEwZEp2UFplc2s3c3k2UTdZN25hLytVWjRTRDc3CmFwTzJDQnB2NXZaZHZjY0VlQ2VhKzBtUnJQdTlNZ1hyWkcwdm9lejhDZHE1bGc4RzYzY2lTcjFRWWFuL0pFcC8KbFZOaTNqMGlIQ1k5ZmR5dzhsb1ZkUitKYWpaRkpIQUVlK2hZZmFvekx3TnFkTHlldXZuZ3kxNWFZZjBXR3FVTQpmUjREby85QVpnQ2pLMkFzcU9RWVVZb2Zqcm9JUEdpdUJ2VDBFeUFPUnRzRTFsdGtKQjhUUDBLYVJZMlhmMThFCkhpZGgrcm0xakJYT1g3YlgrZ002U2J4U0F3YnZ5UXdpbG9ncnVadkxlQmkvTU5qcXlNZkNiTmZaUmVHR0JObnEKSXdxM3FvRDR1dUV0NkhLc0NyQTZNa2s4T3YrWWlrT1FWR01GRjE5OCt4RnpxZy9FakIzbjFDbm5NNCtGcndHbQpTODBkdTZsNXVlUklFV0VBQ0YrSDRabU96WDBxS2Qxb2RCS090dmlSNkRQOVlQbElEbDVXNTFxV1BlVElIZS8zCjhBMGxpN3VDTVJOUDdxdkZibnlHM3d1TXEyUEtwVTFYd0gzeU5aWFVYYnlZenlRVDRrTkFqYXpwZXRDMWFiYVoKQm5QYklSKzhHZG16OUd4SjJDazRDd0h6c3cvRkxlOVR0Z0RpR3ZOQU5SalJaZUdKWHZ6RWpTVG5FRGtxWUxWbgpVUk15RktIcHdJMzdzek9Ebms2K0hFWU9QbFdFd0tQU2h5cTRqZFE3bnNEY3huZkZveWdGUjVuQ0RJNmlFaTA1CmN6SVhiSFp2anBuME9qcjhsKzc5Qmt6Z1c0VDlQVFJuTU1PUU5JQXMxemRmQlV1YU1aOFh1amh2UTlNQ0F3RUEKQVFLQ0FnRUF1VU00TXQ4cjhiWUJUUFZqL1padlhVakFZS2ZxYWNxaWprcnpOMGtwOEM0Y2lqWnR2V0MrOEtnUwo3R0YzNnZTM0dLOVk1dFN3TUtTNnk0SXp2RmxmazJINFQ2VVU0MU9hU0E5bEt2b25EV0NybWpOQW5CZ2JsOHBxCjRVMzRXTEdnb2hycExiRFRBSkh4dGF0OXoxZ2hPZGlHeG5EZ0VVRmlKVlA5L3UyKzI1anRsVEttUGhzdHhnRXkKbUszWXNTcDNkNXhtenE0Y3VYRi9mSjF2UWhzWEhETHFIdDc4aktaWkErQVdwSUI1N1ZYeTY3eTFiazByR25USwp4eFJuT2FPT0R1YkpneHFNRVExV2tMczFKb3c5U3NwZDl2RGdoUHp0NFNOTXpvckI4WURFU01pYjE3eEY2aVhxCmpGajZ4NkhCOEg3bXA0WDNSeU1ZSnVvMnc2bHB6QnNFbmNVWXBLaHFNYWJGMEkvZ2lJNVZkcFNEdmtDQ09GZW4KbldaTFY5QWkveDd0VHEvMEYrY1ZNNjlNZ2ZlOGlZeW1xbGZkNldSWklUS2ZWaU5IQUxsRy9QcTl5SEpzejdOZwpTOEJLT0R0L3NqNFEweEx0RkRUL0RtcFA1MGlxN1NpUzE0b2JjS2NRcjhGQWpNL3NPWS9VbGc0TThNQTdFdWdTCnBESndMbDZYRG9JTU1DTndaMUhHc0RzdHpteDVNZjUwYlM0dGJLNGlaemNwUFg1UkJUbFZkbzlNVFNnbkZpenAKSWkxTmpITHVWVkNTTGIxT2pvVGd1MGNRRmlXRUJDa0MxWHVvUjhSQ1k2aVdWclVINEdlem5pN2NrdDJtSmFOQQpwZDYvODdkRktFM2poNVQ2alplSk1KZzVza1RaSFNvekpEdWFqOXBNSy9KT05TRDA2c0VDZ2dFQkFQcTJsRW1kCmcxaHBNSXFhN2V5MXVvTGQxekZGemxXcnhUSkxsdTM4TjY5bVlET0hyVi96cVJHT3BaQisxbkg3dFFKSVQvTDEKeExOMzNtRlZxQ3JOOHlVbVoraVVXaW9hSTVKWjFqekNnZW1WR2VCZ29kd1A5TU9aZnh4ckRwMTdvVGRhYmFFcQo3WmFCWW5ZOHhLLzRiQ3h1L0I0bUZpRjNaYThaVGQvKzJ5ZXY3Sk0rRTNNb3JXYzdyckttMUFwZmxmeHl0ZGhPCkpMQmlxT2Nxb2JJM2RnSHl6ZXNWYjhjVDRYQ3BvUmhkckZ3b3J0MEpJN3J5ZmRkZDQ5dk1KM0VsUmJuTi9oNEYKZjI0Y1dZL3NRUHEvbmZEbWVjMjhaN25WemExRDRyc3pOeWxZRHZ6ZGpGMFExbUw1ZEZWbnRXYlpBMUNOdXJWdwpuVGZ3dXlROFJGOVluWU1DZ2dFQkFNNmxwTmVxYWlHOWl4S1NyNjVwWU9LdEJ5VUkzL2VUVDR2Qm5yRHRZRis4Cm9oaUtnSXltRy92SnNTZHJ5bktmd0pPYkV5MmRCWWhDR0YzaDl6Mm5jOUtKUUQvc3U3d3hDc2RtQnM3WW9EaU0KdXpOUGxSQW1JMFFBRklMUENrNDh6L2xVUWszci9NenUwWXpSdjdmSTRXU3BJR0FlZlZQRHF5MXVYc0FURG9ESgphcmNFa05ENUxpYjg5THg3cjAyRWV2SkpUZGhUSk04bUJkUmw2d3BOVjN4QmR3aXM2N3VTeXVuRlpZcFNpTXc3CldXaklSaHpoTEl2cGdENzhVdk52dUppMFVHVkVqVHFueHZ1VzNZNnNMZklrODBLU1IyNFVTaW5UMjd0Ly94N3oKeXpOa283NWF2RjJobTFmOFkvRXBjSEhBYXg4TkFRRjV1dVY5eEJOdnYzRUNnZ0VBZFMvc1JqQ0syVU5wdmcvRwowRkx0V0FncmNzdUhNNEl6alZ2SnMzbWw2YVYzcC81dUtxQncwVlVVekdLTkNBQTRUbFhRa09jUnh6VnJTNkhICkZpTG4yT0NIeHkyNHExOUdhenowcDdmZkUzaHUvUE1PRlJlY04rVkNoZDBBbXRuVHRGVGZVMnNHWE1nalp0TG0KdUwzc2lpUmlVaEZKWE9FN05Vb2xuV0s1dTJZK3RXQlpwUVZKY0N4MGJ1c054NytBRXR6blpMQzU4M3hhS0p0RApzMUs3SlJRQjdqVTU1eHJDMEc5cGJrTXlzbTBOdHlGemd3bWZpcEJIVmxDcHl2ZzZEQ3hkOEZodmhOOVplYTFiCmZoa2MwU0pab3JIQzVoa3FweWRKRG1sVkNrMHZ6RUFlUU00Qzk0WlVPeXRibmpRbm1YcDE0Q05BU1lxTFh0ZVEKdWVSbzB3S0NBUUFHMEYxMEl4Rm0xV290alpxdlpKZ21RVkJYLzBmclVQY3hnNHZwQjVyQzdXUm03TUk2WVF2UgpMS0JqeldFYWtIdjRJZ2ZxM0IrZms1WmNHaVJkNnhTZG41cjN3S1djR2YzaC8xSkFKZEo2cXVGTld0VnVkK04zCnpZemZsMVllcUZDdlJ3RDhzc2hlTlkzQlYvVTdhU3ROZDJveTRTNSt3WmYyWW9wTFNSV1VWNC9tUXdkSGJNQUIKMXh0Mno1bEROQmdkdng4TEFBclpyY1pKYjZibGF4RjBibkF2WUF4UjNoQkV6eFovRGlPbW9GcGRZeVUwdEpRVQpkUG1lbWhGZUo1UHRyUnh0aW1vaHdnQ0VzVC9UQVlodVVKdVkyVnZ6bkVXcHhXdWNiaWNLYlQySkQwdDY3bUVCCnNWOSs4anFWYkNsaUJ0ZEJhZHRib2hqd2trb1IzZ0J4QW9JQkFHM2NadU5rSVdwRUxFYmVJQ0tvdVNPS04wNnIKRnMvVVhVOHJvTlRoUFI3dlB0amVEMU5ETW1VSEpyMUZHNFNKclNpZ2REOHFOQmc4dy9HM25JMEl3N2VGc2trNQo4bU5tMjFDcER6T04zNlpPN0lETWo1dXlCbGoydCtJeGwvdUpZaFlTcHVOWHlVVE1tK3JrRkowdmRTVjRmakxkCkoybTMwanVZbk1pQkJKZjdkejVNOTUrVDB4aWNHV3lWMjR6VllZQmJTbzBOSEVHeHFlUmhpa05xWk5Qa29kNmYKa2ZPSlpHYWxoMkthSzVSTXBacEZGaFova1c5eFJXTkpaeUNXZ2tJb1lrZGlsTXVJU0J1M2xDcms4cmRNcEFMMAp3SEVjcTh4d2NnWUNTMnFrOEh3anRtVmQzZ3BCMXk5VXNoTXIzcW51SDF3TXBVNUMrbk0yb3kzdlNrbz0KLS0tLS1FTkQgUlNBIFBSSVZBVEUgS0VZLS0tLS0K" +STAKING_TLS_CRT_FILE_CONTENT="LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZOekNDQXg4Q0NRQzY4N1hGeHREUlNqQU5CZ2txaGtpRzl3MEJBUXNGQURCL01Rc3dDUVlEVlFRR0V3SlYKVXpFTE1Ba0dBMVVFQ0F3Q1Rsa3hEekFOQmdOVkJBY01Ca2wwYUdGallURVFNQTRHQTFVRUNnd0hRWFpoYkdGaQpjekVPTUF3R0ExVUVDd3dGUjJWamEyOHhEREFLQmdOVkJBTU1BMkYyWVRFaU1DQUdDU3FHU0liM0RRRUpBUllUCmMzUmxjR2hsYmtCaGRtRnNZV0p6TG05eVp6QWdGdzB4T1RBM01ESXhOakV5TVRWYUdBOHpNREU1TURjeE1ERTIKTVRJeE5Wb3dPakVMTUFrR0ExVUVCaE1DVlZNeEN6QUpCZ05WQkFnTUFrNVpNUkF3RGdZRFZRUUtEQWRCZG1GcwpZV0p6TVF3d0NnWURWUVFEREFOaGRtRXdnZ0lpTUEwR0NTcUdTSWIzRFFFQkFRVUFBNElDRHdBd2dnSUtBb0lDCkFRREtZU1J3L1cwWXBZSC9NVFFoaUZyUjBtODlsNnlUdXpMcER0anVkci81Um5oSVB2dHFrN1lJR20vbTlsMjkKeHdSNEo1cjdTWkdzKzcweUJldGtiUytoN1B3SjJybVdEd2JyZHlKS3ZWQmhxZjhrU24rVlUyTGVQU0ljSmoxOQozTER5V2hWMUg0bHFOa1VrY0FSNzZGaDlxak12QTJwMHZKNjYrZURMWGxwaC9SWWFwUXg5SGdPai8wQm1BS01yCllDeW81QmhSaWgrT3VnZzhhSzRHOVBRVElBNUcyd1RXVzJRa0h4TS9RcHBGalpkL1h3UWVKMkg2dWJXTUZjNWYKdHRmNkF6cEp2RklEQnUvSkRDS1dpQ3U1bTh0NEdMOHcyT3JJeDhKczE5bEY0WVlFMmVvakNyZXFnUGk2NFMzbwpjcXdLc0RveVNUdzYvNWlLUTVCVVl3VVhYM3o3RVhPcUQ4U01IZWZVS2Vjemo0V3ZBYVpMelIyN3FYbTU1RWdSCllRQUlYNGZobVk3TmZTb3AzV2gwRW82MitKSG9NLzFnK1VnT1hsYm5XcFk5NU1nZDcvZndEU1dMdTRJeEUwL3UKcThWdWZJYmZDNHlyWThxbFRWZkFmZkkxbGRSZHZKalBKQlBpUTBDTnJPbDYwTFZwdHBrR2M5c2hIN3daMmJQMApiRW5ZS1RnTEFmT3pEOFV0NzFPMkFPSWE4MEExR05GbDRZbGUvTVNOSk9jUU9TcGd0V2RSRXpJVW9lbkFqZnV6Ck00T2VUcjRjUmc0K1ZZVEFvOUtIS3JpTjFEdWV3TnpHZDhXaktBVkhtY0lNanFJU0xUbHpNaGRzZG0rT21mUTYKT3Z5WDd2MEdUT0JiaFAwOU5HY3d3NUEwZ0N6WE4xOEZTNW94bnhlNk9HOUQwd0lEQVFBQk1BMEdDU3FHU0liMwpEUUVCQ3dVQUE0SUNBUUFxTDFUV0kxUFRNbTNKYVhraGRUQmU4dHNrNytGc0hBRnpUY0JWQnNCOGRrSk5HaHhiCmRsdTdYSW0rQXlHVW4wajhzaXo4cW9qS2JPK3JFUFYvSW1USDVXN1EzNnJYU2Rndk5VV3BLcktJQzVTOFBVRjUKVDRwSCtscFlJbFFIblRhS011cUgzbk8zSTQwSWhFaFBhYTJ3QXd5MmtEbHo0NmZKY3I2YU16ajZaZzQzSjVVSwpaaWQrQlFzaVdBVWF1NVY3Q3BDN0dNQ3g0WWRPWldXc1QzZEFzdWc5aHZ3VGU4MWtLMUpvVEgwanV3UFRCSDB0CnhVZ1VWSVd5dXdlTTFVd1lGM244SG13cTZCNDZZbXVqaE1ES1QrM2xncVp0N2VaMVh2aWVMZEJSbFZRV3pPYS8KNlFZVGtycXdQWmlvS0lTdHJ4VkdZams0MHFFQ05vZENTQ0l3UkRnYm5RdWJSV3Jkc2x4aUl5YzVibEpOdU9WKwpqZ3Y1ZDJFZVVwd1VqdnBadUVWN0ZxUEtHUmdpRzBqZmw2UHNtczlnWVVYZCt5M3l0RzlIZW9ETm1MVFNUQkU0Cm5DUVhYOTM1UDIveE91b2s2Q3BpR3BQODlEWDd0OHlpd2s4TEZOblkzcnZ2NTBuVnk4a2VyVmRuZkhUbW9NWjkKL0lCZ29qU0lLb3Y0bG1QS2RnekZmaW16aGJzc1ZDYTRETy9MSWhURjdiUWJIMXV0L09xN25wZE9wTWpMWUlCRQo5bGFndlJWVFZGd1QvdXdyQ2NYSENiMjFiL3B1d1Y5NFNOWFZ3dDdCaGVGVEZCZHR4SnJSNGpqcjJUNW9kTGtYCjZuUWNZOFYyT1Q3S094bjBLVmM2cGwzc2FKVExtTCtILzNDdEFhbzlOdG11VURhcEtJTlJTVk55dmc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==" + +mkdir -p $DATA_DIR + # Set the config file contents for the path passed in as the first argument function _set_config(){ cat <$1 @@ -36,20 +42,24 @@ function _set_config(){ EOF } -DATA_DIRS=("$DATA_DIR/node1" "$DATA_DIR/node2" "$DATA_DIR/node3" "$DATA_DIR/node4" "$DATA_DIR/node5") +DATA_DIRS=() CMDS=() for (( i=0; i <5; i++ )) do - echo "Creating data directory: ${DATA_DIRS[i]}" - mkdir -p ${DATA_DIRS[i]} - NODE_DATA_DIR=${DATA_DIRS[i]} + NODE_NAME=node$(($i+1)) + NODE_DATA_DIR="$DATA_DIR/$NODE_NAME" + DATA_DIRS+=("$NODE_DATA_DIR") + echo "Creating data directory: $NODE_DATA_DIR" + mkdir -p $NODE_DATA_DIR NODE_CONFIG_FILE_PATH="$NODE_DATA_DIR/config.json" _set_config $NODE_CONFIG_FILE_PATH - CMD="$AVALANCHEGO_PATH --data-dir=$NODE_DATA_DIR" + CMD="$AVALANCHEGO_PATH --data-dir=$NODE_DATA_DIR --config-file=$NODE_CONFIG_FILE_PATH" if [ $i -gt 0 ]; then echo "Adding CLI options for node$(($i+1))" - CMD="$CMD --staking-port=$((9651+2*$i)) --http-port=$((9650+2*$i)) --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=NodeID-5Q84knz4UyG4AkUdo7r2KiUiK6FHKxA8Z" + CMD="$CMD --staking-port=$((9651+2*$i)) --http-port=$((9650+2*$i)) --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg" + else + CMD="$CMD --staking-tls-key-file-content=$STAKING_TLS_KEY_FILE_CONTENT --staking-tls-cert-file-content=$STAKING_TLS_CRT_FILE_CONTENT" fi echo "Created command $CMD" @@ -61,15 +71,21 @@ echo "Starting AvalancheGo network with the commands:" echo "" for (( i=0; i<5; i++ )) do - echo "CMD $i : ${CMDS[i]}" + echo "CMD $i: ${CMDS[i]}" echo "" done # cleanup sends SIGINT to each tracked process function cleanup_process_group(){ echo "Terminating AvalancheGo network process group" - kill 0 + kill 0 # This kills a process group rather than a process with the ID 0, used to kill subshell to cleanup below } +function execute_cmd() { + echo "Executing command: $@" + $@ +} -(trap 'cleanup_process_group' SIGINT; ${CMDS[0]} & ${CMDS[1]} & ${CMDS[2]} & ${CMDS[3]} & ${CMDS[4]} & wait) +# TODO change from executing each CMD by index to iterate and execute each command within the subshell +# Trap SIGINT and cleanup the processes within this subshell after receiving SIGINT (ctrl-c) +(trap 'cleanup_process_group' SIGINT; execute_cmd ${CMDS[0]} & execute_cmd ${CMDS[1]} & execute_cmd ${CMDS[2]} & execute_cmd ${CMDS[3]} & execute_cmd ${CMDS[4]} & wait) diff --git a/scripts/run_simulator.sh b/scripts/run_simulator.sh new file mode 100644 index 0000000000..006b7b6390 --- /dev/null +++ b/scripts/run_simulator.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -e + +################################# +echo "building simulator" +pushd ./cmd/simulator +go install -v . + +popd +echo "running simulator" +simulator \ +--cluster-info-yaml=$SIMULATOR_CLUSTER_YAML_FILE_PATH \ +--keys=./cmd/simulator/.simulator/keys \ +--timeout=30s \ +--concurrency=10 \ +--base-fee=25 \ +--priority-fee=1 diff --git a/tests/load/load_test.go b/tests/load/load_test.go index ca4c4e7f17..6e62418066 100644 --- a/tests/load/load_test.go +++ b/tests/load/load_test.go @@ -2,182 +2,71 @@ // See the file LICENSE for licensing terms. // e2e implements the e2e tests. -package load +package precompile import ( "context" - "flag" "fmt" "os" + "os/exec" "testing" "time" - "github.com/ava-labs/avalanche-network-runner/client" - "github.com/ava-labs/avalanche-network-runner/rpcpb" - "github.com/ava-labs/avalanche-network-runner/utils/constants" - "github.com/ava-labs/avalanche-network-runner/ux" - "github.com/ava-labs/avalanchego/utils/logging" + "github.com/ava-labs/avalanchego/api/health" + "github.com/ava-labs/subnet-evm/tests/precompile/utils" + "github.com/ethereum/go-ethereum/log" + "github.com/go-cmd/cmd" ginkgo "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" + + _ "github.com/ava-labs/subnet-evm/tests/precompile/solidity" ) +var startCmd *cmd.Cmd + func TestE2E(t *testing.T) { gomega.RegisterFailHandler(ginkgo.Fail) - ginkgo.RunSpecs(t, "load test") -} - -// What do I need to be present here? -// AvalancheGo -// Plugin directory with plugin binary - - -var ( - logLevel string - logDir string - gRPCEp string - gRPCGatewayEp string - execPath1 string - execPath2 string - subnetEvmPath string - - newNodeName = "test-add-node" - customNodeConfigs = map[string]string{ - "node1": `{"api-admin-enabled":true}`, - "node2": `{"api-admin-enabled":true}`, - "node3": `{"api-admin-enabled":true}`, - "node4": `{"api-admin-enabled":false}`, - "node5": `{"api-admin-enabled":false}`, - "node6": `{"api-admin-enabled":false}`, - "node7": `{"api-admin-enabled":false}`, - } - numNodes = uint32(5) -) - -func init() { - flag.StringVar( - &logLevel, - "log-level", - logging.Info.String(), - "log level", - ) - flag.StringVar( - &logDir, - "log-dir", - "", - "log directory", - ) - flag.StringVar( - &gRPCEp, - "grpc-endpoint", - "0.0.0.0:8080", - "gRPC server endpoint", - ) - flag.StringVar( - &gRPCGatewayEp, - "grpc-gateway-endpoint", - "0.0.0.0:8081", - "gRPC gateway endpoint", - ) - flag.StringVar( - &execPath1, - "avalanchego-path-1", - "", - "avalanchego executable path (to upgrade from)", - ) - flag.StringVar( - &execPath2, - "avalanchego-path-2", - "", - "avalanchego executable path (to upgrade to)", - ) - flag.StringVar( - &subnetEvmPath, - "subnet-evm-path", - "", - "path to subnet-evm binary", - ) + ginkgo.RunSpecs(t, "subnet-evm load test suite") } -var ( - cli client.Client - log logging.Logger -) - +// BeforeSuite starts an AvalancheGo process to use for the e2e tests var _ = ginkgo.BeforeSuite(func() { - var err error - logDir, err = os.MkdirTemp("", fmt.Sprintf("subnet-evm-load-test-%d", time.Now().Unix())) - gomega.Ω(err).Should(gomega.BeNil()) - lvl, err := logging.ToLevel(logLevel) - gomega.Ω(err).Should(gomega.BeNil()) - lcfg := logging.Config{ - DisplayLevel: lvl, - } - logFactory := logging.NewFactory(lcfg) - log, err = logFactory.Make(constants.LogNameTest) - gomega.Ω(err).Should(gomega.BeNil()) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() - cli, err = client.New(client.Config{ - Endpoint: gRPCEp, - DialTimeout: 10 * time.Second, - }, log) - gomega.Ω(err).Should(gomega.BeNil()) + var err error + wd, err := os.Getwd() + gomega.Expect(err).Should(gomega.BeNil()) + log.Info("Starting AvalancheGo node", "wd", wd) + startCmd, err = utils.RunCommand("./scripts/run.sh") + gomega.Expect(err).Should(gomega.BeNil()) + + // Assumes that startCmd will launch a node with HTTP Port at [utils.DefaultLocalNodeURI] + healthClient := health.NewClient(utils.DefaultLocalNodeURI) + healthy, err := health.AwaitReady(ctx, healthClient, 5*time.Second) + gomega.Expect(err).Should(gomega.BeNil()) + gomega.Expect(healthy).Should(gomega.BeTrue()) + log.Info("AvalancheGo node is healthy") }) -var _ = ginkgo.AfterSuite(func() { - ux.Print(log, logging.Red.Wrap("shutting down cluster")) - ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) - _, err := cli.Stop(ctx) - cancel() - gomega.Ω(err).Should(gomega.BeNil()) +var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { + ginkgo.It("basic load test", ginkgo.Label("load"), func() { + // client := health.NewClient(utils.DefaultLocalNodeURI) - ux.Print(log, logging.Red.Wrap("shutting down client")) - err = cli.Close() - gomega.Ω(err).Should(gomega.BeNil()) -}) + // err = os.Setenv("RPC_URI", rpcURI) + // gomega.Expect(err).Should(gomega.BeNil()) + cmd := exec.Command("./scripts/run_simulator.sh") + log.Info("Running load simulator script", "cmd", cmd.String()) -var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() { - ginkgo.It("test", func() { - ginkgo.By("start with blockchain specs", func() { - ux.Print(log, logging.Green.Wrap("sending 'start' with the valid binary path: %s"), execPath1) - ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) - resp, err := cli.Start(ctx, execPath1, - client.WithBlockchainSpecs([]*rpcpb.BlockchainSpec{ - { - VmName: "subnetevm", - Genesis: "tests/e2e/subnet-evm-genesis.json", - }, - }), - ) - cancel() - gomega.Ω(err).Should(gomega.BeNil()) - ux.Print(log, logging.Green.Wrap("successfully started, node-names: %s"), resp.ClusterInfo.NodeNames) - }) + out, err := cmd.CombinedOutput() + fmt.Printf("\nCombined output:\n\n%s\n", string(out)) + gomega.Expect(err).Should(gomega.BeNil()) }) }) -func waitForCustomChainsHealthy() string { - ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) - var created bool - continueLoop := true - for continueLoop { - select { - case <-ctx.Done(): - continueLoop = false - case <-time.After(5 * time.Second): - cctx, ccancel := context.WithTimeout(context.Background(), 15*time.Second) - status, err := cli.Status(cctx) - ccancel() - gomega.Ω(err).Should(gomega.BeNil()) - created = status.ClusterInfo.CustomChainsHealthy - if created { - existingSubnetID := status.ClusterInfo.GetSubnets()[0] - gomega.Ω(existingSubnetID).Should(gomega.Not(gomega.BeNil())) - cancel() - return existingSubnetID - } - } - } - cancel() - gomega.Ω(created).Should(gomega.Equal(true)) - return "" -} +var _ = ginkgo.AfterSuite(func() { + gomega.Expect(startCmd).ShouldNot(gomega.BeNil()) + gomega.Expect(startCmd.Stop()).Should(gomega.BeNil()) + // TODO add a new node to bootstrap off of the existing node and ensure it can bootstrap all subnets + // created during the test +}) diff --git a/tests/precompile/precompile_test.go b/tests/precompile/precompile_test.go index fffdc42eb3..ea3266f66f 100644 --- a/tests/precompile/precompile_test.go +++ b/tests/precompile/precompile_test.go @@ -36,7 +36,7 @@ var _ = ginkgo.BeforeSuite(func() { wd, err := os.Getwd() gomega.Expect(err).Should(gomega.BeNil()) log.Info("Starting AvalancheGo node", "wd", wd) - startCmd, err = utils.RunCommand("./scripts/run_single_node.sh") + startCmd, err = utils.RunCommand("./scripts/run.sh") gomega.Expect(err).Should(gomega.BeNil()) // Assumes that startCmd will launch a node with HTTP Port at [utils.DefaultLocalNodeURI] diff --git a/tests/precompile/utils/constants.go b/tests/precompile/utils/constants.go index faf5908016..75cc779bd3 100644 --- a/tests/precompile/utils/constants.go +++ b/tests/precompile/utils/constants.go @@ -3,4 +3,7 @@ package utils -var DefaultLocalNodeURI = "http://127.0.0.1:9650" +var ( + DefaultLocalNodeURI = "http://127.0.0.1:9650" + NodeURIs = []string{DefaultLocalNodeURI, "http://127.0.0.1:9652", "http://127.0.0.1:9654", "http://127.0.0.1:9656", "http://127.0.0.1:9658"} +) From fa6ca0a6188c9e5b947a9eae0b0b8d95511977bc Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 00:04:46 -0500 Subject: [PATCH 32/55] Fix load test --- .github/workflows/lint-tests-release.yml | 19 - cmd/simulator/go.mod | 61 +-- cmd/simulator/go.sum | 514 ++------------------- cmd/simulator/main.go | 56 +-- cmd/simulator/metrics/metrics.go | 10 +- cmd/simulator/worker/worker.go | 13 +- go.mod | 5 - go.sum | 18 - scripts/run.sh | 12 +- scripts/run_simulator.sh | 33 +- tests/load/genesis/genesis.json | 45 ++ tests/load/load_test.go | 25 +- tests/precompile/precompile_test.go | 2 +- tests/precompile/solidity/suites.go | 149 ++---- tests/{precompile => }/utils/command.go | 0 tests/{precompile => }/utils/constants.go | 0 tests/{precompile => }/utils/evm_client.go | 0 tests/utils/subnet.go | 107 +++++ 18 files changed, 294 insertions(+), 775 deletions(-) mode change 100644 => 100755 scripts/run_simulator.sh create mode 100644 tests/load/genesis/genesis.json rename tests/{precompile => }/utils/command.go (100%) rename tests/{precompile => }/utils/constants.go (100%) rename tests/{precompile => }/utils/evm_client.go (100%) create mode 100644 tests/utils/subnet.go diff --git a/.github/workflows/lint-tests-release.yml b/.github/workflows/lint-tests-release.yml index 7475c9e046..de0753e5bc 100644 --- a/.github/workflows/lint-tests-release.yml +++ b/.github/workflows/lint-tests-release.yml @@ -73,25 +73,6 @@ jobs: shell: bash run: AVALANCHE_BINARY_PATH=/tmp/e2e-test/avalanchego/avalanchego DATA_DIR=/tmp/e2e-test/avalanchego ./scripts/run_ginkgo.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: Install dependencies with go module - shell: bash - run: go mod download - - name: Run simulator tests - shell: bash - run: RUN_SIMULATOR=true scripts/run.sh - release: # needs: [lint_test, unit_test, e2e_test, simulator_test] runs-on: ubuntu-20.04 diff --git a/cmd/simulator/go.mod b/cmd/simulator/go.mod index b6699fd895..df7d5c7240 100644 --- a/cmd/simulator/go.mod +++ b/cmd/simulator/go.mod @@ -3,78 +3,43 @@ module github.com/ava-labs/subnet-evm/cmd/simulator go 1.18 require ( - github.com/ava-labs/subnet-evm v0.0.0-00010101000000-000000000000 github.com/ethereum/go-ethereum v1.10.26 github.com/spf13/cobra v1.5.0 golang.org/x/sync v0.1.0 sigs.k8s.io/yaml v1.3.0 ) -// always depend on the local version -replace github.com/ava-labs/subnet-evm => ../.. - require ( github.com/VictoriaMetrics/fastcache v1.10.0 // indirect - github.com/ava-labs/avalanchego v1.9.6 // indirect - github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect github.com/deckarep/golang-set v1.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect - github.com/go-logr/logr v1.2.3 // indirect - github.com/go-logr/stdr v1.2.2 // indirect + github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-stack/stack v1.8.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/uuid v1.2.0 // indirect - github.com/gorilla/rpc v1.2.0 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/gorilla/websocket v1.4.2 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.12.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/mr-tron/base58 v1.2.0 // indirect - github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.13.0 // indirect - github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect + github.com/kr/pretty v0.1.0 // indirect + github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/prometheus/tsdb v0.10.0 // indirect github.com/rjeczalik/notify v0.9.2 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 // indirect github.com/stretchr/testify v1.8.1 // indirect - github.com/supranational/blst v0.3.11-0.20220920110316-f72618070295 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect github.com/tklauser/go-sysconf v0.3.5 // indirect github.com/tklauser/numcpus v0.2.2 // indirect + github.com/tyler-smith/go-bip39 v1.0.2 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - go.opentelemetry.io/otel v1.11.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.11.0 // indirect - go.opentelemetry.io/otel/sdk v1.11.0 // indirect - go.opentelemetry.io/otel/trace v1.11.0 // indirect - go.opentelemetry.io/proto/otlp v0.19.0 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.8.0 // indirect - go.uber.org/zap v1.24.0 // indirect golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect - golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5 // indirect - golang.org/x/net v0.1.0 // indirect - golang.org/x/sys v0.1.0 // indirect - golang.org/x/term v0.1.0 // indirect - golang.org/x/text v0.4.0 // indirect + golang.org/x/sys v0.3.0 // indirect + golang.org/x/text v0.5.0 // indirect golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect - gonum.org/v1/gonum v0.11.0 // indirect - google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c // indirect - google.golang.org/grpc v1.51.0-dev // indirect - google.golang.org/protobuf v1.28.1 // indirect - gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // 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/cmd/simulator/go.sum b/cmd/simulator/go.sum index 55e9756d60..4a262340f5 100644 --- a/cmd/simulator/go.sum +++ b/cmd/simulator/go.sum @@ -1,79 +1,22 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 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/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= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/ava-labs/avalanchego v1.9.6 h1:xDLo7iVf73ohgR3alhRJcEalM7B8Pi5HkgCesl8lkf8= -github.com/ava-labs/avalanchego v1.9.6/go.mod h1:ckdSQHeoRN6PmQ3TLgWAe6Kh9tFpU4Lu6MgDW4GrU/Q= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= 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/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= -github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -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/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= @@ -84,139 +27,60 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= 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/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -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.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/ethereum/go-ethereum v1.10.26 h1:i/7d9RBBwiXCEuyduBQzJw/mKmnvzsN14jqBmytw72s= github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -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/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -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= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -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/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gorilla/rpc v1.2.0 h1:WvvdC2lNeT1SP32zrIce5l0ECBfbAlmrmSBsuc57wfk= -github.com/gorilla/rpc v1.2.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.12.0 h1:kr3j8iIMR4ywO/O0rvksXaJvauGGCMg2zAZIiNZ9uIQ= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.12.0/go.mod h1:ummNFgdgLhhX7aIiy35vVmQNS0rWXknfPE0qe6fmFXg= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= 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= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -224,102 +88,70 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= 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= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= -github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d h1:AREM5mwr4u1ORQBMvzfzBgpsctsbQikCVpvC+tX285E= -github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= 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/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= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.24.0 h1:+0glovB9Jd6z3VR+ScSwQqXVTIfJcGA9UBM8yzQxhqg= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= -github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/tsdb v0.10.0 h1:If5rVCMTp6W2SiRAQFlbpJNgVlgMEd+U2GZckwK38ic= +github.com/prometheus/tsdb v0.10.0/go.mod h1:oi49uRhEe9dPUTlS3JRZOwJuVi6tmh10QSgwXEyGCt4= github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8= github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= 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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 h1:Oo2KZNP70KE0+IUJSidPj/BFS/RXNHmKIJOdckzml2E= +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.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/supranational/blst v0.3.11-0.20220920110316-f72618070295 h1:rVKS9JjtqE4/PscoIsP46sRnJhfq8YFbjlk0fUJTRnY= -github.com/supranational/blst v0.3.11-0.20220920110316-f72618070295/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI= github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4= @@ -327,387 +159,103 @@ github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITn github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= github.com/tyler-smith/go-bip39 v1.0.2 h1:+t3w+KwLXO6154GNJY+qUtIxLTmFjfUmpguQT1OlOT8= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= +github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.11.0 h1:kfToEGMDq6TrVrJ9Vht84Y8y9enykSZzDDZglV0kIEk= -go.opentelemetry.io/otel v1.11.0/go.mod h1:H2KtuEphyMvlhZ+F7tg9GRhAOe60moNx61Ex+WmiKkk= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.0 h1:0dly5et1i/6Th3WHn0M6kYiJfFNzhhxanrJ0bOfnjEo= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.0/go.mod h1:+Lq4/WkdCkjbGcBMVHHg2apTbv8oMBf29QCnyCCJjNQ= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.0 h1:eyJ6njZmH16h9dOKCi7lMswAnGsSOwgTqWzfxqcuNr8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.0/go.mod h1:FnDp7XemjN3oZ3xGunnfOUTVwd2XcvLbtRAuOSU3oc8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.0 h1:j2RFV0Qdt38XQ2Jvi4WIsQ56w8T7eSirYbMw19VXRDg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.0/go.mod h1:pILgiTEtrqvZpoiuGdblDgS5dbIaTgDrkIuKfEFkt+A= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.11.0 h1:v29I/NbVp7LXQYMFZhU6q17D0jSEbYOAVONlrO1oH5s= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.11.0/go.mod h1:/RpLsmbQLDO1XCbWAM4S6TSwj8FKwwgyKKyqtvVfAnw= -go.opentelemetry.io/otel/sdk v1.11.0 h1:ZnKIL9V9Ztaq+ME43IUi/eo22mNsb6a7tGfzaOWB5fo= -go.opentelemetry.io/otel/sdk v1.11.0/go.mod h1:REusa8RsyKaq0OlyangWXaw97t2VogoO4SSEeKkSTAk= -go.opentelemetry.io/otel/trace v1.11.0 h1:20U/Vj42SX+mASlXLmSGBg6jpI1jQtv682lZtTAOVFI= -go.opentelemetry.io/otel/trace v1.11.0/go.mod h1:nyYjis9jy0gytE9LXGU+/m1sHTKbRY0fX0hulNNDP1U= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= -go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= 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= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5 h1:rxKZ2gOnYxjfmakvUUqh9Gyb6KXfrj7JWTxORTYqb0E= -golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -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= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -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-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-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -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-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-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/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-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gonum.org/v1/gonum v0.11.0 h1:f1IJhK4Km5tBJmaiJXtk/PkL4cdVX6J+tGiM187uT5E= -gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c h1:QgY/XxIAIeccR+Ca/rDdKubLIU9rcJ3xfy1DC/Wd2Oo= -google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.51.0-dev h1:JIZpGUpbGAukP4rGiKJ/AnpK9BqMYV6Rdx94XWZckHY= -google.golang.org/grpc v1.51.0-dev/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -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/cmd/simulator/main.go b/cmd/simulator/main.go index 570e27121b..2b42c5f73a 100644 --- a/cmd/simulator/main.go +++ b/cmd/simulator/main.go @@ -15,7 +15,6 @@ import ( "github.com/ava-labs/subnet-evm/cmd/simulator/worker" "github.com/spf13/cobra" - "sigs.k8s.io/yaml" ) func init() { @@ -34,12 +33,13 @@ var ( timeout time.Duration keysDir string - clusterInfoYamlPath string - rpcEndpoints []string + rpcEndpoints []string concurrency int baseFee uint64 priorityFee uint64 + + defaultLocalNetworkCChainEndpoints = []string{"http://127.0.0.1:9650/ext/bc/C/rpc", "http://127.0.0.1:9652/ext/bc/C/rpc", "http://127.0.0.1:9654/ext/bc/C/rpc/ext/bc/C/rpc", "http://127.0.0.1:9656/ext/bc/C/rpc", "http://127.0.0.1:9658/ext/bc/C/rpc"} ) func newCommand() *cobra.Command { @@ -51,19 +51,19 @@ func newCommand() *cobra.Command { } cmd.PersistentFlags().DurationVarP(&timeout, "timeout", "t", time.Minute, "Duration to run simulator") - cmd.PersistentFlags().StringVarP(&keysDir, "keys", "k", ".simulator/keys", "Directory for key files") - cmd.PersistentFlags().StringVarP(&clusterInfoYamlPath, "cluster-info-yaml", "o", "", "If non-empty, it loads the endpoints from the YAML and overwrites --config") - cmd.PersistentFlags().StringSliceVarP(&rpcEndpoints, "endpoints", "e", nil, "If non-empty, it loads the endpoints from the YAML and overwrites --config") - cmd.PersistentFlags().IntVarP(&concurrency, "concurrency", "c", 10, "Concurrency") - cmd.PersistentFlags().Uint64VarP(&baseFee, "base-fee", "f", 25, "Base fee") - cmd.PersistentFlags().Uint64VarP(&priorityFee, "priority-fee", "p", 1, "Base fee") + cmd.PersistentFlags().StringVarP(&keysDir, "keys", "k", ".simulator/keys", "Directory to find key files") + cmd.PersistentFlags().StringSliceVarP(&rpcEndpoints, "rpc-endpoints", "e", defaultLocalNetworkCChainEndpoints, `Specifies a comma separated list of RPC Endpoints to use for the load test. Ex. "http://127.0.0.1:9650/ext/bc/C/rpc,http://127.0.0.1:9652/ext/bc/C/rpc". Defaults to the default RPC Endpoints for the C-Chain on a 5 Node local network.`) + cmd.PersistentFlags().IntVarP(&concurrency, "concurrency", "c", 10, "Number of concurrent workers to use during the load test") + cmd.PersistentFlags().Uint64VarP(&baseFee, "base-fee", "f", 25, "Base fee to use for each transaction issued into the load test") + cmd.PersistentFlags().Uint64VarP(&priorityFee, "priority-fee", "p", 1, "Priority fee to use for each transaction issued into the load test") return cmd } func runFunc(cmd *cobra.Command, args []string) { - log.Printf("launching simulator with rpc endpoints %q or cluster info yaml %q, timeout %v, concurrentcy %d, base fee %d, priority fee %d", - rpcEndpoints, clusterInfoYamlPath, timeout, concurrency, baseFee, priorityFee) + // TODO: use geth logger + log.Printf("launching simulator with rpc endpoints %q timeout %v, concurrentcy %d, base fee %d, priority fee %d", + rpcEndpoints, concurrency, baseFee, priorityFee) cfg := &worker.Config{ Endpoints: rpcEndpoints, @@ -72,35 +72,6 @@ func runFunc(cmd *cobra.Command, args []string) { PriorityFee: priorityFee, } - if clusterInfoYamlPath != "" { - log.Printf("loading cluster info yaml %q", clusterInfoYamlPath) - b, err := os.ReadFile(clusterInfoYamlPath) - if err != nil { - log.Fatalf("failed to read cluster info yaml %v", err) - } - var ci networkRunnerClusterInfo - if err = yaml.Unmarshal(b, &ci); err != nil { - log.Fatalf("failed to parse cluster info yaml %v", err) - } - - eps := make([]string, len(ci.URIs)) - for i := range eps { - /* - e.g., - - uris: - - http://127.0.0.1:32945 - - http://127.0.0.1:38948 - - http://127.0.0.1:47203 - - http://127.0.0.1:54708 - - http://127.0.0.1:64435 - endpoint: /ext/bc/oFzgVk4nzHApgcBAPXa7JLX5mhqAJnxQkiYD915tZ6LMPcPRu - */ - eps[i] = ci.URIs[i] + ci.Endpoint + "/rpc" - } - cfg.Endpoints = eps - } - ctx, cancel := context.WithTimeout(context.Background(), timeout) errc := make(chan error) go func() { @@ -120,8 +91,3 @@ func runFunc(cmd *cobra.Command, args []string) { } } } - -type networkRunnerClusterInfo struct { - URIs []string `json:"uris"` - Endpoint string `json:"endpoint"` -} diff --git a/cmd/simulator/metrics/metrics.go b/cmd/simulator/metrics/metrics.go index 821de7f28e..4df658164a 100644 --- a/cmd/simulator/metrics/metrics.go +++ b/cmd/simulator/metrics/metrics.go @@ -10,9 +10,9 @@ import ( "math/big" "time" - "github.com/ava-labs/subnet-evm/core/types" - "github.com/ava-labs/subnet-evm/ethclient" - "github.com/ava-labs/subnet-evm/params" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/params" ) const ( @@ -21,7 +21,7 @@ const ( // Monitor periodically prints metrics related to transaction activity on // a given network. -func Monitor(ctx context.Context, client ethclient.Client) error { +func Monitor(ctx context.Context, client *ethclient.Client) error { lastBlockNumber, err := client.BlockNumber(ctx) if err != nil { return fmt.Errorf("failed to get block number: %w", err) @@ -58,7 +58,7 @@ func Monitor(ctx context.Context, client ethclient.Client) error { gas := block.GasUsed() t := block.Time() - log.Printf("[block created] t: %v index: %d base fee: %d block gas cost: %d block txs: %d gas used: %d\n", time.Unix(int64(t), 0), i, block.BaseFee().Div(block.BaseFee(), big.NewInt(params.GWei)), block.BlockGasCost(), txs, gas) + log.Printf("[block created] t: %v index: %d base fee: %d block txs: %d gas used: %d\n", time.Unix(int64(t), 0), i, block.BaseFee().Div(block.BaseFee(), big.NewInt(params.GWei)), txs, gas) // Update Tx Count timeTxs[t] += txs diff --git a/cmd/simulator/worker/worker.go b/cmd/simulator/worker/worker.go index b398ec0988..80eacbce90 100644 --- a/cmd/simulator/worker/worker.go +++ b/cmd/simulator/worker/worker.go @@ -5,6 +5,7 @@ package worker import ( "context" + "errors" "fmt" "log" "math/big" @@ -13,10 +14,10 @@ import ( "github.com/ava-labs/subnet-evm/cmd/simulator/key" "github.com/ava-labs/subnet-evm/cmd/simulator/metrics" - "github.com/ava-labs/subnet-evm/core/types" - "github.com/ava-labs/subnet-evm/ethclient" - "github.com/ava-labs/subnet-evm/params" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/params" "golang.org/x/sync/errgroup" ) @@ -104,7 +105,7 @@ func createWorkers(ctx context.Context, keysDir string, endpoints []string, desi } type worker struct { - c ethclient.Client + c *ethclient.Client k *key.Key balance *big.Int @@ -112,6 +113,7 @@ type worker struct { } func newWorker(k *key.Key, endpoint string, keysDir string) (*worker, error) { + log.Printf("Creating worker endpoint %s, keysDir %s", endpoint, keysDir) client, err := ethclient.Dial(endpoint) if err != nil { return nil, fmt.Errorf("failed to create ethclient: %w", err) @@ -276,6 +278,9 @@ func (w *worker) confirmTransaction(ctx context.Context, tx common.Hash) (*big.I // Run attempts to apply load to a network specified in .simulator/config.yml // and periodically prints metrics about the traffic it generates. func Run(ctx context.Context, cfg *Config, keysDir string) error { + if len(cfg.Endpoints) == 0 { + return errors.New("cannot start worker with no endpoints") + } rclient, err := ethclient.Dial(cfg.Endpoints[0]) if err != nil { return err diff --git a/go.mod b/go.mod index f421489fa9..96a0852ba8 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.18 require ( github.com/VictoriaMetrics/fastcache v1.10.0 - github.com/ava-labs/avalanche-network-runner v1.3.5 github.com/ava-labs/avalanchego v1.9.6 github.com/cespare/cp v0.1.0 github.com/davecgh/go-spew v1.1.1 @@ -47,9 +46,7 @@ require ( ) require ( - github.com/Microsoft/go-winio v0.5.2 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect - github.com/ava-labs/coreth v0.11.6-rc.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/btcutil v1.1.3 // indirect @@ -83,7 +80,6 @@ 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/magiconair/properties v1.8.6 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect @@ -95,7 +91,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.9.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 diff --git a/go.sum b/go.sum index 6276681748..99c2d67c69 100644 --- a/go.sum +++ b/go.sum @@ -44,8 +44,6 @@ 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= @@ -63,12 +61,8 @@ 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.3.5 h1:l5rHPQBXrApXRtGrTq2ZIJ5a7f/sFjlkeheQ4kYjjtI= -github.com/ava-labs/avalanche-network-runner v1.3.5/go.mod h1:nrlPZ+vPCZ8lNF9XXwYtgZ57dkEpwF+sgRRppass0pE= github.com/ava-labs/avalanchego v1.9.6 h1:xDLo7iVf73ohgR3alhRJcEalM7B8Pi5HkgCesl8lkf8= github.com/ava-labs/avalanchego v1.9.6/go.mod h1:ckdSQHeoRN6PmQ3TLgWAe6Kh9tFpU4Lu6MgDW4GrU/Q= -github.com/ava-labs/coreth v0.11.6-rc.0 h1:P8g/vqVx7nZBUHhM95oq9bcsY37P1Y7NNVb7RPe0mW8= -github.com/ava-labs/coreth v0.11.6-rc.0/go.mod h1:xgjjJdl50zhHlWPP+3Ux5LxfvFcbSG60tGK6QUkFDhI= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= 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= @@ -347,8 +341,6 @@ 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= @@ -463,13 +455,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.9.0 h1:7KFNiCgZ91Ru4qW4CWPf/7jqtxLagGRmIxWldPP9VY4= -github.com/otiai10/copy v1.9.0/go.mod h1:hsfX19wcn0UWIHUQ3/4fHuehhk2UyArQ9dVFAn3FczI= -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.4.0 h1:umwcf7gbpEwf7WFzqmWwSv0CzbeMsae2u9ZvpP8j2q4= -github.com/otiai10/mint v1.4.0/go.mod h1:gifjb2MYOoULtKLqUAEILUG/9KONW6f7YsJ6vQLTlFI= 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= @@ -535,7 +520,6 @@ 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= @@ -559,7 +543,6 @@ github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969/go.mod h1:RZL 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.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -829,7 +812,6 @@ golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/scripts/run.sh b/scripts/run.sh index 099a72ff12..0b0618f655 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -86,6 +86,12 @@ function execute_cmd() { $@ } -# TODO change from executing each CMD by index to iterate and execute each command within the subshell -# Trap SIGINT and cleanup the processes within this subshell after receiving SIGINT (ctrl-c) -(trap 'cleanup_process_group' SIGINT; execute_cmd ${CMDS[0]} & execute_cmd ${CMDS[1]} & execute_cmd ${CMDS[2]} & execute_cmd ${CMDS[3]} & execute_cmd ${CMDS[4]} & wait) +execute_cmd ${CMDS[0]} + +# if [ $SINLGE_NODE != "true" ]; then +# execute_cmd ${CMDS[0]} +# else +# # TODO change from executing each CMD by index to iterate and execute each command within the subshell +# # Trap SIGINT and cleanup the processes within this subshell after receiving SIGINT (ctrl-c) +# (trap 'cleanup_process_group' SIGINT; execute_cmd ${CMDS[0]} & execute_cmd ${CMDS[1]} & execute_cmd ${CMDS[2]} & execute_cmd ${CMDS[3]} & execute_cmd ${CMDS[4]} & wait) +# fi diff --git a/scripts/run_simulator.sh b/scripts/run_simulator.sh old mode 100644 new mode 100755 index 006b7b6390..66219c6851 --- a/scripts/run_simulator.sh +++ b/scripts/run_simulator.sh @@ -1,17 +1,24 @@ #!/usr/bin/env bash set -e -################################# -echo "building simulator" -pushd ./cmd/simulator -go install -v . +echo "Beginning simualtor script" -popd -echo "running simulator" -simulator \ ---cluster-info-yaml=$SIMULATOR_CLUSTER_YAML_FILE_PATH \ ---keys=./cmd/simulator/.simulator/keys \ ---timeout=30s \ ---concurrency=10 \ ---base-fee=25 \ ---priority-fee=1 +run_simulator() { + ################################# + echo "building simulator" + pushd ./cmd/simulator + go install -v . + echo + + popd + echo "running simulator from $PWD" + simulator \ + --rpc-endpoints=$RPC_ENDPOINTS \ + --keys=./cmd/simulator/.simulator/keys \ + --timeout=30s \ + --concurrency=10 \ + --base-fee=300 \ + --priority-fee=100 +} + +run_simulator diff --git a/tests/load/genesis/genesis.json b/tests/load/genesis/genesis.json new file mode 100644 index 0000000000..cac224d1a2 --- /dev/null +++ b/tests/load/genesis/genesis.json @@ -0,0 +1,45 @@ +{ + "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 + } + }, + "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" + } + \ No newline at end of file diff --git a/tests/load/load_test.go b/tests/load/load_test.go index 6e62418066..6ab6a05d52 100644 --- a/tests/load/load_test.go +++ b/tests/load/load_test.go @@ -9,17 +9,16 @@ import ( "fmt" "os" "os/exec" + "strings" "testing" "time" "github.com/ava-labs/avalanchego/api/health" - "github.com/ava-labs/subnet-evm/tests/precompile/utils" + "github.com/ava-labs/subnet-evm/tests/utils" "github.com/ethereum/go-ethereum/log" "github.com/go-cmd/cmd" ginkgo "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" - - _ "github.com/ava-labs/subnet-evm/tests/precompile/solidity" ) var startCmd *cmd.Cmd @@ -49,12 +48,22 @@ var _ = ginkgo.BeforeSuite(func() { log.Info("AvalancheGo node is healthy") }) -var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { - ginkgo.It("basic load test", ginkgo.Label("load"), func() { - // client := health.NewClient(utils.DefaultLocalNodeURI) +var _ = ginkgo.Describe("[Load Simulator]", ginkgo.Ordered, func() { + ginkgo.It("basic subnet load test", ginkgo.Label("load"), func() { + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) + defer cancel() + + blockchainID := utils.CreateNewSubnet(ctx, "./tests/load/genesis/genesis.json") + + rpcEndpoints := make([]string, 0, len(utils.NodeURIs)) + for _, uri := range []string{utils.DefaultLocalNodeURI} { // TODO: use NodeURIs instead, hack until fixing multi node in a network behavior + rpcEndpoints = append(rpcEndpoints, fmt.Sprintf("%s/ext/bc/%s/rpc", uri, blockchainID)) + } + commaSeparatedRPCEndpoints := strings.Join(rpcEndpoints, ",") + err := os.Setenv("RPC_ENDPOINTS", commaSeparatedRPCEndpoints) + gomega.Expect(err).Should(gomega.BeNil()) - // err = os.Setenv("RPC_URI", rpcURI) - // gomega.Expect(err).Should(gomega.BeNil()) + log.Info("Sleeping with network running", "rpcEndpoints", commaSeparatedRPCEndpoints) cmd := exec.Command("./scripts/run_simulator.sh") log.Info("Running load simulator script", "cmd", cmd.String()) diff --git a/tests/precompile/precompile_test.go b/tests/precompile/precompile_test.go index ea3266f66f..d82b68b692 100644 --- a/tests/precompile/precompile_test.go +++ b/tests/precompile/precompile_test.go @@ -11,7 +11,7 @@ import ( "time" "github.com/ava-labs/avalanchego/api/health" - "github.com/ava-labs/subnet-evm/tests/precompile/utils" + "github.com/ava-labs/subnet-evm/tests/utils" "github.com/ethereum/go-ethereum/log" "github.com/go-cmd/cmd" ginkgo "github.com/onsi/ginkgo/v2" diff --git a/tests/precompile/solidity/suites.go b/tests/precompile/solidity/suites.go index 3cc631e391..f70f76f7f1 100644 --- a/tests/precompile/solidity/suites.go +++ b/tests/precompile/solidity/suites.go @@ -6,23 +6,10 @@ package solidity import ( "context" - "encoding/json" - "fmt" - "os" - "os/exec" "time" "github.com/ava-labs/avalanchego/api/health" - "github.com/ava-labs/avalanchego/api/info" - "github.com/ava-labs/avalanchego/genesis" - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/vms/secp256k1fx" - wallet "github.com/ava-labs/avalanchego/wallet/subnet/primary" - "github.com/ava-labs/subnet-evm/core" - "github.com/ava-labs/subnet-evm/plugin/evm" - "github.com/ava-labs/subnet-evm/tests/precompile/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" + "github.com/ava-labs/subnet-evm/tests/utils" ginkgo "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" ) @@ -36,130 +23,46 @@ var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { }) }) -func runHardhatTests(test string, rpcURI string) { - log.Info("Sleeping to wait for test ping", "rpcURI", rpcURI) - client, err := utils.NewEvmClient(rpcURI, 225, 2) // TODO this is failing because the Avalanche engine does not start bootstrapping of subnets when staking is disabled - gomega.Expect(err).Should(gomega.BeNil()) - - bal, err := client.FetchBalance(context.Background(), common.HexToAddress("")) - gomega.Expect(err).Should(gomega.BeNil()) - gomega.Expect(bal.Cmp(common.Big0)).Should(gomega.Equal(0)) - - err = os.Setenv("RPC_URI", rpcURI) - gomega.Expect(err).Should(gomega.BeNil()) - cmd := exec.Command("npx", "hardhat", "test", fmt.Sprintf("./test/%s.ts", test), "--network", "local") - cmd.Dir = "./contract-examples" - log.Info("Running hardhat command", "cmd", cmd.String()) - - out, err := cmd.CombinedOutput() - fmt.Printf("\nCombined output:\n\n%s\n", string(out)) - gomega.Expect(err).Should(gomega.BeNil()) -} - -func createNewSubnet(ctx context.Context, genesisFilePath string) string { - kc := secp256k1fx.NewKeychain(genesis.EWOQKey) - - // NewWalletFromURI fetches the available UTXOs owned by [kc] on the network - // that [LocalAPIURI] is hosting. - wallet, err := wallet.NewWalletFromURI(ctx, utils.DefaultLocalNodeURI, kc) - gomega.Expect(err).Should(gomega.BeNil()) - - pWallet := wallet.P() - - owner := &secp256k1fx.OutputOwners{ - Threshold: 1, - Addrs: []ids.ShortID{ - genesis.EWOQKey.PublicKey().Address(), - }, - } - - wd, err := os.Getwd() - gomega.Expect(err).Should(gomega.BeNil()) - log.Info("Reading genesis file", "filePath", genesisFilePath, "pwd", wd) - genesisBytes, err := os.ReadFile(genesisFilePath) - gomega.Expect(err).Should(gomega.BeNil()) - - log.Info("Creating new subnet") - createSubnetTxID, err := pWallet.IssueCreateSubnetTx(owner) - gomega.Expect(err).Should(gomega.BeNil()) - - genesis := &core.Genesis{} - err = json.Unmarshal(genesisBytes, genesis) - gomega.Expect(err).Should(gomega.BeNil()) - - log.Info("Creating new Subnet-EVM blockchain", "genesis", genesis) - createChainTxID, err := pWallet.IssueCreateChainTx( - createSubnetTxID, - genesisBytes, - evm.ID, - nil, - "testChain", - ) - gomega.Expect(err).Should(gomega.BeNil()) - - // Confirm the new blockchain is ready by waiting for the readiness endpoint - infoClient := info.NewClient(utils.DefaultLocalNodeURI) - bootstrapped, err := info.AwaitBootstrapped(ctx, infoClient, createChainTxID.String(), 5*time.Second) - gomega.Expect(err).Should(gomega.BeNil()) - gomega.Expect(bootstrapped).Should(gomega.BeTrue()) - - // Return the RPC Endpoint for the new blockchain - return fmt.Sprintf("%s/ext/bc/%s/rpc", utils.DefaultLocalNodeURI, createChainTxID.String()) -} - -func executeHardHatTestOnNewBlockchain(ctx context.Context, test string) { - log.Info("Executing HardHat tests on a new blockchain", "test", test) - - genesisFilePath := fmt.Sprintf("./tests/precompile/genesis/%s.json", test) - - createSubnetCtx, cancel := context.WithTimeout(ctx, 15*time.Second) - defer cancel() - - chainURI := createNewSubnet(createSubnetCtx, genesisFilePath) - - log.Info("Created subnet successfully", "ChainURI", chainURI) - runHardhatTests(test, chainURI) -} - -// TODO: can we move where we register the precompile e2e tests, so that they stay within their package var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { // Each ginkgo It node specifies the name of the genesis file (in ./tests/precompile/genesis/) - //to use to launch the subnet and the name of the TS test file to run on the subnet (in ./contract-examples/tests/) + // to use to launch the subnet and the name of the TS test file to run on the subnet (in ./contract-examples/tests/) ginkgo.It("contract native minter", ginkgo.Label("solidity-with-npx"), func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - executeHardHatTestOnNewBlockchain(ctx, "contract_native_minter") + utils.ExecuteHardHatTestOnNewBlockchain(ctx, "contract_native_minter") }) - // ginkgo.It("tx allow list", ginkgo.Label("solidity-with-npx"), func() { - // ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - // defer cancel() + ginkgo.It("tx allow list", ginkgo.Label("solidity-with-npx"), func() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() - // executeHardHatTestOnNewBlockchain(ctx, "tx_allow_list") - // }) + utils.ExecuteHardHatTestOnNewBlockchain(ctx, "tx_allow_list") + }) - // ginkgo.It("contract deployer allow list", ginkgo.Label("solidity-with-npx"), func() { - // ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - // defer cancel() + ginkgo.It("contract deployer allow list", ginkgo.Label("solidity-with-npx"), func() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() - // executeHardHatTestOnNewBlockchain(ctx, "contract_deployer_allow_list") - // }) + utils.ExecuteHardHatTestOnNewBlockchain(ctx, "contract_deployer_allow_list") + }) - // ginkgo.It("fee manager", ginkgo.Label("solidity-with-npx"), func() { - // ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - // defer cancel() + ginkgo.It("fee manager", ginkgo.Label("solidity-with-npx"), func() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() - // executeHardHatTestOnNewBlockchain(ctx, "fee_manager") - // }) + utils.ExecuteHardHatTestOnNewBlockchain(ctx, "fee_manager") + }) - // ginkgo.It("reward manager", ginkgo.Label("solidity-with-npx"), func() { - // ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - // defer cancel() + ginkgo.It("reward manager", ginkgo.Label("solidity-with-npx"), func() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() - // executeHardHatTestOnNewBlockchain(ctx, "reward_manager") - // }) + utils.ExecuteHardHatTestOnNewBlockchain(ctx, "reward_manager") + }) + // TODO: can we refactor this so that it automagically checks to ensure each hardhat test file matches the name of a hardhat genesis file + // and then runs the hardhat tests for each one without forcing precompile developers to modify this file. // ADD YOUR PRECOMPILE HERE /* ginkgo.It("your precompile", ginkgo.Label("solidity-with-npx"), func() { @@ -168,7 +71,7 @@ var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { // Specify the name shared by the genesis file in ./tests/precompile/genesis/{your_precompile}.json // and the test file in ./contract-examples/tests/{your_precompile}.ts - executeHardHatTestOnNewBlockchain(ctx, "your_precompile") + ExecuteHardHatTestOnNewBlockchain(ctx, "your_precompile") }) */ }) diff --git a/tests/precompile/utils/command.go b/tests/utils/command.go similarity index 100% rename from tests/precompile/utils/command.go rename to tests/utils/command.go diff --git a/tests/precompile/utils/constants.go b/tests/utils/constants.go similarity index 100% rename from tests/precompile/utils/constants.go rename to tests/utils/constants.go diff --git a/tests/precompile/utils/evm_client.go b/tests/utils/evm_client.go similarity index 100% rename from tests/precompile/utils/evm_client.go rename to tests/utils/evm_client.go diff --git a/tests/utils/subnet.go b/tests/utils/subnet.go new file mode 100644 index 0000000000..d560d3422b --- /dev/null +++ b/tests/utils/subnet.go @@ -0,0 +1,107 @@ +// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package utils + +import ( + "context" + "encoding/json" + "fmt" + "os" + "os/exec" + "time" + + "github.com/ava-labs/avalanchego/api/info" + "github.com/ava-labs/avalanchego/genesis" + "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/avalanchego/vms/secp256k1fx" + wallet "github.com/ava-labs/avalanchego/wallet/subnet/primary" + "github.com/ava-labs/subnet-evm/core" + "github.com/ava-labs/subnet-evm/plugin/evm" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" + "github.com/onsi/gomega" +) + +func RunHardhatTests(test string, rpcURI string) { + log.Info("Sleeping to wait for test ping", "rpcURI", rpcURI) + client, err := NewEvmClient(rpcURI, 225, 2) + gomega.Expect(err).Should(gomega.BeNil()) + + bal, err := client.FetchBalance(context.Background(), common.HexToAddress("")) + gomega.Expect(err).Should(gomega.BeNil()) + gomega.Expect(bal.Cmp(common.Big0)).Should(gomega.Equal(0)) + + err = os.Setenv("RPC_URI", rpcURI) + gomega.Expect(err).Should(gomega.BeNil()) + cmd := exec.Command("npx", "hardhat", "test", fmt.Sprintf("./test/%s.ts", test), "--network", "local") + cmd.Dir = "./contract-examples" + log.Info("Running hardhat command", "cmd", cmd.String()) + + out, err := cmd.CombinedOutput() + fmt.Printf("\nCombined output:\n\n%s\n", string(out)) + gomega.Expect(err).Should(gomega.BeNil()) +} + +func CreateNewSubnet(ctx context.Context, genesisFilePath string) string { + kc := secp256k1fx.NewKeychain(genesis.EWOQKey) + + // NewWalletFromURI fetches the available UTXOs owned by [kc] on the network + // that [LocalAPIURI] is hosting. + wallet, err := wallet.NewWalletFromURI(ctx, DefaultLocalNodeURI, kc) + gomega.Expect(err).Should(gomega.BeNil()) + + pWallet := wallet.P() + + owner := &secp256k1fx.OutputOwners{ + Threshold: 1, + Addrs: []ids.ShortID{ + genesis.EWOQKey.PublicKey().Address(), + }, + } + + wd, err := os.Getwd() + gomega.Expect(err).Should(gomega.BeNil()) + log.Info("Reading genesis file", "filePath", genesisFilePath, "pwd", wd) + genesisBytes, err := os.ReadFile(genesisFilePath) + gomega.Expect(err).Should(gomega.BeNil()) + + log.Info("Creating new subnet") + createSubnetTxID, err := pWallet.IssueCreateSubnetTx(owner) + gomega.Expect(err).Should(gomega.BeNil()) + + genesis := &core.Genesis{} + err = json.Unmarshal(genesisBytes, genesis) + gomega.Expect(err).Should(gomega.BeNil()) + + log.Info("Creating new Subnet-EVM blockchain", "genesis", genesis) + createChainTxID, err := pWallet.IssueCreateChainTx( + createSubnetTxID, + genesisBytes, + evm.ID, + nil, + "testChain", + ) + gomega.Expect(err).Should(gomega.BeNil()) + + // Confirm the new blockchain is ready by waiting for the readiness endpoint + infoClient := info.NewClient(DefaultLocalNodeURI) + bootstrapped, err := info.AwaitBootstrapped(ctx, infoClient, createChainTxID.String(), 2*time.Second) + gomega.Expect(err).Should(gomega.BeNil()) + gomega.Expect(bootstrapped).Should(gomega.BeTrue()) + + // Return the blockchainID of the newly created blockchain + return createChainTxID.String() +} + +func ExecuteHardHatTestOnNewBlockchain(ctx context.Context, test string) { + log.Info("Executing HardHat tests on a new blockchain", "test", test) + + genesisFilePath := fmt.Sprintf("./tests/precompile/genesis/%s.json", test) + + blockchainID := CreateNewSubnet(ctx, genesisFilePath) + chainURI := fmt.Sprintf("%s/ext/bc/%s/rpc", DefaultLocalNodeURI, blockchainID) + + log.Info("Created subnet successfully", "ChainURI", chainURI) + RunHardhatTests(test, chainURI) +} From 2fa5df90338a3a263e1f0fe90d8ab1a955d8f541 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 00:18:48 -0500 Subject: [PATCH 33/55] go mod update to ago v1.9.7 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 96a0852ba8..fb7fb410a9 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/VictoriaMetrics/fastcache v1.10.0 - github.com/ava-labs/avalanchego v1.9.6 + github.com/ava-labs/avalanchego v1.9.7 github.com/cespare/cp v0.1.0 github.com/davecgh/go-spew v1.1.1 github.com/deckarep/golang-set v1.8.0 diff --git a/go.sum b/go.sum index 99c2d67c69..eac7c26609 100644 --- a/go.sum +++ b/go.sum @@ -61,8 +61,8 @@ 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/avalanchego v1.9.6 h1:xDLo7iVf73ohgR3alhRJcEalM7B8Pi5HkgCesl8lkf8= -github.com/ava-labs/avalanchego v1.9.6/go.mod h1:ckdSQHeoRN6PmQ3TLgWAe6Kh9tFpU4Lu6MgDW4GrU/Q= +github.com/ava-labs/avalanchego v1.9.7 h1:f2vS8jUBZmrqPcfU5NEa7dSHXbKfTB0EyjcCyvqxqPw= +github.com/ava-labs/avalanchego v1.9.7/go.mod h1:ckdSQHeoRN6PmQ3TLgWAe6Kh9tFpU4Lu6MgDW4GrU/Q= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= 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= From 1433b8ef1135d5ea77352626c15a33f3741d7efa Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 00:21:36 -0500 Subject: [PATCH 34/55] Fix allowed geth imports for simulator --- scripts/lint_allowed_geth_imports.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lint_allowed_geth_imports.sh b/scripts/lint_allowed_geth_imports.sh index cf1ba23e22..20d11cd936 100755 --- a/scripts/lint_allowed_geth_imports.sh +++ b/scripts/lint_allowed_geth_imports.sh @@ -8,7 +8,7 @@ set -o pipefail # 1. Recursively search through all go files for any lines that include a direct import from go-ethereum # 2. Sort the unique results # #. Print out the difference between the search results and the list of specified allowed package imports from geth. -extra_imports=$(grep -r --include='*.go' '"github.com/ethereum/go-ethereum/.*"' -o -h | sort -u | comm -23 - ./scripts/geth-allowed-packages.txt) +extra_imports=$(grep -r --include='*.go' --exclude-dir=./cmd/simulator '"github.com/ethereum/go-ethereum/.*"' -o -h | sort -u | comm -23 - ./scripts/geth-allowed-packages.txt) if [ ! -z "${extra_imports}" ]; then echo "new go-ethereum imports should be added to ./scripts/geth-allowed-packages.txt to prevent accidental imports:" echo "${extra_imports}" From 42ad4c869f88e939759bcc8d793c1b3f25db4446 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 00:26:01 -0500 Subject: [PATCH 35/55] Populate constants to fix blst warning --- scripts/run_simulator.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/run_simulator.sh b/scripts/run_simulator.sh index 66219c6851..19022c4b32 100755 --- a/scripts/run_simulator.sh +++ b/scripts/run_simulator.sh @@ -3,6 +3,21 @@ set -e echo "Beginning simualtor script" +if ! [[ "$0" =~ scripts/run.sh ]]; then + echo "must be run from repository root, but got $0" + exit 255 +fi + +# Load the versions +SUBNET_EVM_PATH=$( + cd "$(dirname "${BASH_SOURCE[0]}")" + cd .. && pwd +) +source "$SUBNET_EVM_PATH"/scripts/versions.sh + +# Load the constants +source "$SUBNET_EVM_PATH"/scripts/constants.sh + run_simulator() { ################################# echo "building simulator" From 1af5f75e8342666a21781a94a01847c337052056 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 00:32:07 -0500 Subject: [PATCH 36/55] load constants in run ginkgo --- scripts/run_ginkgo.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/run_ginkgo.sh b/scripts/run_ginkgo.sh index 38db56aa8b..bf1088253e 100755 --- a/scripts/run_ginkgo.sh +++ b/scripts/run_ginkgo.sh @@ -11,6 +11,8 @@ SUBNET_EVM_PATH=$( cd .. && pwd ) +source "$SUBNET_EVM_PATH"/scripts/constants.sh + source "$SUBNET_EVM_PATH"/scripts/versions.sh # Build ginkgo From 05604b4216f1fb48d25bbd15be2944bbb78da1da Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 09:58:07 -0500 Subject: [PATCH 37/55] Update run simulator name check --- scripts/run_simulator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_simulator.sh b/scripts/run_simulator.sh index 19022c4b32..10249888a4 100755 --- a/scripts/run_simulator.sh +++ b/scripts/run_simulator.sh @@ -3,7 +3,7 @@ set -e echo "Beginning simualtor script" -if ! [[ "$0" =~ scripts/run.sh ]]; then +if ! [[ "$0" =~ scripts/run_simulator.sh ]]; then echo "must be run from repository root, but got $0" exit 255 fi From 367c9296ae2c7d7aed4270ee9351b4a0d7a3a5c0 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 10:43:25 -0500 Subject: [PATCH 38/55] Update data dir --- .github/workflows/lint-tests-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-tests-release.yml b/.github/workflows/lint-tests-release.yml index de0753e5bc..f491395333 100644 --- a/.github/workflows/lint-tests-release.yml +++ b/.github/workflows/lint-tests-release.yml @@ -71,7 +71,7 @@ jobs: run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy - name: Run E2E Tests shell: bash - run: AVALANCHE_BINARY_PATH=/tmp/e2e-test/avalanchego/avalanchego DATA_DIR=/tmp/e2e-test/avalanchego ./scripts/run_ginkgo.sh + run: AVALANCHE_BINARY_PATH=/tmp/e2e-test/avalanchego/avalanchego DATA_DIR=/tmp/e2e-test/data ./scripts/run_ginkgo.sh release: # needs: [lint_test, unit_test, e2e_test, simulator_test] From 11d035b6e79a9e4738087d820d75a2fde0a3fd70 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 10:53:53 -0500 Subject: [PATCH 39/55] Add plugin dir env variable --- .github/workflows/lint-tests-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-tests-release.yml b/.github/workflows/lint-tests-release.yml index f491395333..5281b37612 100644 --- a/.github/workflows/lint-tests-release.yml +++ b/.github/workflows/lint-tests-release.yml @@ -71,7 +71,7 @@ jobs: run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy - name: Run E2E Tests shell: bash - run: AVALANCHE_BINARY_PATH=/tmp/e2e-test/avalanchego/avalanchego DATA_DIR=/tmp/e2e-test/data ./scripts/run_ginkgo.sh + run: AVALANCHE_BINARY_PATH=/tmp/e2e-test/avalanchego/avalanchego AVALANCHEGO_PLUGIN_DIR=/tmp/e2e-test/avalanchego/plugins DATA_DIR=/tmp/e2e-test/data ./scripts/run_ginkgo.sh release: # needs: [lint_test, unit_test, e2e_test, simulator_test] From 574fdf32ca280982de956250b1a2b94da4b61a07 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 11:43:20 -0500 Subject: [PATCH 40/55] Update github action and env var used in install avago script --- .github/workflows/lint-tests-release.yml | 4 ++-- scripts/install_avalanchego_release.sh | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/lint-tests-release.yml b/.github/workflows/lint-tests-release.yml index 5281b37612..a478938e62 100644 --- a/.github/workflows/lint-tests-release.yml +++ b/.github/workflows/lint-tests-release.yml @@ -65,13 +65,13 @@ jobs: working-directory: ./contract-examples - name: Install AvalancheGo Release shell: bash - run: BASEDIR=/tmp/e2e-test AVAGO_FILEPATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh + run: BASEDIR=/tmp/e2e-test AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh - name: Build Subnet-EVM Plugin Binary shell: bash run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy - name: Run E2E Tests shell: bash - run: AVALANCHE_BINARY_PATH=/tmp/e2e-test/avalanchego/avalanchego AVALANCHEGO_PLUGIN_DIR=/tmp/e2e-test/avalanchego/plugins DATA_DIR=/tmp/e2e-test/data ./scripts/run_ginkgo.sh + run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego DATA_DIR=/tmp/e2e-test/data ./scripts/run_ginkgo.sh release: # needs: [lint_test, unit_test, e2e_test, simulator_test] diff --git a/scripts/install_avalanchego_release.sh b/scripts/install_avalanchego_release.sh index 1cb381d254..ad0fcc66bc 100755 --- a/scripts/install_avalanchego_release.sh +++ b/scripts/install_avalanchego_release.sh @@ -27,24 +27,24 @@ if [[ ${GOOS} == "darwin" ]]; then AVAGO_DOWNLOAD_PATH=${BASEDIR}/avalanchego-macos-${VERSION}.zip fi -AVAGO_FILEPATH=${AVAGO_FILEPATH:-${BASEDIR}/avalanchego-${VERSION}} -mkdir -p $AVAGO_FILEPATH +AVALANCHEGO_BUILD_PATH=${AVALANCHEGO_BUILD_PATH:-${BASEDIR}/avalanchego-${VERSION}} +mkdir -p $AVALANCHEGO_BUILD_PATH if [[ ! -f ${AVAGO_DOWNLOAD_PATH} ]]; then echo "downloading avalanchego ${VERSION} at ${AVAGO_DOWNLOAD_URL} to ${AVAGO_DOWNLOAD_PATH}" curl -L ${AVAGO_DOWNLOAD_URL} -o ${AVAGO_DOWNLOAD_PATH} fi -echo "extracting downloaded avalanchego to ${AVAGO_FILEPATH}" +echo "extracting downloaded avalanchego to ${AVALANCHEGO_BUILD_PATH}" if [[ ${GOOS} == "linux" ]]; then - mkdir -p ${AVAGO_FILEPATH} && tar xzvf ${AVAGO_DOWNLOAD_PATH} --directory ${AVAGO_FILEPATH} --strip-components 1 + mkdir -p ${AVALANCHEGO_BUILD_PATH} && tar xzvf ${AVAGO_DOWNLOAD_PATH} --directory ${AVALANCHEGO_BUILD_PATH} --strip-components 1 elif [[ ${GOOS} == "darwin" ]]; then - unzip ${AVAGO_DOWNLOAD_PATH} -d ${AVAGO_FILEPATH} - mv ${AVAGO_FILEPATH}/build/* ${AVAGO_FILEPATH} - rm -rf ${AVAGO_FILEPATH}/build/ + unzip ${AVAGO_DOWNLOAD_PATH} -d ${AVALANCHEGO_BUILD_PATH} + mv ${AVALANCHEGO_BUILD_PATH}/build/* ${AVALANCHEGO_BUILD_PATH} + rm -rf ${AVALANCHEGO_BUILD_PATH}/build/ fi -AVALANCHEGO_PATH=${AVAGO_FILEPATH}/avalanchego -AVALANCHEGO_PLUGIN_DIR=${AVAGO_FILEPATH}/plugins +AVALANCHEGO_PATH=${AVALANCHEGO_BUILD_PATH}/avalanchego +AVALANCHEGO_PLUGIN_DIR=${AVALANCHEGO_BUILD_PATH}/plugins echo "Installed AvalancheGo release ${VERSION}" echo "AvalancheGo Path: ${AVALANCHEGO_PATH}" From deea24a6cf0d70029932a4ab971109b5387aff2e Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 12:11:36 -0500 Subject: [PATCH 41/55] Filter out both precompile and load test from unit test script --- scripts/build_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_test.sh b/scripts/build_test.sh index bc8cd79fea..749b8e54c5 100755 --- a/scripts/build_test.sh +++ b/scripts/build_test.sh @@ -21,4 +21,4 @@ source "$SUBNET_EVM_PATH"/scripts/constants.sh # We pass in the arguments to this script directly to enable easily passing parameters such as enabling race detection, # parallelism, and test coverage. # DO NOT RUN "tests/e2e" since it's run by ginkgo -go test -coverprofile=coverage.out -covermode=atomic -timeout="30m" $@ $(go list ./... | grep -v tests/e2e) +go test -coverprofile=coverage.out -covermode=atomic -timeout="30m" $@ $(go list ./... | grep -v tests/precompile | grep -v tests/load) From e10b77b98104c5b1fe3bb2e4571dda4f857f052e Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 12:12:06 -0500 Subject: [PATCH 42/55] Add comment about skipping load test in unit test script --- scripts/build_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_test.sh b/scripts/build_test.sh index 749b8e54c5..ee88490b2e 100755 --- a/scripts/build_test.sh +++ b/scripts/build_test.sh @@ -20,5 +20,5 @@ source "$SUBNET_EVM_PATH"/scripts/constants.sh # We pass in the arguments to this script directly to enable easily passing parameters such as enabling race detection, # parallelism, and test coverage. -# DO NOT RUN "tests/e2e" since it's run by ginkgo +# DO NOT RUN "tests/e2e" or "tests/load" since it's run by ginkgo go test -coverprofile=coverage.out -covermode=atomic -timeout="30m" $@ $(go list ./... | grep -v tests/precompile | grep -v tests/load) From a15a0ec90108d47826048b55e76bbc697591d054 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 13:42:21 -0500 Subject: [PATCH 43/55] Fix lint geth allowed pkgs --- scripts/lint_allowed_geth_imports.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lint_allowed_geth_imports.sh b/scripts/lint_allowed_geth_imports.sh index 20d11cd936..acd0f92003 100755 --- a/scripts/lint_allowed_geth_imports.sh +++ b/scripts/lint_allowed_geth_imports.sh @@ -8,7 +8,7 @@ set -o pipefail # 1. Recursively search through all go files for any lines that include a direct import from go-ethereum # 2. Sort the unique results # #. Print out the difference between the search results and the list of specified allowed package imports from geth. -extra_imports=$(grep -r --include='*.go' --exclude-dir=./cmd/simulator '"github.com/ethereum/go-ethereum/.*"' -o -h | sort -u | comm -23 - ./scripts/geth-allowed-packages.txt) +extra_imports=$(grep -r --include='*.go' --exclude-dir='simulator' '"github.com/ethereum/go-ethereum/.*"' -o -h | sort -u | comm -23 - ./scripts/geth-allowed-packages.txt) if [ ! -z "${extra_imports}" ]; then echo "new go-ethereum imports should be added to ./scripts/geth-allowed-packages.txt to prevent accidental imports:" echo "${extra_imports}" From 9a4bc423a437a1d5cdf12eff474d581ced6a29d7 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 19:49:02 -0500 Subject: [PATCH 44/55] Address nits --- cmd/simulator/main.go | 12 +++++++++--- scripts/build_test.sh | 2 +- scripts/run_ginkgo.sh | 2 +- tests/load/load_test.go | 6 ++---- tests/precompile/precompile_test.go | 7 +++---- tests/utils/subnet.go | 2 +- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/cmd/simulator/main.go b/cmd/simulator/main.go index 2b42c5f73a..aac6310c43 100644 --- a/cmd/simulator/main.go +++ b/cmd/simulator/main.go @@ -39,7 +39,13 @@ var ( baseFee uint64 priorityFee uint64 - defaultLocalNetworkCChainEndpoints = []string{"http://127.0.0.1:9650/ext/bc/C/rpc", "http://127.0.0.1:9652/ext/bc/C/rpc", "http://127.0.0.1:9654/ext/bc/C/rpc/ext/bc/C/rpc", "http://127.0.0.1:9656/ext/bc/C/rpc", "http://127.0.0.1:9658/ext/bc/C/rpc"} + defaultLocalNetworkCChainEndpoints = []string{ + "http://127.0.0.1:9650/ext/bc/C/rpc", + "http://127.0.0.1:9652/ext/bc/C/rpc", + "http://127.0.0.1:9654/ext/bc/C/rpc", + "http://127.0.0.1:9656/ext/bc/C/rpc", + "http://127.0.0.1:9658/ext/bc/C/rpc", + } ) func newCommand() *cobra.Command { @@ -62,8 +68,8 @@ func newCommand() *cobra.Command { func runFunc(cmd *cobra.Command, args []string) { // TODO: use geth logger - log.Printf("launching simulator with rpc endpoints %q timeout %v, concurrentcy %d, base fee %d, priority fee %d", - rpcEndpoints, concurrency, baseFee, priorityFee) + log.Printf("launching simulator with rpc endpoints %q timeout %v, concurrency %d, base fee %d, priority fee %d", + rpcEndpoints, timeout, concurrency, baseFee, priorityFee) cfg := &worker.Config{ Endpoints: rpcEndpoints, diff --git a/scripts/build_test.sh b/scripts/build_test.sh index ee88490b2e..adb148a01e 100755 --- a/scripts/build_test.sh +++ b/scripts/build_test.sh @@ -20,5 +20,5 @@ source "$SUBNET_EVM_PATH"/scripts/constants.sh # We pass in the arguments to this script directly to enable easily passing parameters such as enabling race detection, # parallelism, and test coverage. -# DO NOT RUN "tests/e2e" or "tests/load" since it's run by ginkgo +# DO NOT RUN "tests/precompile" or "tests/load" since it's run by ginkgo go test -coverprofile=coverage.out -covermode=atomic -timeout="30m" $@ $(go list ./... | grep -v tests/precompile | grep -v tests/load) diff --git a/scripts/run_ginkgo.sh b/scripts/run_ginkgo.sh index bf1088253e..db9bd61bf2 100755 --- a/scripts/run_ginkgo.sh +++ b/scripts/run_ginkgo.sh @@ -3,7 +3,7 @@ set -e # This script assumes that an AvalancheGo and Subnet-EVM binaries are available in the standard location # within the $GOPATH -# The AvalancheGo and PluginDir paths can be specified via the environment variables used in ./scripts/run_single_node.sh. +# The AvalancheGo and PluginDir paths can be specified via the environment variables used in ./scripts/run.sh. # Load the versions SUBNET_EVM_PATH=$( diff --git a/tests/load/load_test.go b/tests/load/load_test.go index 6ab6a05d52..dc128526b5 100644 --- a/tests/load/load_test.go +++ b/tests/load/load_test.go @@ -1,7 +1,6 @@ -// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2023, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -// e2e implements the e2e tests. package precompile import ( @@ -25,7 +24,7 @@ var startCmd *cmd.Cmd func TestE2E(t *testing.T) { gomega.RegisterFailHandler(ginkgo.Fail) - ginkgo.RunSpecs(t, "subnet-evm load test suite") + ginkgo.RunSpecs(t, "subnet-evm small load simulator test suite") } // BeforeSuite starts an AvalancheGo process to use for the e2e tests @@ -33,7 +32,6 @@ var _ = ginkgo.BeforeSuite(func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - var err error wd, err := os.Getwd() gomega.Expect(err).Should(gomega.BeNil()) log.Info("Starting AvalancheGo node", "wd", wd) diff --git a/tests/precompile/precompile_test.go b/tests/precompile/precompile_test.go index d82b68b692..46acc862df 100644 --- a/tests/precompile/precompile_test.go +++ b/tests/precompile/precompile_test.go @@ -1,7 +1,6 @@ -// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2023, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -// e2e implements the e2e tests. package precompile import ( @@ -17,6 +16,7 @@ import ( ginkgo "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" + // Import the solidity package, so that ginkgo maps out the tests declared within the package _ "github.com/ava-labs/subnet-evm/tests/precompile/solidity" ) @@ -24,7 +24,7 @@ var startCmd *cmd.Cmd func TestE2E(t *testing.T) { gomega.RegisterFailHandler(ginkgo.Fail) - ginkgo.RunSpecs(t, "subnet-evm e2e test suites") + ginkgo.RunSpecs(t, "subnet-evm precompile ginkgo test suite") } // BeforeSuite starts an AvalancheGo process to use for the e2e tests @@ -32,7 +32,6 @@ var _ = ginkgo.BeforeSuite(func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - var err error wd, err := os.Getwd() gomega.Expect(err).Should(gomega.BeNil()) log.Info("Starting AvalancheGo node", "wd", wd) diff --git a/tests/utils/subnet.go b/tests/utils/subnet.go index d560d3422b..bd397e5f71 100644 --- a/tests/utils/subnet.go +++ b/tests/utils/subnet.go @@ -62,7 +62,7 @@ func CreateNewSubnet(ctx context.Context, genesisFilePath string) string { wd, err := os.Getwd() gomega.Expect(err).Should(gomega.BeNil()) - log.Info("Reading genesis file", "filePath", genesisFilePath, "pwd", wd) + log.Info("Reading genesis file", "filePath", genesisFilePath, "wd", wd) genesisBytes, err := os.ReadFile(genesisFilePath) gomega.Expect(err).Should(gomega.BeNil()) From 0446aaac5bf6f229028af83d7701baaa00989144 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 20:10:05 -0500 Subject: [PATCH 45/55] Remove unused DATA_DIRs var from run script --- scripts/run.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/run.sh b/scripts/run.sh index 0b0618f655..da64cdbfd5 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -42,13 +42,11 @@ function _set_config(){ EOF } -DATA_DIRS=() CMDS=() for (( i=0; i <5; i++ )) do NODE_NAME=node$(($i+1)) NODE_DATA_DIR="$DATA_DIR/$NODE_NAME" - DATA_DIRS+=("$NODE_DATA_DIR") echo "Creating data directory: $NODE_DATA_DIR" mkdir -p $NODE_DATA_DIR NODE_CONFIG_FILE_PATH="$NODE_DATA_DIR/config.json" From 64a14748dda6af387bc43d113339908077c3e47c Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 20:11:57 -0500 Subject: [PATCH 46/55] Add TODO to update run script to allow running N nodes instead of just one --- scripts/run.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/run.sh b/scripts/run.sh index da64cdbfd5..7e8a716db7 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -86,6 +86,8 @@ function execute_cmd() { execute_cmd ${CMDS[0]} +# TODO fix staking disabled bug (subnet does not start consensus with staking disabled when connected to other nodes) +# and add option to run either 1 node, 5 nodes, or N node network within a process group. # if [ $SINLGE_NODE != "true" ]; then # execute_cmd ${CMDS[0]} # else From 5dbe8b63e5e2356e182c22db8dd8df1878081638 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 25 Jan 2023 20:56:35 -0500 Subject: [PATCH 47/55] Update READMEs --- README.md | 636 +----------------------------------- contract-examples/README.md | 51 ++- 2 files changed, 51 insertions(+), 636 deletions(-) diff --git a/README.md b/README.md index 55f9629e85..e1240d1757 100644 --- a/README.md +++ b/README.md @@ -98,637 +98,9 @@ This will clone and checkout to `master` branch. ### Run Local Network -[`scripts/run.sh`](https://github.com/ava-labs/subnet-evm/blob/master/scripts/run.sh) automatically installs `avalanchego`, sets up a local network, -and creates a `subnet-evm` genesis file. The usage of this script is +To run a local network, it is recommended to use the [avalanche-cli](https://github.com/ava-labs/avalanche-cli#avalanche-cli) to set up an instance of Subnet-EVM on an local Avalanche Network. -```bash -DEFAULT_ACCOUNT=[GENESIS_ADDRESS] ./scripts/run.sh [AVALANCHEGO VERSION] -``` - -```bash -# to startup a local cluster (good for development) -cd ${HOME}/go/src/github.com/ava-labs/subnet-evm -git pull - -# to use the latest version "scripts/versions.sh" -./scripts/run.sh - -# to specify the version and default account for genesis -DEFAULT_ACCOUNT=0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC ./scripts/run.sh 1.9.2 -``` - -Note: make sure you check the version compatibility above between AvalancheGo and Subnet-evm and use the proper version of AvalancheGo. - -Note that this ewoq address (`0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC`) is a prefunded address on the local network, see [here](https://docs.avax.network/quickstart/fund-a-local-test-network) for more info. The private key for this address is -`0x56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027`. - -With this command, `avalanchego`, `avalanche-network-runner` and GoLang packages will be downloaded and installed on a `/tmp` directory. Note: please make sure that you have a fast internet connection to download these packages, otherwise, it will take a long time. - -Once the network is started up, the following info will be printed to the -console: - -```bash -cluster is ready! - -Logs Directory: /var/folders/0h/v4nrbbsn1vvbr5h2wfrh5h500000gn/T/network-runner-root-data2328077371 - -EVM Chain ID: 99999 -Funded Address: 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC -RPC Endpoints: -- http://127.0.0.1:14463/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc -- http://127.0.0.1:23930/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc -- http://127.0.0.1:31984/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc -- http://127.0.0.1:41274/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc -- http://127.0.0.1:57529/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc - -WS Endpoints: -- ws://127.0.0.1:14463/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/ws -- ws://127.0.0.1:23930/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/ws -- ws://127.0.0.1:31984/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/ws -- ws://127.0.0.1:41274/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/ws -- ws://127.0.0.1:57529/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/ws - -MetaMask Quick Start: -Funded Address: 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC -Network Name: Local EVM -RPC URL: http://127.0.0.1:14463/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc -Chain ID: 99999 -Currency Symbol: LEVM -network-runner RPC server is running on PID 79100... - -use the following command to terminate: - -pkill -P 79100 -kill -2 79100 -pkill -9 -f srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy -``` - -You can then ping the local cluster or add the network to MetaMask: - -```bash -curl --location --request POST 'http://127.0.0.1:14463/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "jsonrpc": "2.0", - "method": "eth_blockNumber", - "params":[], - "id": 1 -}' -``` - -Response: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": "0x0" -} -``` - -To terminate the cluster, run the following commands: - -```bash -pkill -P 79100 -kill -2 79100 -pkill -9 -f srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy -``` - -### Connect with Metamask - -Please use the value provided by `MetaMask Quick Start` to connect with Metamask. - -```text -MetaMask Quick Start: -Funded Address: 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC -Network Name: Local EVM -RPC URL: http://127.0.0.1:14463/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc -Chain ID: 99999 -Curreny Symbol: LEVM -``` - -You can create a new metamask account by importing the private key `0x56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027` and start experiencing with this account. - -### Load Simulator - -When building developing your own blockchain using `subnet-evm`, you may want -to analyze how your fee parameterization behaves and/or how many resources your VM -uses under different load patterns. For this reason, we developed `cmd/simulator`. -`cmd/simulator` lets your drive arbitrary load across any number of [endpoints] -with a user-specified `concurrency`, `base-fee`, and `priority-fee`. - -To get started, open the directory `cmd/simulator` and add your network's endpoints to -the file at `.simulator/config.yml` (these will be provided after running -`./scripts/run.sh`. With the example above, the correct endpoints is `http://127.0.0.1:14463/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc` to replace `http://localhost:9650/ext/bc/my-chain/rpc`.): - -```yaml -endpoints: - - http://localhost:9650/ext/bc/my-chain/rpc -base-fee: 25 -priority-fee: 1 -concurrency: 10 -``` +There are two options when using the Avalanche-CLI: -Once your config is specified, you can run the tool by either invoking `go run main.go` under the directory `cmd/simulator` or by installing the tool (`go install -v .`) and running the binary -(`simulator`). - -To make getting started easier, the ewoq key `0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC` -has been pre-added to the simulator key directory and can be added to genesis during local network -creation (`DEFAULT_ACCOUNT=[GENESIS_ADDRESS] ./scripts/run.sh [AVALANCHEGO VERSION]`). -If you do not add this key to genesis, you'll need to manually fund the -`master` account when prompted in the terminal. - -_The private key for the ewoq address (`0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC`) is -`0x56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027`._ - -If you followed the directions successfully, you should see the following: - -```bash -> go run main.go -go: downloading github.com/ava-labs/subnet-evm v0.1.2 -go: downloading github.com/spf13/viper v1.10.1 -2022/05/11 09:49:22 loaded config (endpoints=[http://127.0.0.1:14463/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc] concurrency=25 base fee=1 priority fee=10) -2022/05/11 09:49:22 loaded worker 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC (balance=100000000000000000000000000 nonce=0) -2022/05/11 09:49:22 0xe8859AF6c05b512dF80A66b81dE89FDAB9fE5C1c requesting funds from master -2022/05/11 09:49:22 0xa2B32bcbA31d4dC7728aD73165cdeea5eCeD5e70 requesting funds from master -2022/05/11 09:49:22 0x837438175627A7A2ABbccf1727c5cA46fA7274b5 requesting funds from master -2022/05/11 09:49:22 0x14c908A82047C6bC66cd9282b4D68f3e003659f8 requesting funds from master -2022/05/11 09:49:22 0xbeE6DF853592d3699ac3292D134F59BEF278B048 requesting funds from master -2022/05/11 09:49:22 0x028Bc164dcC1c10f1Db5a1175c58eA84a7Fd34c9 requesting funds from master -2022/05/11 09:49:22 0x664D97348Bdb73fc3bC4447B4676573dbF6eEE5A requesting funds from master -2022/05/11 09:49:22 0x455aAB371261DC41a048e42Bf147ced4FaDE5fCF requesting funds from master -2022/05/11 09:49:22 0xA9b5C64E057F50730CA4Ba6205d55fa08C03ff75 requesting funds from master -2022/05/11 09:49:22 0x57645A2bdCEb6cFbC95e6a5Cac70F0c05B8d8515 requesting funds from master -2022/05/11 09:49:24 [block created] t: 2022-05-11 09:49:22 -0600 MDT index: 1 base fee: 1 block gas cost: 0 block txs: 1 gas used: 21000 -2022/05/11 09:49:24 [block created] t: 2022-05-11 09:49:24 -0600 MDT index: 2 base fee: 1 block gas cost: 0 block txs: 1 gas used: 21000 -2022/05/11 09:49:24 [stats] historical TPS: 1.00 last 10s TPS: 0.10 total txs: 2 historical GPS: 21000.0, last 10s GPS: 2100.0 elapsed: 2s -2022/05/11 09:49:26 [block created] t: 2022-05-11 09:49:26 -0600 MDT index: 3 base fee: 1 block gas cost: 0 block txs: 1 gas used: 21000 -2022/05/11 09:49:26 [stats] historical TPS: 0.75 last 10s TPS: 0.20 total txs: 3 historical GPS: 15750.0, last 10s GPS: 4200.0 elapsed: 4s -2022/05/11 09:49:28 [block created] t: 2022-05-11 09:49:28 -0600 MDT index: 4 base fee: 1 block gas cost: 0 block txs: 2 gas used: 42000 -2022/05/11 09:49:28 [stats] historical TPS: 0.83 last 10s TPS: 0.30 total txs: 5 historical GPS: 17500.0, last 10s GPS: 6300.0 elapsed: 6s -2022/05/11 09:49:30 [block created] t: 2022-05-11 09:49:30 -0600 MDT index: 5 base fee: 1 block gas cost: 0 block txs: 4 gas used: 84000 -2022/05/11 09:49:30 [stats] historical TPS: 1.12 last 10s TPS: 0.50 total txs: 9 historical GPS: 23625.0, last 10s GPS: 10500.0 elapsed: 8s -2022/05/11 09:49:32 [block created] t: 2022-05-11 09:49:32 -0600 MDT index: 6 base fee: 1 block gas cost: 0 block txs: 5 gas used: 105000 -2022/05/11 09:49:32 [stats] historical TPS: 1.40 last 10s TPS: 0.90 total txs: 14 historical GPS: 29400.0, last 10s GPS: 18900.0 elapsed: 10s -2022/05/11 09:49:34 [block created] t: 2022-05-11 09:49:34 -0600 MDT index: 7 base fee: 1 block gas cost: 0 block txs: 6 gas used: 126000 -2022/05/11 09:49:34 [stats] historical TPS: 1.67 last 10s TPS: 1.30 total txs: 20 historical GPS: 35000.0, last 10s GPS: 27300.0 elapsed: 12s -2022/05/11 09:49:36 [block created] t: 2022-05-11 09:49:36 -0600 MDT index: 8 base fee: 1 block gas cost: 0 block txs: 7 gas used: 147000 -2022/05/11 09:49:36 [stats] historical TPS: 1.93 last 10s TPS: 1.80 total txs: 27 historical GPS: 40500.0, last 10s GPS: 37800.0 elapsed: 14s -2022/05/11 09:49:38 [block created] t: 2022-05-11 09:49:38 -0600 MDT index: 9 base fee: 1 block gas cost: 0 block txs: 8 gas used: 168000 -2022/05/11 09:49:38 [stats] historical TPS: 2.19 last 10s TPS: 2.40 total txs: 35 historical GPS: 45937.5, last 10s GPS: 50400.0 elapsed: 16s -2022/05/11 09:49:40 [block created] t: 2022-05-11 09:49:40 -0600 MDT index: 10 base fee: 1 block gas cost: 0 block txs: 9 gas used: 189000 -2022/05/11 09:49:40 [stats] historical TPS: 2.44 last 10s TPS: 3.00 total txs: 44 historical GPS: 51333.3, last 10s GPS: 63000.0 elapsed: 18s -2022/05/11 09:49:42 [block created] t: 2022-05-11 09:49:42 -0600 MDT index: 11 base fee: 1 block gas cost: 0 block txs: 9 gas used: 189000 -2022/05/11 09:49:42 [stats] historical TPS: 2.65 last 10s TPS: 3.50 total txs: 53 historical GPS: 55650.0, last 10s GPS: 73500.0 elapsed: 20s -2022/05/11 09:49:44 [block created] t: 2022-05-11 09:49:44 -0600 MDT index: 12 base fee: 1 block gas cost: 0 block txs: 10 gas used: 210000 -2022/05/11 09:49:44 [stats] historical TPS: 2.86 last 10s TPS: 3.90 total txs: 63 historical GPS: 60136.4, last 10s GPS: 81900.0 elapsed: 22s -2022/05/11 09:49:46 [block created] t: 2022-05-11 09:49:46 -0600 MDT index: 13 base fee: 1 block gas cost: 0 block txs: 10 gas used: 210000 -2022/05/11 09:49:46 [stats] historical TPS: 3.04 last 10s TPS: 4.30 total txs: 73 historical GPS: 63875.0, last 10s GPS: 90300.0 elapsed: 24s -..... - -2022/05/11 09:55:51 [stats] historical TPS: 4.89 last 10s TPS: 5.00 total txs: 1896 historical GPS: 102618.6, last 10s GPS: 105000.0 elapsed: 6m28s -2022/05/11 09:55:52 0xa2B32bcbA31d4dC7728aD73165cdeea5eCeD5e70 requesting funds from master -2022/05/11 09:55:53 [block created] t: 2022-05-11 09:55:52 -0600 MDT index: 196 base fee: 1 block gas cost: 0 block txs: 11 gas used: 231000 -2022/05/11 09:55:53 [stats] historical TPS: 4.89 last 10s TPS: 5.10 total txs: 1907 historical GPS: 102684.6, last 10s GPS: 107100.0 elapsed: 6m30s -2022/05/11 09:55:54 0x14c908A82047C6bC66cd9282b4D68f3e003659f8 requesting funds from master -2022/05/11 09:55:55 [block created] t: 2022-05-11 09:55:54 -0600 MDT index: 197 base fee: 1 block gas cost: 0 block txs: 11 gas used: 231000 -2022/05/11 09:55:55 [stats] historical TPS: 4.89 last 10s TPS: 5.20 total txs: 1918 historical GPS: 102750.0, last 10s GPS: 109200.0 elapsed: 6m32s -2022/05/11 09:55:56 0xbeE6DF853592d3699ac3292D134F59BEF278B048 requesting funds from master -2022/05/11 09:55:57 [block created] t: 2022-05-11 09:55:56 -0600 MDT index: 198 base fee: 1 block gas cost: 0 block txs: 11 gas used: 231000 -2022/05/11 09:55:57 [stats] historical TPS: 4.90 last 10s TPS: 5.30 total txs: 1929 historical GPS: 102814.7, last 10s GPS: 111300.0 elapsed: 6m34s -2022/05/11 09:55:58 0x028Bc164dcC1c10f1Db5a1175c58eA84a7Fd34c9 requesting funds from master -2022/05/11 09:55:59 [block created] t: 2022-05-11 09:55:58 -0600 MDT index: 199 base fee: 1 block gas cost: 0 block txs: 11 gas used: 231000 -2022/05/11 09:55:59 [stats] historical TPS: 4.90 last 10s TPS: 5.40 total txs: 1940 historical GPS: 102878.8, last 10s GPS: 113400.0 elapsed: 6m36s -2022/05/11 09:56:00 0x664D97348Bdb73fc3bC4447B4676573dbF6eEE5A requesting funds from master -2022/05/11 09:56:01 [block created] t: 2022-05-11 09:56:00 -0600 MDT index: 200 base fee: 1 block gas cost: 0 block txs: 11 gas used: 231000 -2022/05/11 09:56:01 [stats] historical TPS: 4.90 last 10s TPS: 5.50 total txs: 1951 historical GPS: 102942.2, last 10s GPS: 115500.0 elapsed: 6m38s -2022/05/11 09:56:02 0x455aAB371261DC41a048e42Bf147ced4FaDE5fCF requesting funds from master -2022/05/11 09:56:03 [block created] t: 2022-05-11 09:56:02 -0600 MDT index: 201 base fee: 1 block gas cost: 0 block txs: 11 gas used: 231000 -2022/05/11 09:56:03 [stats] historical TPS: 4.91 last 10s TPS: 5.50 total txs: 1962 historical GPS: 103005.0, last 10s GPS: 115500.0 elapsed: 6m40s -2022/05/11 09:56:04 0xA9b5C64E057F50730CA4Ba6205d55fa08C03ff75 requesting funds from master -2022/05/11 09:56:05 [block created] t: 2022-05-11 09:56:04 -0600 MDT index: 202 base fee: 1 block gas cost: 0 block txs: 11 gas used: 231000 -2022/05/11 09:56:05 [stats] historical TPS: 4.91 last 10s TPS: 5.50 total txs: 1973 historical GPS: 103067.2, last 10s GPS: 115500.0 elapsed: 6m42s -2022/05/11 09:56:06 0x57645A2bdCEb6cFbC95e6a5Cac70F0c05B8d8515 requesting funds from master -2022/05/11 09:56:07 [block created] t: 2022-05-11 09:56:06 -0600 MDT index: 203 base fee: 1 block gas cost: 0 block txs: 11 gas used: 231000 -2022/05/11 09:56:07 [stats] historical TPS: 4.91 last 10s TPS: 5.50 total txs: 1984 historical GPS: 103128.7, last 10s GPS: 115500.0 elapsed: 6m44s -2022/05/11 09:56:09 [block created] t: 2022-05-11 09:56:08 -0600 MDT index: 204 base fee: 1 block gas cost: 0 block txs: 11 gas used: 231000 -2022/05/11 09:56:09 [stats] historical TPS: 4.91 last 10s TPS: 5.50 total txs: 1995 historical GPS: 103189.7, last 10s GPS: 115500.0 elapsed: 6m46s -2022/05/11 09:56:11 [block created] t: 2022-05-11 09:56:10 -0600 MDT index: 205 base fee: 1 block gas cost: 0 block txs: 10 gas used: 210000 -2022/05/11 09:56:11 [stats] historical TPS: 4.91 last 10s TPS: 5.50 total txs: 2005 historical GPS: 103198.5, last 10s GPS: 115500.0 elapsed: 6m48s -2022/05/11 09:56:13 [block created] t: 2022-05-11 09:56:12 -0600 MDT index: 206 base fee: 1 block gas cost: 0 block txs: 10 gas used: 210000 -2022/05/11 09:56:13 [stats] historical TPS: 4.91 last 10s TPS: 5.40 total txs: 2015 historical GPS: 103207.3, last 10s GPS: 113400.0 elapsed: 6m50s -``` - -## Create an EVM Subnet on Fuji Testnet - -See [this tutorial](https://docs.avax.network/subnets/create-a-fuji-subnet-subnet-cli). - -## Customize a Subnet - -- [Genesis](https://docs.avax.network/subnets/customize-a-subnet#genesis) -- [Precompile](https://docs.avax.network/subnets/customize-a-subnet#precompiles) -- [Priority Regossip](https://docs.avax.network/subnets/customize-a-subnet#priority-regossip) - -## Join the WAGMI Subnet Demo - -

- WAGMI -

- -_Thanks to the @0xNeonMonsters for the logo!_ - -The WAGMI ("We're All Going to Make It") Subnet Demo is a high throughput -testbed for EVM (Ethereum Virtual Machine) optimizations. It is parameterized -to run at a factor more capacity than Fuji/Mainnet C-Chain and will be used -to experiment with release candidates before they make it into an -official [`coreth`](https://github.com/ava-labs/coreth) release. - -We created a basic [WAGMI explorer](https://trywagmi.xyz) that surfaces -aggregated usage statistics about the subnet. If you'd like to see any other -stats added to this site, please send a DM to [@\_patrickogrady on Twitter](https://twitter.com/_patrickogrady). - -Everyone that has used the C-Chain more than twice (~970k addresses) has -been airdropped 10 WGM tokens. With the current fee parameterization, this -should be enough for hundreds of txs. - -This is one of the first cases of using Avalanche Subnets as a proving ground -for changes in a production VM (coreth). Many underestimate how useful the isolation -of subnets is for performing complex VM testing on a live network (without impacting -the stability of the primary network). - -### Network Creation - -To create WAGMI, all we had to do was run the following command: - -```bash -subnet-cli wizard \ ---node-ids=NodeID-9TCq8np31pHjjhGaHtLjs6ptYYPEt3LGb,NodeID-BrYXghQSu6KKGjuzhs3nrkcB46Wc2yYHy,NodeID-89UCR1CsPzzEHuknxhJHKxuFPNCyPz7Bu,NodeID-Hfm8gpD4DpCz4KTzt2osJPfFvu7az3qiD,NodeID-LkdxkfYhg6nSw1EEUxDUSYPXPwmr2cUet \ ---vm-genesis-path=networks/11111/genesis.json \ ---vm-id=srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy \ ---chain-name=wagmi -``` - -This added these NodeIDs as validators on Fuji, created the WAGMI Subnet, added -all validators to the WAGMI subnet, and created the WAGMI chain. - -- SubnetID: [28nrH5T2BMvNrWecFcV3mfccjs6axM1TVyqe79MCv2Mhs8kxiY](https://testnet.avascan.info/blockchains?subnet=28nrH5T2BMvNrWecFcV3mfccjs6axM1TVyqe79MCv2Mhs8kxiY) -- ChainID: [2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt](https://testnet.avascan.info/blockchain/2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt) - -### Network Parameters - -```text -Network ID: 11111 -Chain ID: 11111 -Block Gas Limit: 20,000,000 (2.5x C-Chain) -10s Gas Target: 100,000,000 (~6.67x C-Chain) -Min Fee: 1 GWei (4% of C-Chain) -Target Block Rate: 2s (Same as C-Chain) -``` - -### Adding to MetaMask - -```text -Network Name: WAGMI -RPC URL: https://subnets.avax.network/wagmi/wagmi-chain-testnet/rpc -Chain ID: 11111 -Symbol: WGM -Explorer: https://subnets.avax.network/wagmi/wagmi-chain-testnet/explorer -``` - -![metamask_WAGMI](./imgs/metamask_WAGMI.png) - -### Wrapped WAGMI - -#### Info - -```text -Address: 0x3Ee7094DADda15810F191DD6AcF7E4FFa37571e4 -IPFS: /ipfs/QmVAuheeidjD2ktdX3sSHMQqSfcjtmca1g9jr7w9GQf7pU -``` - -#### Metadata - -```json -{ - "compiler": { "version": "0.5.17+commit.d19bba13" }, - "language": "Solidity", - "output": { - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "src", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "guy", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dst", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "src", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "dst", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "src", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "Withdrawal", - "type": "event" - }, - { "payable": true, "stateMutability": "payable", "type": "fallback" }, - { - "constant": true, - "inputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" } - ], - "name": "allowance", - "outputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { "internalType": "address", "name": "guy", "type": "address" }, - { "internalType": "uint256", "name": "wad", "type": "uint256" } - ], - "name": "approve", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { "internalType": "address", "name": "", "type": "address" } - ], - "name": "balanceOf", - "outputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "decimals", - "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "deposit", - "outputs": [], - "payable": true, - "stateMutability": "payable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { "internalType": "address", "name": "dst", "type": "address" }, - { "internalType": "uint256", "name": "wad", "type": "uint256" } - ], - "name": "transfer", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { "internalType": "address", "name": "src", "type": "address" }, - { "internalType": "address", "name": "dst", "type": "address" }, - { "internalType": "uint256", "name": "wad", "type": "uint256" } - ], - "name": "transferFrom", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { "internalType": "uint256", "name": "wad", "type": "uint256" } - ], - "name": "withdraw", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "devdoc": { "methods": {} }, - "userdoc": { "methods": {} } - }, - "settings": { - "compilationTarget": { "contracts/wwagmi.sol": "WWAGMI" }, - "evmVersion": "istanbul", - "libraries": {}, - "optimizer": { "enabled": false, "runs": 200 }, - "remappings": [] - }, - "sources": { - "contracts/wwagmi.sol": { - "keccak256": "0x0a6ce5559225d3c99db4a5e24777049df3c84886ba9a08147f23afae4261b509", - "urls": [ - "bzz-raw://0aef254c65ae30b578256a7e2496ed18bf0cb68e97f5831050e17a2cf0192a7e", - "dweb:/ipfs/QmSwAbdnaYvrjDHTKnE3qBZ3smT7uipSSfSGBUiKWmNWEY" - ] - } - }, - "version": 1 -} -``` - -#### Code - -```solidity -// Copyright (C) 2015, 2016, 2017 Dapphub - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// Contract name, token name, and token symbol modified by Ava Labs 2020 - -pragma solidity >=0.4.22 <0.6; - -contract WWAGMI{ - string public name = "Wrapped WAGMI"; - string public symbol = "WWAGMI"; - uint8 public decimals = 18; - - event Approval(address indexed src, address indexed guy, uint wad); - event Transfer(address indexed src, address indexed dst, uint wad); - event Deposit(address indexed dst, uint wad); - event Withdrawal(address indexed src, uint wad); - - mapping (address => uint) public balanceOf; - mapping (address => mapping (address => uint)) public allowance; - - function() external payable { - deposit(); - } - function deposit() public payable { - balanceOf[msg.sender] += msg.value; - emit Deposit(msg.sender, msg.value); - } - function withdraw(uint wad) public { - require(balanceOf[msg.sender] >= wad); - balanceOf[msg.sender] -= wad; - msg.sender.transfer(wad); - emit Withdrawal(msg.sender, wad); - } - - function totalSupply() public view returns (uint) { - return address(this).balance; - } - - function approve(address guy, uint wad) public returns (bool) { - allowance[msg.sender][guy] = wad; - emit Approval(msg.sender, guy, wad); - return true; - } - - function transfer(address dst, uint wad) public returns (bool) { - return transferFrom(msg.sender, dst, wad); - } - - function transferFrom(address src, address dst, uint wad) - public - returns (bool) - { - require(balanceOf[src] >= wad); - - if (src != msg.sender && allowance[src][msg.sender] != uint(-1)) { - require(allowance[src][msg.sender] >= wad); - allowance[src][msg.sender] -= wad; - } - - balanceOf[src] -= wad; - balanceOf[dst] += wad; - - emit Transfer(src, dst, wad); - - return true; - } -} -``` +1. Use an official Subnet-EVM release: https://docs.avax.network/subnets/build-first-subnet +2. Build and deploy a locally built (and optionally modified) version of Subnet-EVM: https://docs.avax.network/subnets/create-custom-subnet diff --git a/contract-examples/README.md b/contract-examples/README.md index 04b6f22c40..8e761d7dc6 100644 --- a/contract-examples/README.md +++ b/contract-examples/README.md @@ -54,13 +54,52 @@ For more information about precompiles see [subnet-evm precompiles](https://gith Hardhat uses `hardhat.config.js` as the configuration file. You can define tasks, networks, compilers and more in that file. For more information see [here](https://hardhat.org/config/). -In our repository we use a pre-configured file [hardhat.config.ts](https://github.com/ava-labs/avalanche-smart-contract-quickstart/blob/main/hardhat.config.ts). This file configures necessary network information to provide smooth interaction with Avalanche. There are two networks in the hardhat config: `e2e` and `local`. `e2e` network is used for e2e tests and should not be changed. `local` network is used by tasks and for local deployments. There are also some pre-defined private keys for these networks. Each chain in subnets has their own RPC URL. Subnet EVM's RPC URL is in form of: `"http://{ip}:{port}/ext/bc/{chainID}/rpc`. When you create your own subnet and Subnet EVM chain `{chainID}` will be different. You can change `local` network RPC url with the `local_rpc.json`. There is an example file named with `local_rpc_example.json`. You can copy & rename this file to customize the url: +In Subnet-EVM, we provide a pre-configured file [hardhat.config.ts](https://github.com/ava-labs/avalanche-smart-contract-quickstart/blob/main/hardhat.config.ts). This file creates an optional network to provide smooth interaction with Subnet-EVM running on an Avalanche Subnet. +The HardHat config file includes a single network configuration: `local`. `local` defaults to using the following values for the RPC URL and the Chain ID: + +``` +var local_rpc_uri = process.env.RPC_URI || "http://127.0.0.1:9650/ext/bc/C/rpc" +var local_chain_id = process.env.CHAIN_ID || 99999 ``` -cp local_rpc.example.json local_rpc.json + +You can use this network configuration by providing the environment variables and specifying the `--network` flag, as Subnet-EVM does in its testing suite: + +```bash +RPC_URI=http://127.0.0.1:9650/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc CHAIN_ID=77777 npx hardhat test --network local ``` -Do not forget to set correct URL in the `local_rpc.json` file. +Alternatively, you can also copy and paste the `local` network configuration to create a new network configuration for your own local testing. For example, you can copy and paste the `local` network configuration to create your own network and fill in the required details: + +```json +{ + networks: { + mynetwork: { + url: "http://127.0.0.1:9650/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc", + chainId: 33333, + accounts: [ + "0x56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027", + "0x7b4198529994b0dc604278c99d153cfd069d594753d471171a1d102a10438e07", + "0x15614556be13730e9e8d6eacc1603143e7b96987429df8726384c2ec4502ef6e", + "0x31b571bf6894a248831ff937bb49f7754509fe93bbd2517c9c73c4144c0e97dc", + "0x6934bef917e01692b789da754a0eae31a8536eb465e7bff752ea291dad88c675", + "0xe700bdbdbc279b808b1ec45f8c2370e4616d3a02c336e68d85d4668e08f53cff", + "0xbbc2865b76ba28016bc2255c7504d000e046ae01934b04c694592a6276988630", + "0xcdbfd34f687ced8c6968854f8a99ae47712c4f4183b78dcc4a903d1bfe8cbf60", + "0x86f78c5416151fe3546dece84fda4b4b1e36089f2dbc48496faf3a950f16157c", + "0x750839e9dbbd2a0910efe40f50b2f3b2f2f59f5580bb4b83bd8c1201cf9a010a" + ], + pollingInterval: "1s" + }, + } +} +``` + +By creating your own network configuration in the HardHat config, you can run HardHat commands directly on your subnet: + +```bash +npx hardhat accounts --network mynetwork +``` ## Hardhat Tasks @@ -68,7 +107,11 @@ You can define custom hardhat tasks in [tasks.ts](https://github.com/ava-labs/av ## Tests -Tests are written for a local network which runs a Subnet-EVM chain. E.g `npx hardhat test --network local`. Subnet-EVM must activate required precompiles with following genesis: +Tests are written for a local network which runs a Subnet-EVM Blockchain. + +E.g `RPC_URI=http://127.0.0.1:9650/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc CHAIN_ID=77777 npx hardhat test --network local`. + +Subnet-EVM must activate any precompiles used in the test in the genesis: ```json { From d04dcc2b1a622c7c6442ccf90b0d872027176d9e Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 26 Jan 2023 11:01:39 -0500 Subject: [PATCH 48/55] Break down simulator --- cmd/simulator/.gitignore | 34 ++++++++++++++++ cmd/simulator/README.md | 87 ++++++++++++++++++++++++++++++++++++++++ cmd/simulator/main.go | 11 ++++- 3 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 cmd/simulator/.gitignore create mode 100644 cmd/simulator/README.md diff --git a/cmd/simulator/.gitignore b/cmd/simulator/.gitignore new file mode 100644 index 0000000000..c4408cd691 --- /dev/null +++ b/cmd/simulator/.gitignore @@ -0,0 +1,34 @@ +simulator + +*.log +*~ +.DS_Store + +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib +*.profile + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# ignore GoLand metafiles directory +.idea/ + +*logs/ + +.vscode* + +.coverage + +bin/ +build/ + +# goreleaser +dist/ diff --git a/cmd/simulator/README.md b/cmd/simulator/README.md new file mode 100644 index 0000000000..eb2100619e --- /dev/null +++ b/cmd/simulator/README.md @@ -0,0 +1,87 @@ +# Load Simulator + +When building developing your own blockchain using `subnet-evm`, you may want to analyze how your fee parameterization behaves and/or how many resources your VM uses under different load patterns. For this reason, we developed `cmd/simulator`. `cmd/simulator` lets your drive arbitrary load across any number of [endpoints] with a user-specified `keys` directory (insecure) `timeout`, `concurrency`, `base-fee`, and `priority-fee`. + +## Building the Load Simulator + +To build the load simulator, navigate to the base of the simulator directory: + +```bash +cd $GOPATH/src/github.com/ava-labs/subnet-evm/cmd/simulator +``` + +Build the simulator: + +```bash +go build -o ./simulator *.go +``` + +To confirm that you built successfully, run the simulator and print the version: + +```bash +./simulator -v +``` + +This should give the following output: + +``` +v0.0.1 +``` + +To run the load simulator, you must first start an EVM based network. The load simulator works on both the C-Chain and Subnet-EVM, so we will start a single node network and run the load simulator on the C-Chain. + +To start a single node network, follow the instructions from the AvalancheGo [README](https://github.com/ava-labs/avalanchego#building-avalanchego) to build from source. + +Once you've built AvalancheGo, open the AvalancheGo directory in a separate terminal window and run a single node non-staking network with the following command: + +```bash +./build/avalanchego --staking-enabled=false --network-id=local +``` + +:::warning +The staking-enabled flag is only for local testing. Disabling staking serves two functions explicitly for testing purposes: + +1. Ignore stake weight on the P-Chain and count each connected peer as having a stake weight of 1 +2. Automagically opts in to validate every Subnet +::: + +Once you have AvalancheGo running locally, it will be running an HTTP Server on the default port `9650`. This means that the RPC Endpoint for the C-Chain will be http://127.0.0.1:9650/ext/bc/C/rpc. + +Now, we can run the simulator command to simulate some load on the local C-Chain for 30s: + +```bash +RPC_ENDPOINTS=http://127.0.0.1:9650/ext/bc/C/rpc +./simulator --rpc-endpoints=$RPC_ENDPOINTS --keys=./.simulator/keys --timeout=30s --concurrency=10 --base-fee=300 --priority-fee=100 +``` + +## Command Line Flags + +### `rpc-endpoints` (string) + +`rpc-endpoints` is a comma separated list of RPC endpoints to hit during the load test. + +### `keys` (string) + +`keys` specifies the directory to find the private keys to use throughout the test. The directory should contain files with the hex address as the name and the corresponding private key as the only content. + +If the test needs to generate more keys, it will save them in this directory to ensure that the private keys holding funds at the end of the test are preserved. + +:::warning +The `keys` directory is not a secure form of storage for private keys. This should only be used in local network and short lived network testing where losing or compromising the keys is not an issue +::: + +### `timeout` (duration) + +`timeout` specifies the duration to simulate load on the network for this test. + +### `concurrency` (int) + +`concurrency` specifies the number of concurrent workers that should send transactions to the network throughout the test. Each worker in the load test is a pair of a private key sending transactions to one of the specified RPC Endpoints. + +### `base-fee` (int) + +`base-fee` specifies the base fee (denominated in GWei) to use for every transaction generated during the load test (generates Dynamic Fee Transactions). + +### `priority-fee` (int) + +`priority-fee` specifies the priority fee (denominated in GWei) to use for every transaction generated during the load test (generates Dynamic Fee Transactions). diff --git a/cmd/simulator/main.go b/cmd/simulator/main.go index aac6310c43..2063cf471c 100644 --- a/cmd/simulator/main.go +++ b/cmd/simulator/main.go @@ -30,8 +30,10 @@ func main() { } var ( - timeout time.Duration - keysDir string + version = "v0.0.1" + versionFlag bool + timeout time.Duration + keysDir string rpcEndpoints []string @@ -56,6 +58,7 @@ func newCommand() *cobra.Command { Run: runFunc, } + cmd.PersistentFlags().BoolVarP(&versionFlag, "version", "v", false, "Print the version of the simulator and exit.") cmd.PersistentFlags().DurationVarP(&timeout, "timeout", "t", time.Minute, "Duration to run simulator") cmd.PersistentFlags().StringVarP(&keysDir, "keys", "k", ".simulator/keys", "Directory to find key files") cmd.PersistentFlags().StringSliceVarP(&rpcEndpoints, "rpc-endpoints", "e", defaultLocalNetworkCChainEndpoints, `Specifies a comma separated list of RPC Endpoints to use for the load test. Ex. "http://127.0.0.1:9650/ext/bc/C/rpc,http://127.0.0.1:9652/ext/bc/C/rpc". Defaults to the default RPC Endpoints for the C-Chain on a 5 Node local network.`) @@ -67,6 +70,10 @@ func newCommand() *cobra.Command { } func runFunc(cmd *cobra.Command, args []string) { + if versionFlag { + fmt.Printf("%s\n", version) + return + } // TODO: use geth logger log.Printf("launching simulator with rpc endpoints %q timeout %v, concurrency %d, base fee %d, priority fee %d", rpcEndpoints, timeout, concurrency, baseFee, priorityFee) From 1ee644dd8579ec63a4a9b3a37a4ab6d59a87feaa Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 26 Jan 2023 12:22:19 -0500 Subject: [PATCH 49/55] Cleanup --- scripts/run.sh | 60 +++++++----------------------------------- tests/utils/command.go | 2 ++ 2 files changed, 11 insertions(+), 51 deletions(-) diff --git a/scripts/run.sh b/scripts/run.sh index 7e8a716db7..2661b00159 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -24,10 +24,6 @@ AVALANCHEGO_PATH=${AVALANCHEGO_PATH:-"$AVALANCHEGO_BUILD_PATH/avalanchego"} AVALANCHEGO_PLUGIN_DIR=${AVALANCHEGO_PLUGIN_DIR:-"$AVALANCHEGO_BUILD_PATH/plugins"} DATA_DIR=${DATA_DIR:-/tmp/subnet-evm-start-node/$(date "+%Y-%m-%d%:%H:%M:%S")} -# Base64 encoded Staking TLS Cert and Key File Contents for AvalancheGo local staking node 1 (published key content used for testing) -STAKING_TLS_KEY_FILE_CONTENT="LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlKS0FJQkFBS0NBZ0VBeW1Fa2NQMXRHS1dCL3pFMElZaGEwZEp2UFplc2s3c3k2UTdZN25hLytVWjRTRDc3CmFwTzJDQnB2NXZaZHZjY0VlQ2VhKzBtUnJQdTlNZ1hyWkcwdm9lejhDZHE1bGc4RzYzY2lTcjFRWWFuL0pFcC8KbFZOaTNqMGlIQ1k5ZmR5dzhsb1ZkUitKYWpaRkpIQUVlK2hZZmFvekx3TnFkTHlldXZuZ3kxNWFZZjBXR3FVTQpmUjREby85QVpnQ2pLMkFzcU9RWVVZb2Zqcm9JUEdpdUJ2VDBFeUFPUnRzRTFsdGtKQjhUUDBLYVJZMlhmMThFCkhpZGgrcm0xakJYT1g3YlgrZ002U2J4U0F3YnZ5UXdpbG9ncnVadkxlQmkvTU5qcXlNZkNiTmZaUmVHR0JObnEKSXdxM3FvRDR1dUV0NkhLc0NyQTZNa2s4T3YrWWlrT1FWR01GRjE5OCt4RnpxZy9FakIzbjFDbm5NNCtGcndHbQpTODBkdTZsNXVlUklFV0VBQ0YrSDRabU96WDBxS2Qxb2RCS090dmlSNkRQOVlQbElEbDVXNTFxV1BlVElIZS8zCjhBMGxpN3VDTVJOUDdxdkZibnlHM3d1TXEyUEtwVTFYd0gzeU5aWFVYYnlZenlRVDRrTkFqYXpwZXRDMWFiYVoKQm5QYklSKzhHZG16OUd4SjJDazRDd0h6c3cvRkxlOVR0Z0RpR3ZOQU5SalJaZUdKWHZ6RWpTVG5FRGtxWUxWbgpVUk15RktIcHdJMzdzek9Ebms2K0hFWU9QbFdFd0tQU2h5cTRqZFE3bnNEY3huZkZveWdGUjVuQ0RJNmlFaTA1CmN6SVhiSFp2anBuME9qcjhsKzc5Qmt6Z1c0VDlQVFJuTU1PUU5JQXMxemRmQlV1YU1aOFh1amh2UTlNQ0F3RUEKQVFLQ0FnRUF1VU00TXQ4cjhiWUJUUFZqL1padlhVakFZS2ZxYWNxaWprcnpOMGtwOEM0Y2lqWnR2V0MrOEtnUwo3R0YzNnZTM0dLOVk1dFN3TUtTNnk0SXp2RmxmazJINFQ2VVU0MU9hU0E5bEt2b25EV0NybWpOQW5CZ2JsOHBxCjRVMzRXTEdnb2hycExiRFRBSkh4dGF0OXoxZ2hPZGlHeG5EZ0VVRmlKVlA5L3UyKzI1anRsVEttUGhzdHhnRXkKbUszWXNTcDNkNXhtenE0Y3VYRi9mSjF2UWhzWEhETHFIdDc4aktaWkErQVdwSUI1N1ZYeTY3eTFiazByR25USwp4eFJuT2FPT0R1YkpneHFNRVExV2tMczFKb3c5U3NwZDl2RGdoUHp0NFNOTXpvckI4WURFU01pYjE3eEY2aVhxCmpGajZ4NkhCOEg3bXA0WDNSeU1ZSnVvMnc2bHB6QnNFbmNVWXBLaHFNYWJGMEkvZ2lJNVZkcFNEdmtDQ09GZW4KbldaTFY5QWkveDd0VHEvMEYrY1ZNNjlNZ2ZlOGlZeW1xbGZkNldSWklUS2ZWaU5IQUxsRy9QcTl5SEpzejdOZwpTOEJLT0R0L3NqNFEweEx0RkRUL0RtcFA1MGlxN1NpUzE0b2JjS2NRcjhGQWpNL3NPWS9VbGc0TThNQTdFdWdTCnBESndMbDZYRG9JTU1DTndaMUhHc0RzdHpteDVNZjUwYlM0dGJLNGlaemNwUFg1UkJUbFZkbzlNVFNnbkZpenAKSWkxTmpITHVWVkNTTGIxT2pvVGd1MGNRRmlXRUJDa0MxWHVvUjhSQ1k2aVdWclVINEdlem5pN2NrdDJtSmFOQQpwZDYvODdkRktFM2poNVQ2alplSk1KZzVza1RaSFNvekpEdWFqOXBNSy9KT05TRDA2c0VDZ2dFQkFQcTJsRW1kCmcxaHBNSXFhN2V5MXVvTGQxekZGemxXcnhUSkxsdTM4TjY5bVlET0hyVi96cVJHT3BaQisxbkg3dFFKSVQvTDEKeExOMzNtRlZxQ3JOOHlVbVoraVVXaW9hSTVKWjFqekNnZW1WR2VCZ29kd1A5TU9aZnh4ckRwMTdvVGRhYmFFcQo3WmFCWW5ZOHhLLzRiQ3h1L0I0bUZpRjNaYThaVGQvKzJ5ZXY3Sk0rRTNNb3JXYzdyckttMUFwZmxmeHl0ZGhPCkpMQmlxT2Nxb2JJM2RnSHl6ZXNWYjhjVDRYQ3BvUmhkckZ3b3J0MEpJN3J5ZmRkZDQ5dk1KM0VsUmJuTi9oNEYKZjI0Y1dZL3NRUHEvbmZEbWVjMjhaN25WemExRDRyc3pOeWxZRHZ6ZGpGMFExbUw1ZEZWbnRXYlpBMUNOdXJWdwpuVGZ3dXlROFJGOVluWU1DZ2dFQkFNNmxwTmVxYWlHOWl4S1NyNjVwWU9LdEJ5VUkzL2VUVDR2Qm5yRHRZRis4Cm9oaUtnSXltRy92SnNTZHJ5bktmd0pPYkV5MmRCWWhDR0YzaDl6Mm5jOUtKUUQvc3U3d3hDc2RtQnM3WW9EaU0KdXpOUGxSQW1JMFFBRklMUENrNDh6L2xVUWszci9NenUwWXpSdjdmSTRXU3BJR0FlZlZQRHF5MXVYc0FURG9ESgphcmNFa05ENUxpYjg5THg3cjAyRWV2SkpUZGhUSk04bUJkUmw2d3BOVjN4QmR3aXM2N3VTeXVuRlpZcFNpTXc3CldXaklSaHpoTEl2cGdENzhVdk52dUppMFVHVkVqVHFueHZ1VzNZNnNMZklrODBLU1IyNFVTaW5UMjd0Ly94N3oKeXpOa283NWF2RjJobTFmOFkvRXBjSEhBYXg4TkFRRjV1dVY5eEJOdnYzRUNnZ0VBZFMvc1JqQ0syVU5wdmcvRwowRkx0V0FncmNzdUhNNEl6alZ2SnMzbWw2YVYzcC81dUtxQncwVlVVekdLTkNBQTRUbFhRa09jUnh6VnJTNkhICkZpTG4yT0NIeHkyNHExOUdhenowcDdmZkUzaHUvUE1PRlJlY04rVkNoZDBBbXRuVHRGVGZVMnNHWE1nalp0TG0KdUwzc2lpUmlVaEZKWE9FN05Vb2xuV0s1dTJZK3RXQlpwUVZKY0N4MGJ1c054NytBRXR6blpMQzU4M3hhS0p0RApzMUs3SlJRQjdqVTU1eHJDMEc5cGJrTXlzbTBOdHlGemd3bWZpcEJIVmxDcHl2ZzZEQ3hkOEZodmhOOVplYTFiCmZoa2MwU0pab3JIQzVoa3FweWRKRG1sVkNrMHZ6RUFlUU00Qzk0WlVPeXRibmpRbm1YcDE0Q05BU1lxTFh0ZVEKdWVSbzB3S0NBUUFHMEYxMEl4Rm0xV290alpxdlpKZ21RVkJYLzBmclVQY3hnNHZwQjVyQzdXUm03TUk2WVF2UgpMS0JqeldFYWtIdjRJZ2ZxM0IrZms1WmNHaVJkNnhTZG41cjN3S1djR2YzaC8xSkFKZEo2cXVGTld0VnVkK04zCnpZemZsMVllcUZDdlJ3RDhzc2hlTlkzQlYvVTdhU3ROZDJveTRTNSt3WmYyWW9wTFNSV1VWNC9tUXdkSGJNQUIKMXh0Mno1bEROQmdkdng4TEFBclpyY1pKYjZibGF4RjBibkF2WUF4UjNoQkV6eFovRGlPbW9GcGRZeVUwdEpRVQpkUG1lbWhGZUo1UHRyUnh0aW1vaHdnQ0VzVC9UQVlodVVKdVkyVnZ6bkVXcHhXdWNiaWNLYlQySkQwdDY3bUVCCnNWOSs4anFWYkNsaUJ0ZEJhZHRib2hqd2trb1IzZ0J4QW9JQkFHM2NadU5rSVdwRUxFYmVJQ0tvdVNPS04wNnIKRnMvVVhVOHJvTlRoUFI3dlB0amVEMU5ETW1VSEpyMUZHNFNKclNpZ2REOHFOQmc4dy9HM25JMEl3N2VGc2trNQo4bU5tMjFDcER6T04zNlpPN0lETWo1dXlCbGoydCtJeGwvdUpZaFlTcHVOWHlVVE1tK3JrRkowdmRTVjRmakxkCkoybTMwanVZbk1pQkJKZjdkejVNOTUrVDB4aWNHV3lWMjR6VllZQmJTbzBOSEVHeHFlUmhpa05xWk5Qa29kNmYKa2ZPSlpHYWxoMkthSzVSTXBacEZGaFova1c5eFJXTkpaeUNXZ2tJb1lrZGlsTXVJU0J1M2xDcms4cmRNcEFMMAp3SEVjcTh4d2NnWUNTMnFrOEh3anRtVmQzZ3BCMXk5VXNoTXIzcW51SDF3TXBVNUMrbk0yb3kzdlNrbz0KLS0tLS1FTkQgUlNBIFBSSVZBVEUgS0VZLS0tLS0K" -STAKING_TLS_CRT_FILE_CONTENT="LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZOekNDQXg4Q0NRQzY4N1hGeHREUlNqQU5CZ2txaGtpRzl3MEJBUXNGQURCL01Rc3dDUVlEVlFRR0V3SlYKVXpFTE1Ba0dBMVVFQ0F3Q1Rsa3hEekFOQmdOVkJBY01Ca2wwYUdGallURVFNQTRHQTFVRUNnd0hRWFpoYkdGaQpjekVPTUF3R0ExVUVDd3dGUjJWamEyOHhEREFLQmdOVkJBTU1BMkYyWVRFaU1DQUdDU3FHU0liM0RRRUpBUllUCmMzUmxjR2hsYmtCaGRtRnNZV0p6TG05eVp6QWdGdzB4T1RBM01ESXhOakV5TVRWYUdBOHpNREU1TURjeE1ERTIKTVRJeE5Wb3dPakVMTUFrR0ExVUVCaE1DVlZNeEN6QUpCZ05WQkFnTUFrNVpNUkF3RGdZRFZRUUtEQWRCZG1GcwpZV0p6TVF3d0NnWURWUVFEREFOaGRtRXdnZ0lpTUEwR0NTcUdTSWIzRFFFQkFRVUFBNElDRHdBd2dnSUtBb0lDCkFRREtZU1J3L1cwWXBZSC9NVFFoaUZyUjBtODlsNnlUdXpMcER0anVkci81Um5oSVB2dHFrN1lJR20vbTlsMjkKeHdSNEo1cjdTWkdzKzcweUJldGtiUytoN1B3SjJybVdEd2JyZHlKS3ZWQmhxZjhrU24rVlUyTGVQU0ljSmoxOQozTER5V2hWMUg0bHFOa1VrY0FSNzZGaDlxak12QTJwMHZKNjYrZURMWGxwaC9SWWFwUXg5SGdPai8wQm1BS01yCllDeW81QmhSaWgrT3VnZzhhSzRHOVBRVElBNUcyd1RXVzJRa0h4TS9RcHBGalpkL1h3UWVKMkg2dWJXTUZjNWYKdHRmNkF6cEp2RklEQnUvSkRDS1dpQ3U1bTh0NEdMOHcyT3JJeDhKczE5bEY0WVlFMmVvakNyZXFnUGk2NFMzbwpjcXdLc0RveVNUdzYvNWlLUTVCVVl3VVhYM3o3RVhPcUQ4U01IZWZVS2Vjemo0V3ZBYVpMelIyN3FYbTU1RWdSCllRQUlYNGZobVk3TmZTb3AzV2gwRW82MitKSG9NLzFnK1VnT1hsYm5XcFk5NU1nZDcvZndEU1dMdTRJeEUwL3UKcThWdWZJYmZDNHlyWThxbFRWZkFmZkkxbGRSZHZKalBKQlBpUTBDTnJPbDYwTFZwdHBrR2M5c2hIN3daMmJQMApiRW5ZS1RnTEFmT3pEOFV0NzFPMkFPSWE4MEExR05GbDRZbGUvTVNOSk9jUU9TcGd0V2RSRXpJVW9lbkFqZnV6Ck00T2VUcjRjUmc0K1ZZVEFvOUtIS3JpTjFEdWV3TnpHZDhXaktBVkhtY0lNanFJU0xUbHpNaGRzZG0rT21mUTYKT3Z5WDd2MEdUT0JiaFAwOU5HY3d3NUEwZ0N6WE4xOEZTNW94bnhlNk9HOUQwd0lEQVFBQk1BMEdDU3FHU0liMwpEUUVCQ3dVQUE0SUNBUUFxTDFUV0kxUFRNbTNKYVhraGRUQmU4dHNrNytGc0hBRnpUY0JWQnNCOGRrSk5HaHhiCmRsdTdYSW0rQXlHVW4wajhzaXo4cW9qS2JPK3JFUFYvSW1USDVXN1EzNnJYU2Rndk5VV3BLcktJQzVTOFBVRjUKVDRwSCtscFlJbFFIblRhS011cUgzbk8zSTQwSWhFaFBhYTJ3QXd5MmtEbHo0NmZKY3I2YU16ajZaZzQzSjVVSwpaaWQrQlFzaVdBVWF1NVY3Q3BDN0dNQ3g0WWRPWldXc1QzZEFzdWc5aHZ3VGU4MWtLMUpvVEgwanV3UFRCSDB0CnhVZ1VWSVd5dXdlTTFVd1lGM244SG13cTZCNDZZbXVqaE1ES1QrM2xncVp0N2VaMVh2aWVMZEJSbFZRV3pPYS8KNlFZVGtycXdQWmlvS0lTdHJ4VkdZams0MHFFQ05vZENTQ0l3UkRnYm5RdWJSV3Jkc2x4aUl5YzVibEpOdU9WKwpqZ3Y1ZDJFZVVwd1VqdnBadUVWN0ZxUEtHUmdpRzBqZmw2UHNtczlnWVVYZCt5M3l0RzlIZW9ETm1MVFNUQkU0Cm5DUVhYOTM1UDIveE91b2s2Q3BpR3BQODlEWDd0OHlpd2s4TEZOblkzcnZ2NTBuVnk4a2VyVmRuZkhUbW9NWjkKL0lCZ29qU0lLb3Y0bG1QS2RnekZmaW16aGJzc1ZDYTRETy9MSWhURjdiUWJIMXV0L09xN25wZE9wTWpMWUlCRQo5bGFndlJWVFZGd1QvdXdyQ2NYSENiMjFiL3B1d1Y5NFNOWFZ3dDdCaGVGVEZCZHR4SnJSNGpqcjJUNW9kTGtYCjZuUWNZOFYyT1Q3S094bjBLVmM2cGwzc2FKVExtTCtILzNDdEFhbzlOdG11VURhcEtJTlJTVk55dmc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==" - mkdir -p $DATA_DIR # Set the config file contents for the path passed in as the first argument @@ -42,56 +38,18 @@ function _set_config(){ EOF } -CMDS=() -for (( i=0; i <5; i++ )) -do - NODE_NAME=node$(($i+1)) - NODE_DATA_DIR="$DATA_DIR/$NODE_NAME" - echo "Creating data directory: $NODE_DATA_DIR" - mkdir -p $NODE_DATA_DIR - NODE_CONFIG_FILE_PATH="$NODE_DATA_DIR/config.json" - _set_config $NODE_CONFIG_FILE_PATH - - CMD="$AVALANCHEGO_PATH --data-dir=$NODE_DATA_DIR --config-file=$NODE_CONFIG_FILE_PATH" - if [ $i -gt 0 ]; then - echo "Adding CLI options for node$(($i+1))" - CMD="$CMD --staking-port=$((9651+2*$i)) --http-port=$((9650+2*$i)) --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg" - else - CMD="$CMD --staking-tls-key-file-content=$STAKING_TLS_KEY_FILE_CONTENT --staking-tls-cert-file-content=$STAKING_TLS_CRT_FILE_CONTENT" - fi - - echo "Created command $CMD" - CMDS+=("$CMD") -done - - -echo "Starting AvalancheGo network with the commands:" -echo "" -for (( i=0; i<5; i++ )) -do - echo "CMD $i: ${CMDS[i]}" - echo "" -done - -# cleanup sends SIGINT to each tracked process -function cleanup_process_group(){ - echo "Terminating AvalancheGo network process group" - kill 0 # This kills a process group rather than a process with the ID 0, used to kill subshell to cleanup below -} - function execute_cmd() { echo "Executing command: $@" $@ } -execute_cmd ${CMDS[0]} +NODE_NAME=node"node1" +NODE_DATA_DIR="$DATA_DIR/$NODE_NAME" +echo "Creating data directory: $NODE_DATA_DIR" +mkdir -p $NODE_DATA_DIR +NODE_CONFIG_FILE_PATH="$NODE_DATA_DIR/config.json" +_set_config $NODE_CONFIG_FILE_PATH + +CMD="$AVALANCHEGO_PATH --data-dir=$NODE_DATA_DIR --config-file=$NODE_CONFIG_FILE_PATH" -# TODO fix staking disabled bug (subnet does not start consensus with staking disabled when connected to other nodes) -# and add option to run either 1 node, 5 nodes, or N node network within a process group. -# if [ $SINLGE_NODE != "true" ]; then -# execute_cmd ${CMDS[0]} -# else -# # TODO change from executing each CMD by index to iterate and execute each command within the subshell -# # Trap SIGINT and cleanup the processes within this subshell after receiving SIGINT (ctrl-c) -# (trap 'cleanup_process_group' SIGINT; execute_cmd ${CMDS[0]} & execute_cmd ${CMDS[1]} & execute_cmd ${CMDS[2]} & execute_cmd ${CMDS[3]} & execute_cmd ${CMDS[4]} & wait) -# fi +execute_cmd $CMD diff --git a/tests/utils/command.go b/tests/utils/command.go index 747fe69655..367547be0b 100644 --- a/tests/utils/command.go +++ b/tests/utils/command.go @@ -13,6 +13,8 @@ import ( ) // RunCommand starts the command [bin] with the given [args] and returns the command to the caller +// TODO cmd package mentions we can do this more efficiently with cmd.NewCmdOptions rather than looping +// and calling Status(). func RunCommand(bin string, args ...string) (*cmd.Cmd, error) { log.Info("Executing", "cmd", fmt.Sprintf("%s %s", bin, strings.Join(args, " "))) From 0a1a0a99b0306bf0726b9f3fd1f40e150d681800 Mon Sep 17 00:00:00 2001 From: aaronbuchwald Date: Thu, 26 Jan 2023 13:31:29 -0500 Subject: [PATCH 50/55] Update cmd/simulator/README.md Co-authored-by: Darioush Jalali --- cmd/simulator/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/simulator/README.md b/cmd/simulator/README.md index eb2100619e..3738d95d87 100644 --- a/cmd/simulator/README.md +++ b/cmd/simulator/README.md @@ -1,6 +1,6 @@ # Load Simulator -When building developing your own blockchain using `subnet-evm`, you may want to analyze how your fee parameterization behaves and/or how many resources your VM uses under different load patterns. For this reason, we developed `cmd/simulator`. `cmd/simulator` lets your drive arbitrary load across any number of [endpoints] with a user-specified `keys` directory (insecure) `timeout`, `concurrency`, `base-fee`, and `priority-fee`. +When building developing your own blockchain using `subnet-evm`, you may want to analyze how your fee parameterization behaves and/or how many resources your VM uses under different load patterns. For this reason, we developed `cmd/simulator`. `cmd/simulator` lets you drive arbitrary load across any number of [endpoints] with a user-specified `keys` directory (insecure) `timeout`, `concurrency`, `base-fee`, and `priority-fee`. ## Building the Load Simulator From b547287f83e7f94b0539c84a01de14fb1877b68b Mon Sep 17 00:00:00 2001 From: aaronbuchwald Date: Thu, 26 Jan 2023 13:31:38 -0500 Subject: [PATCH 51/55] Update cmd/simulator/README.md Co-authored-by: Darioush Jalali --- cmd/simulator/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/simulator/README.md b/cmd/simulator/README.md index 3738d95d87..f8dfc7c188 100644 --- a/cmd/simulator/README.md +++ b/cmd/simulator/README.md @@ -42,7 +42,7 @@ Once you've built AvalancheGo, open the AvalancheGo directory in a separate term The staking-enabled flag is only for local testing. Disabling staking serves two functions explicitly for testing purposes: 1. Ignore stake weight on the P-Chain and count each connected peer as having a stake weight of 1 -2. Automagically opts in to validate every Subnet +2. Automatically opts in to validate every Subnet ::: Once you have AvalancheGo running locally, it will be running an HTTP Server on the default port `9650`. This means that the RPC Endpoint for the C-Chain will be http://127.0.0.1:9650/ext/bc/C/rpc. From 20d05ce790c1d8f2a1946cbc65fef0b8ee1168ee Mon Sep 17 00:00:00 2001 From: aaronbuchwald Date: Thu, 26 Jan 2023 13:31:47 -0500 Subject: [PATCH 52/55] Update cmd/simulator/README.md Co-authored-by: Darioush Jalali --- cmd/simulator/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/simulator/README.md b/cmd/simulator/README.md index f8dfc7c188..fdab3b9aa4 100644 --- a/cmd/simulator/README.md +++ b/cmd/simulator/README.md @@ -67,7 +67,7 @@ RPC_ENDPOINTS=http://127.0.0.1:9650/ext/bc/C/rpc If the test needs to generate more keys, it will save them in this directory to ensure that the private keys holding funds at the end of the test are preserved. :::warning -The `keys` directory is not a secure form of storage for private keys. This should only be used in local network and short lived network testing where losing or compromising the keys is not an issue +The `keys` directory is not a secure form of storage for private keys. This should only be used in local network and short lived network testing where losing or compromising the keys is not an issue. ::: ### `timeout` (duration) From df8109fe969ccccec5aa0f72a9e168e7ccc91022 Mon Sep 17 00:00:00 2001 From: aaronbuchwald Date: Thu, 26 Jan 2023 13:38:41 -0500 Subject: [PATCH 53/55] Update contract-examples/README.md Co-authored-by: Darioush Jalali --- contract-examples/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contract-examples/README.md b/contract-examples/README.md index 8e761d7dc6..4661708b1a 100644 --- a/contract-examples/README.md +++ b/contract-examples/README.md @@ -69,7 +69,7 @@ You can use this network configuration by providing the environment variables an RPC_URI=http://127.0.0.1:9650/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc CHAIN_ID=77777 npx hardhat test --network local ``` -Alternatively, you can also copy and paste the `local` network configuration to create a new network configuration for your own local testing. For example, you can copy and paste the `local` network configuration to create your own network and fill in the required details: +Alternatively, you can copy and paste the `local` network configuration to create a new network configuration for your own local testing. For example, you can copy and paste the `local` network configuration to create your own network and fill in the required details: ```json { From cf0fb81eea1246f7f5853b695916b084eaae6229 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 26 Jan 2023 13:41:07 -0500 Subject: [PATCH 54/55] Address review comments --- cmd/simulator/README.md | 6 ++++-- contract-examples/README.md | 2 +- scripts/run.sh | 2 +- tests/load/load_test.go | 2 +- tests/precompile/solidity/suites.go | 14 +++++++------- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/cmd/simulator/README.md b/cmd/simulator/README.md index fdab3b9aa4..64a619dca0 100644 --- a/cmd/simulator/README.md +++ b/cmd/simulator/README.md @@ -64,19 +64,21 @@ RPC_ENDPOINTS=http://127.0.0.1:9650/ext/bc/C/rpc `keys` specifies the directory to find the private keys to use throughout the test. The directory should contain files with the hex address as the name and the corresponding private key as the only content. -If the test needs to generate more keys, it will save them in this directory to ensure that the private keys holding funds at the end of the test are preserved. +If the test needs to generate more keys (to meet the number of workers specified by `concurrency`), it will save them in this directory to ensure that the private keys holding funds at the end of the test are preserved. :::warning The `keys` directory is not a secure form of storage for private keys. This should only be used in local network and short lived network testing where losing or compromising the keys is not an issue. ::: +Note: if none of the keys in this directory have any funds, then the simulator will log an address that it expects to receive funds in order to fund the load test and wait for those funds to arrive. + ### `timeout` (duration) `timeout` specifies the duration to simulate load on the network for this test. ### `concurrency` (int) -`concurrency` specifies the number of concurrent workers that should send transactions to the network throughout the test. Each worker in the load test is a pair of a private key sending transactions to one of the specified RPC Endpoints. +`concurrency` specifies the number of concurrent workers that should send transactions to the network throughout the test. Each worker in the load test is a pairing of a private key and an RPC Endpoint. The private key is used to generate a stream of transactions, which are issued to the RPC Endpoint. ### `base-fee` (int) diff --git a/contract-examples/README.md b/contract-examples/README.md index 4661708b1a..6fbbc5f513 100644 --- a/contract-examples/README.md +++ b/contract-examples/README.md @@ -54,7 +54,7 @@ For more information about precompiles see [subnet-evm precompiles](https://gith Hardhat uses `hardhat.config.js` as the configuration file. You can define tasks, networks, compilers and more in that file. For more information see [here](https://hardhat.org/config/). -In Subnet-EVM, we provide a pre-configured file [hardhat.config.ts](https://github.com/ava-labs/avalanche-smart-contract-quickstart/blob/main/hardhat.config.ts). This file creates an optional network to provide smooth interaction with Subnet-EVM running on an Avalanche Subnet. +In Subnet-EVM, we provide a pre-configured file [hardhat.config.ts](https://github.com/ava-labs/avalanche-smart-contract-quickstart/blob/main/hardhat.config.ts). The HardHat config file includes a single network configuration: `local`. `local` defaults to using the following values for the RPC URL and the Chain ID: diff --git a/scripts/run.sh b/scripts/run.sh index 2661b00159..699a7f4588 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -43,7 +43,7 @@ function execute_cmd() { $@ } -NODE_NAME=node"node1" +NODE_NAME="node1" NODE_DATA_DIR="$DATA_DIR/$NODE_NAME" echo "Creating data directory: $NODE_DATA_DIR" mkdir -p $NODE_DATA_DIR diff --git a/tests/load/load_test.go b/tests/load/load_test.go index dc128526b5..07641a4ce6 100644 --- a/tests/load/load_test.go +++ b/tests/load/load_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2023, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package precompile +package load import ( "context" diff --git a/tests/precompile/solidity/suites.go b/tests/precompile/solidity/suites.go index f70f76f7f1..fa28d54b1d 100644 --- a/tests/precompile/solidity/suites.go +++ b/tests/precompile/solidity/suites.go @@ -26,35 +26,35 @@ var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { // Each ginkgo It node specifies the name of the genesis file (in ./tests/precompile/genesis/) // to use to launch the subnet and the name of the TS test file to run on the subnet (in ./contract-examples/tests/) - ginkgo.It("contract native minter", ginkgo.Label("solidity-with-npx"), func() { + ginkgo.It("contract native minter", ginkgo.Label("precompile"), ginkgo.Label("solidity-with-npx"), func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() utils.ExecuteHardHatTestOnNewBlockchain(ctx, "contract_native_minter") }) - ginkgo.It("tx allow list", ginkgo.Label("solidity-with-npx"), func() { + ginkgo.It("tx allow list", ginkgo.Label("precompile"), ginkgo.Label("solidity-with-npx"), func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() utils.ExecuteHardHatTestOnNewBlockchain(ctx, "tx_allow_list") }) - ginkgo.It("contract deployer allow list", ginkgo.Label("solidity-with-npx"), func() { + ginkgo.It("contract deployer allow list", ginkgo.Label("precompile"), ginkgo.Label("solidity-with-npx"), func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() utils.ExecuteHardHatTestOnNewBlockchain(ctx, "contract_deployer_allow_list") }) - ginkgo.It("fee manager", ginkgo.Label("solidity-with-npx"), func() { + ginkgo.It("fee manager", ginkgo.Label("precompile"), ginkgo.Label("solidity-with-npx"), func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() utils.ExecuteHardHatTestOnNewBlockchain(ctx, "fee_manager") }) - ginkgo.It("reward manager", ginkgo.Label("solidity-with-npx"), func() { + ginkgo.It("reward manager", ginkgo.Label("precompile"), ginkgo.Label("reward-manager"), func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() @@ -65,13 +65,13 @@ var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { // and then runs the hardhat tests for each one without forcing precompile developers to modify this file. // ADD YOUR PRECOMPILE HERE /* - ginkgo.It("your precompile", ginkgo.Label("solidity-with-npx"), func() { + ginkgo.It("your precompile", ginkgo.Label("precompile"), ginkgo.Label("your-precompile"), func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() // Specify the name shared by the genesis file in ./tests/precompile/genesis/{your_precompile}.json // and the test file in ./contract-examples/tests/{your_precompile}.ts - ExecuteHardHatTestOnNewBlockchain(ctx, "your_precompile") + utils.ExecuteHardHatTestOnNewBlockchain(ctx, "your_precompile") }) */ }) From ff5234ce93d72072c9114f34530b56719249b14d Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 26 Jan 2023 15:29:55 -0500 Subject: [PATCH 55/55] Address PR comments --- scripts/run_simulator.sh | 2 +- tests/precompile/solidity/suites.go | 12 ++++++------ tests/utils/subnet.go | 3 +++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/run_simulator.sh b/scripts/run_simulator.sh index 10249888a4..8cd218df0b 100755 --- a/scripts/run_simulator.sh +++ b/scripts/run_simulator.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -e -echo "Beginning simualtor script" +echo "Beginning simulator script" if ! [[ "$0" =~ scripts/run_simulator.sh ]]; then echo "must be run from repository root, but got $0" diff --git a/tests/precompile/solidity/suites.go b/tests/precompile/solidity/suites.go index fa28d54b1d..1404a01603 100644 --- a/tests/precompile/solidity/suites.go +++ b/tests/precompile/solidity/suites.go @@ -26,35 +26,35 @@ var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { // Each ginkgo It node specifies the name of the genesis file (in ./tests/precompile/genesis/) // to use to launch the subnet and the name of the TS test file to run on the subnet (in ./contract-examples/tests/) - ginkgo.It("contract native minter", ginkgo.Label("precompile"), ginkgo.Label("solidity-with-npx"), func() { + ginkgo.It("contract native minter", ginkgo.Label("Precompile"), ginkgo.Label("ContractNativeMinter"), func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() utils.ExecuteHardHatTestOnNewBlockchain(ctx, "contract_native_minter") }) - ginkgo.It("tx allow list", ginkgo.Label("precompile"), ginkgo.Label("solidity-with-npx"), func() { + ginkgo.It("tx allow list", ginkgo.Label("Precompile"), ginkgo.Label("TxAllowList"), func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() utils.ExecuteHardHatTestOnNewBlockchain(ctx, "tx_allow_list") }) - ginkgo.It("contract deployer allow list", ginkgo.Label("precompile"), ginkgo.Label("solidity-with-npx"), func() { + ginkgo.It("contract deployer allow list", ginkgo.Label("Precompile"), ginkgo.Label("ContractDeployerAllowList"), func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() utils.ExecuteHardHatTestOnNewBlockchain(ctx, "contract_deployer_allow_list") }) - ginkgo.It("fee manager", ginkgo.Label("precompile"), ginkgo.Label("solidity-with-npx"), func() { + ginkgo.It("fee manager", ginkgo.Label("Precompile"), ginkgo.Label("FeeManager"), func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() utils.ExecuteHardHatTestOnNewBlockchain(ctx, "fee_manager") }) - ginkgo.It("reward manager", ginkgo.Label("precompile"), ginkgo.Label("reward-manager"), func() { + ginkgo.It("reward manager", ginkgo.Label("Precompile"), ginkgo.Label("RewardManager"), func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() @@ -65,7 +65,7 @@ var _ = ginkgo.Describe("[Precompiles]", ginkgo.Ordered, func() { // and then runs the hardhat tests for each one without forcing precompile developers to modify this file. // ADD YOUR PRECOMPILE HERE /* - ginkgo.It("your precompile", ginkgo.Label("precompile"), ginkgo.Label("your-precompile"), func() { + ginkgo.It("your precompile", ginkgo.Label("Precompile"), ginkgo.Label("YourPrecompile"), func() { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() diff --git a/tests/utils/subnet.go b/tests/utils/subnet.go index bd397e5f71..75fb42f585 100644 --- a/tests/utils/subnet.go +++ b/tests/utils/subnet.go @@ -40,6 +40,9 @@ func RunHardhatTests(test string, rpcURI string) { out, err := cmd.CombinedOutput() fmt.Printf("\nCombined output:\n\n%s\n", string(out)) + if err != nil { + fmt.Printf("\nErr: %s\n", err.Error()) + } gomega.Expect(err).Should(gomega.BeNil()) }