From b5454e018363023a20d0b8acf06c782226018568 Mon Sep 17 00:00:00 2001 From: Matias Romeo Date: Mon, 17 Jul 2023 13:50:55 -0300 Subject: [PATCH 01/71] Add missing arg to nodeos_eos_evm_server.py --- .gitignore | 3 +++ external/silkworm | 2 +- tests/nodeos_eos_evm_server.py | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) mode change 100644 => 100755 tests/nodeos_eos_evm_server.py diff --git a/.gitignore b/.gitignore index 5acb669..85064e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ build .vscode +tests/nodeos_eos_evm_server/artifacts +tests/nodeos_eos_evm_server/cache +tests/nodeos_eos_evm_server/node_modules diff --git a/external/silkworm b/external/silkworm index 681d68a..2f000a5 160000 --- a/external/silkworm +++ b/external/silkworm @@ -1 +1 @@ -Subproject commit 681d68ab963a56b79426a0f7eed7b512adf754cb +Subproject commit 2f000a5c5ae74da14e97333ef37bae8b059c63ae diff --git a/tests/nodeos_eos_evm_server.py b/tests/nodeos_eos_evm_server.py old mode 100644 new mode 100755 index 1082cfc..a0cd95a --- a/tests/nodeos_eos_evm_server.py +++ b/tests/nodeos_eos_evm_server.py @@ -66,6 +66,7 @@ appArgs.add(flag="--eos-evm-contract-root", type=str, help="EOS EVM Contract build dir", default=None) appArgs.add(flag="--genesis-json", type=str, help="File to save generated genesis json", default="eos-evm-genesis.json") appArgs.add(flag="--read-endpoint", type=str, help="EVM read endpoint (eos-evm-rpc)", default="http://localhost:8881") +appArgs.add(flag="--use-eos-vm-oc", type=bool, help="EOS EVM Contract build dir", default=False) args=TestHelper.parse_args({"--keep-logs","--dump-error-details","-v","--leave-running","--clean-run" }, applicationSpecificArgs=appArgs) debug=args.v @@ -76,7 +77,7 @@ eosEvmContractRoot=args.eos_evm_contract_root gensisJson=args.genesis_json readEndpoint=args.read_endpoint - +useEosVmOC=args.use_eos_vm_oc assert eosEvmContractRoot is not None, "--eos-evm-contract-root is required" totalProducerNodes=2 From 74e8b2d07938e4f86ac51981c90c9de6af72b245 Mon Sep 17 00:00:00 2001 From: Matias Romeo Date: Tue, 18 Jul 2023 00:06:25 -0300 Subject: [PATCH 02/71] Add github workflow --- .github/workflows/build-node.sh | 31 ++++++++++++++++ .github/workflows/node.md | 53 +++++++++++++++++++++++++++ .github/workflows/node.yml | 64 +++++++++++++++++++++++++++++++++ 3 files changed, 148 insertions(+) create mode 100755 .github/workflows/build-node.sh create mode 100644 .github/workflows/node.md create mode 100644 .github/workflows/node.yml diff --git a/.github/workflows/build-node.sh b/.github/workflows/build-node.sh new file mode 100755 index 0000000..fae8123 --- /dev/null +++ b/.github/workflows/build-node.sh @@ -0,0 +1,31 @@ +#!/bin/bash +set -eo pipefail + +# print and run a command +function ee() +{ + echo "$ $*" + eval "$@" +} + +# install dependencies for self-hosted runners +ee export DEBIAN_FRONTEND='noninteractive' +ee sudo apt-get update -q +ee sudo apt-get install -yqq cmake gcc-10 g++-10 + +# debug code +echo "CC='${CC}'" +echo "CXX='${CXX}'" +ee cmake --version + +# build +ee mkdir build +ee pushd build +ee cmake .. +ee make -j "$(nproc)" + +# pack +ee popd +ee 'tar -czf build.tar.gz build/*' + +echo "Done! - ${0##*/}" diff --git a/.github/workflows/node.md b/.github/workflows/node.md new file mode 100644 index 0000000..82579ad --- /dev/null +++ b/.github/workflows/node.md @@ -0,0 +1,53 @@ +# EOS EVM Node CI +This GitHub Actions workflow builds eos-evm-node and eos-evm-rpc. + +### Index +1. [Triggers](#triggers) +1. [Inputs](#inputs) +1. [Steps](#steps) +1. [Outputs](#outputs) +1. [See Also](#see-also) + +## Triggers +This GitHub action will run under the following circumstances: +1. When code is pushed. +1. Workflow dispatch event, a manual CI run, which can be triggered by the "Workflow Dispatch" button in the Actions tab of the GitHub repository, among other means. + +## Inputs +The inputs for this GitHub action are: +1. `GITHUB_TOKEN` - a GitHub Actions intrinsic used to access the repository and other public resources. +1. `TRUSTEVM_CI_APP_ID` - the app ID of the `trustevm-ci-submodule-checkout` GitHub App. +1. `TRUSTEVM_CI_APP_KEY` - the private key to the `trustevm-ci-submodule-checkout` GitHub App. +1. `upload-artifacts` - a boolean input that specifies whether or not to upload the artifacts of the build. The default value is `false`. This can be overridden in manual CI runs. + +These inputs are used in various steps of the workflow to perform actions such as authentication, downloading artifacts, configuring the build, and uploading artifacts. + +## Steps +This workflow performs the following steps: +1. Attach Documentation + 1. Checkout the repo with no submodules. + 1. Attach an annotation to the GitHub Actions build summary page containing CI documentation. +1. EOS EVM Node Build + 1. Authenticate to the `trustevm-ci-submodule-checkout` GitHub app using the [AntelopeIO/github-app-token-action](https://github.com/AntelopeIO/github-app-token-action) action to obtain an ephemeral token. + 1. Checkout the repo and submodules using the ephemeral token. + 1. Build eos-evm-node and eos-evm-rpc using `cmake` and `make`. + 1. Upload the build folder to GitHub Actions if the `upload-artifacts` input is set to `true`. + +## Outputs +This workflow produces the following outputs: +1. Build Artifacts - `build.tar.gz` containing the built artifacts of eos-evm-node and eos-evm-rpc, if the `upload-artifacts` input is set to `true`. + +> 💾️ Build artifacts are only attached on-demand for this pipeline because they are >117 MB each, but we only get 2 GB of cumulative artifact storage in GitHub Actions while eos-evm is a private repo. Obtain artifacts by performing a manual build with `upload-artifacts` set to `true`. + +## See Also +- [github-app-token-action](https://github.com/AntelopeIO/github-app-token-action) GitHub action +- [EOS EVM Documentation](../../README.md) + +For assistance with the CI system, please open an issue in this repo or reach out in the `#help-automation` channel via IM. + +*** +**_Legal notice_** +This document was generated in collaboration with ChatGPT from OpenAI, a machine learning algorithm or weak artificial intelligence (AI). At the time of this writing, the [OpenAI terms of service agreement](https://openai.com/terms) §3.a states: +> Your Content. You may provide input to the Services (“Input”), and receive output generated and returned by the Services based on the Input (“Output”). Input and Output are collectively “Content.” As between the parties and to the extent permitted by applicable law, you own all Input, and subject to your compliance with these Terms, OpenAI hereby assigns to you all its right, title and interest in and to Output. + +This notice is required in some countries. diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml new file mode 100644 index 0000000..52ac1cb --- /dev/null +++ b/.github/workflows/node.yml @@ -0,0 +1,64 @@ +name: EOS EVM Node CI + +on: + push: + branches: + - main + - release/* + pull_request: + workflow_dispatch: + inputs: + upload-artifacts: + description: 'Upload artifacts, including the build.tar.gz, for debugging.' + type: boolean + default: false + +defaults: + run: + shell: bash + +jobs: + documentation: + name: Attach Documentation + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + fetch-depth: 1 + submodules: 'false' + + - name: Attach Documentation + run: cat .github/workflows/node.md >> $GITHUB_STEP_SUMMARY + + build: + name: EOS EVM Node Build + runs-on: ubuntu-20.04 + + steps: + - name: Authenticate + id: auth + uses: AntelopeIO/github-app-token-action@v1 + with: + app_id: ${{ secrets.TRUSTEVM_CI_APP_ID }} + private_key: ${{ secrets.TRUSTEVM_CI_APP_KEY }} + + - name: Checkout Repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: 'recursive' + token: ${{ steps.auth.outputs.token }} + + - name: Build EOS EVM Node + run: .github/workflows/build-node.sh + env: + CC: gcc-10 + CXX: g++-10 + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + if: inputs.upload-artifacts || false + with: + name: build.tar.gz + path: build.tar.gz From e2c370e287f785c9d374b5834e9716efe89e8279 Mon Sep 17 00:00:00 2001 From: Matias Romeo Date: Tue, 18 Jul 2023 00:07:36 -0300 Subject: [PATCH 03/71] Add README.md --- README.md | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..db97544 --- /dev/null +++ b/README.md @@ -0,0 +1,77 @@ +# EOS EVM NODE + +## Overview + +The EOS EVM Node consumes Antelope (EOS) blocks from a Leap node via state history (SHiP) endpoint and builds the virtual EVM blockchain in a deterministic way. +The EOS EVM RPC will talk with the EOS EVM node, and provide read-only Ethereum compatible RPC services for clients (such as MetaMask). + +Clients can also push Ethereum compatible transactions (aka EVM transactions) to the EOS blockchain, via proxy and Transaction Wrapper (TX-Wrapper), which encapsulates EVM transactions into Antelope transactions. All EVM transactions will be validated and executed by the EOS EVM Contract deployed on the EOS blockchain. + +``` + | + | WRITE +-----------------+ + | +------------------------->| TX-Wrapper | + | | +-------v---------+ + | | | Leap node | ---> connect to the other nodes in the blockchain network + client | | +-------+---------+ + request | +-----+-----+ | +---------+------>| Proxy | | + | +-----------+ v + | | +-----------------+ + | READ | +--------------+ | | + | +---->| EOS EVM RPC |---->| EOS EVM Node + + | +--------------+ | | + | +-----------------+ +``` + +## Compilation + +### checkout the source code: +``` +git clone https://github.com/eosnetworkfoundation/eos-evm-node.git +cd eos-evm-node +git submodule update --init --recursive +``` + +### compile eos-evm-node, eos-evm-rpc + +Prerequisites: +- Ubuntu 20 or later or other compatible Linux +- gcc 10 or later + +Easy Steps: +``` +mkdir build +cd build +cmake .. +make -j8 +``` +You'll get the list of binaries with other tools: +``` +src/eos-evm-node +src/eos-evm-rpc +``` + +Alternatively, to build with specific compiler: +``` +mkdir build +cd build +cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ .. +make -j8 +``` + +## Deployments + +For local testnet deployment and testings, please refer to +https://github.com/eosnetworkfoundation/eos-evm/blob/main/docs/local_testnet_deployment_plan.md + +For public testnet deployment, please refer to +https://github.com/eosnetworkfoundation/eos-evm/blob/main/docs/public_testnet_deployment_plan.md + +## CI +This repo contains the following GitHub Actions workflows for CI: +- EOS EVM Node CI - build the EOS EVM node + - [Pipeline](https://github.com/eosnetworkfoundation/eos-evm-node/actions/workflows/node.yml) + - [Documentation](./.github/workflows/node.md) + +See the pipeline documentation for more information. From fc72600516e4c12041085f436310c58eb538a1b5 Mon Sep 17 00:00:00 2001 From: Matias Romeo Date: Tue, 18 Jul 2023 22:24:39 -0300 Subject: [PATCH 04/71] Update silkworm --- external/silkworm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/silkworm b/external/silkworm index 2f000a5..caea40b 160000 --- a/external/silkworm +++ b/external/silkworm @@ -1 +1 @@ -Subproject commit 2f000a5c5ae74da14e97333ef37bae8b059c63ae +Subproject commit caea40b15488a536fa53fc4f0e093c353f65de80 From 1c89d4379703e87b6573a4051d19fd879563b922 Mon Sep 17 00:00:00 2001 From: Matias Romeo Date: Wed, 19 Jul 2023 00:08:59 -0300 Subject: [PATCH 05/71] Use regular endpoints as the default values in command line options --- src/rpc_plugin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpc_plugin.cpp b/src/rpc_plugin.cpp index 9af4985..c36c970 100644 --- a/src/rpc_plugin.cpp +++ b/src/rpc_plugin.cpp @@ -32,11 +32,11 @@ rpc_plugin::~rpc_plugin() {} void rpc_plugin::set_program_options( appbase::options_description& cli, appbase::options_description& cfg ) { cfg.add_options() - ("http-port", boost::program_options::value()->default_value("127.0.0.1:8881"), + ("http-port", boost::program_options::value()->default_value(kDefaultEth1EndPoint), "http port for JSON RPC of the form
:") - ("rpc-engine-port", boost::program_options::value()->default_value("127.0.0.1:8882"), + ("rpc-engine-port", boost::program_options::value()->default_value(kDefaultEngineEndPoint), "engine port for JSON RPC of the form
:") - ("eos-evm-node", boost::program_options::value()->default_value("127.0.0.1:8001"), + ("eos-evm-node", boost::program_options::value()->default_value(kDefaultPrivateApiAddr), "address to eos-evm-node of the form
:") ("rpc-threads", boost::program_options::value()->default_value(16), "number of threads for use with rpc") From 848237a3f46d17455ac7ef2b966358940eb1d66b Mon Sep 17 00:00:00 2001 From: Matias Romeo Date: Fri, 21 Jul 2023 12:14:28 -0300 Subject: [PATCH 06/71] Fix compilation --- src/rpc_plugin.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/rpc_plugin.cpp b/src/rpc_plugin.cpp index c36c970..669b0e9 100644 --- a/src/rpc_plugin.cpp +++ b/src/rpc_plugin.cpp @@ -8,12 +8,6 @@ #include #include -// #include -// #include -// #include -// #include -// #include - class rpc_plugin_impl : std::enable_shared_from_this { public: rpc_plugin_impl(silkworm::rpc::DaemonSettings settings) @@ -32,11 +26,11 @@ rpc_plugin::~rpc_plugin() {} void rpc_plugin::set_program_options( appbase::options_description& cli, appbase::options_description& cfg ) { cfg.add_options() - ("http-port", boost::program_options::value()->default_value(kDefaultEth1EndPoint), + ("http-port", boost::program_options::value()->default_value(silkworm::kDefaultEth1EndPoint), "http port for JSON RPC of the form
:") - ("rpc-engine-port", boost::program_options::value()->default_value(kDefaultEngineEndPoint), + ("rpc-engine-port", boost::program_options::value()->default_value(silkworm::kDefaultEngineEndPoint), "engine port for JSON RPC of the form
:") - ("eos-evm-node", boost::program_options::value()->default_value(kDefaultPrivateApiAddr), + ("eos-evm-node", boost::program_options::value()->default_value(silkworm::kDefaultPrivateApiAddr), "address to eos-evm-node of the form
:") ("rpc-threads", boost::program_options::value()->default_value(16), "number of threads for use with rpc") From 9ef6e82bf4ccee26c4b494c348cf6e60827120f7 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Thu, 27 Jul 2023 20:39:34 -0500 Subject: [PATCH 07/71] Trying quick fix for CICD workflow to install conan in build script. --- .github/workflows/build-node.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-node.sh b/.github/workflows/build-node.sh index fae8123..528939f 100755 --- a/.github/workflows/build-node.sh +++ b/.github/workflows/build-node.sh @@ -12,6 +12,7 @@ function ee() ee export DEBIAN_FRONTEND='noninteractive' ee sudo apt-get update -q ee sudo apt-get install -yqq cmake gcc-10 g++-10 +ee sudo pip install conan # debug code echo "CC='${CC}'" From 6f6649b485fcf2fce9d383a41e1a18455dd57131 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Thu, 27 Jul 2023 21:00:14 -0500 Subject: [PATCH 08/71] Need to step back from conan 2.x to a 1.x variant. --- .github/workflows/build-node.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-node.sh b/.github/workflows/build-node.sh index 528939f..0ee2dbd 100755 --- a/.github/workflows/build-node.sh +++ b/.github/workflows/build-node.sh @@ -12,7 +12,7 @@ function ee() ee export DEBIAN_FRONTEND='noninteractive' ee sudo apt-get update -q ee sudo apt-get install -yqq cmake gcc-10 g++-10 -ee sudo pip install conan +ee sudo pip install -v "conan==1.60.2" # debug code echo "CC='${CC}'" From 3c594f85fd6a85d32230b4d8d7c3ff310c21da2e Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Thu, 27 Jul 2023 21:23:19 -0500 Subject: [PATCH 09/71] Debugging build. Add step to apt-get upgrade after update. --- .github/workflows/build-node.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-node.sh b/.github/workflows/build-node.sh index 0ee2dbd..9d5af56 100755 --- a/.github/workflows/build-node.sh +++ b/.github/workflows/build-node.sh @@ -11,6 +11,7 @@ function ee() # install dependencies for self-hosted runners ee export DEBIAN_FRONTEND='noninteractive' ee sudo apt-get update -q +ee sudo apt-get upgrade -y ee sudo apt-get install -yqq cmake gcc-10 g++-10 ee sudo pip install -v "conan==1.60.2" From 16f9e6f13e90d5067a522f6861488b5eae2c0578 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Fri, 28 Jul 2023 10:16:47 -0500 Subject: [PATCH 10/71] Try building up from base docker image. --- .cicd/platforms.json | 6 ++++ .cicd/platforms/ubuntu20.Dockerfile | 10 ++++++ .github/workflows/build-node.sh | 9 +++--- .github/workflows/node.yml | 50 ++++++++++++++++++++++++++++- 4 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 .cicd/platforms.json create mode 100644 .cicd/platforms/ubuntu20.Dockerfile diff --git a/.cicd/platforms.json b/.cicd/platforms.json new file mode 100644 index 0000000..8268f2f --- /dev/null +++ b/.cicd/platforms.json @@ -0,0 +1,6 @@ +{ + "ubuntu20": { + "dockerfile": ".cicd/platforms/ubuntu20.Dockerfile" + } + } + \ No newline at end of file diff --git a/.cicd/platforms/ubuntu20.Dockerfile b/.cicd/platforms/ubuntu20.Dockerfile new file mode 100644 index 0000000..7bbacd0 --- /dev/null +++ b/.cicd/platforms/ubuntu20.Dockerfile @@ -0,0 +1,10 @@ +FROM ubuntu:focal +ENV TZ="America/New_York" +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get upgrade -y && \ + apt-get install -y build-essential \ + cmake \ + gcc-10 \ + g++-10 \ + git +RUN pip install -v "conan==1.60.2" diff --git a/.github/workflows/build-node.sh b/.github/workflows/build-node.sh index 9d5af56..a9d674f 100755 --- a/.github/workflows/build-node.sh +++ b/.github/workflows/build-node.sh @@ -9,11 +9,10 @@ function ee() } # install dependencies for self-hosted runners -ee export DEBIAN_FRONTEND='noninteractive' -ee sudo apt-get update -q -ee sudo apt-get upgrade -y -ee sudo apt-get install -yqq cmake gcc-10 g++-10 -ee sudo pip install -v "conan==1.60.2" +# ee export DEBIAN_FRONTEND='noninteractive' +# ee sudo apt-get update -q +# ee sudo apt-get install -yqq cmake gcc-10 g++-10 +# ee sudo pip install -v "conan==1.60.2" # debug code echo "CC='${CC}'" diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 52ac1cb..3131b38 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -31,9 +31,57 @@ jobs: - name: Attach Documentation run: cat .github/workflows/node.md >> $GITHUB_STEP_SUMMARY + d: + name: Discover Platforms + runs-on: ubuntu-latest + outputs: + missing-platforms: ${{steps.discover.outputs.missing-platforms}} + p: ${{steps.discover.outputs.platforms}} + steps: + - name: Discover Platforms + id: discover + uses: AntelopeIO/discover-platforms-action@v1 + with: + platform-file: .cicd/platforms.json + password: ${{secrets.GITHUB_TOKEN}} + package-name: builders + + build-platforms: + name: Build Platforms + needs: d + if: needs.d.outputs.missing-platforms != '[]' + strategy: + fail-fast: false + matrix: + platform: ${{fromJSON(needs.d.outputs.missing-platforms)}} + runs-on: ["self-hosted", "enf-x86-beefy"] + permissions: + packages: write + contents: read + steps: + - name: Login to Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{github.repository_owner}} + password: ${{secrets.GITHUB_TOKEN}} + - name: Build and push + uses: docker/build-push-action@v3 + with: + push: true + tags: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}} + file: ${{fromJSON(needs.d.outputs.p)[matrix.platform].dockerfile}} + build: name: EOS EVM Node Build - runs-on: ubuntu-20.04 + needs: [d, build-platforms] + if: always() && needs.d.result == 'success' && (needs.build-platforms.result == 'success' || needs.build-platforms.result == 'skipped') + strategy: + fail-fast: false + matrix: + platform: [ ubuntu20 ] + runs-on: ubuntu-latest + container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}} steps: - name: Authenticate From 6990ac2a86491ef738baf71498c6283ac3778524 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Fri, 28 Jul 2023 10:31:51 -0500 Subject: [PATCH 11/71] Try building platforms on ubuntu-latest. --- .github/workflows/node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 3131b38..a76820d 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -54,7 +54,7 @@ jobs: fail-fast: false matrix: platform: ${{fromJSON(needs.d.outputs.missing-platforms)}} - runs-on: ["self-hosted", "enf-x86-beefy"] + runs-on: ubunut-latest permissions: packages: write contents: read From c9e83270f3487cab48a27dd4970d8573d14106dc Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Fri, 28 Jul 2023 10:35:41 -0500 Subject: [PATCH 12/71] Fix spelling. --- .github/workflows/node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index a76820d..d84f233 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -54,7 +54,7 @@ jobs: fail-fast: false matrix: platform: ${{fromJSON(needs.d.outputs.missing-platforms)}} - runs-on: ubunut-latest + runs-on: ubuntu-latest permissions: packages: write contents: read From 260a852e784462d400247d65ad8d98052fcf938a Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Fri, 28 Jul 2023 10:41:34 -0500 Subject: [PATCH 13/71] Install python3-pip in base image --- .cicd/platforms/ubuntu20.Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.cicd/platforms/ubuntu20.Dockerfile b/.cicd/platforms/ubuntu20.Dockerfile index 7bbacd0..264d78c 100644 --- a/.cicd/platforms/ubuntu20.Dockerfile +++ b/.cicd/platforms/ubuntu20.Dockerfile @@ -6,5 +6,6 @@ RUN apt-get update && apt-get upgrade -y && \ cmake \ gcc-10 \ g++-10 \ - git + git \ + python3-pip RUN pip install -v "conan==1.60.2" From b90d10cb293555a6d9ff9dba8c4fb03f2197dfbb Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Fri, 28 Jul 2023 11:28:31 -0500 Subject: [PATCH 14/71] Update cicd to ubuntu22. --- .cicd/platforms.json | 4 ++-- .cicd/platforms/ubuntu22.Dockerfile | 11 +++++++++++ .github/workflows/node.yml | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .cicd/platforms/ubuntu22.Dockerfile diff --git a/.cicd/platforms.json b/.cicd/platforms.json index 8268f2f..03ebb72 100644 --- a/.cicd/platforms.json +++ b/.cicd/platforms.json @@ -1,6 +1,6 @@ { - "ubuntu20": { - "dockerfile": ".cicd/platforms/ubuntu20.Dockerfile" + "ubuntu22": { + "dockerfile": ".cicd/platforms/ubuntu22.Dockerfile" } } \ No newline at end of file diff --git a/.cicd/platforms/ubuntu22.Dockerfile b/.cicd/platforms/ubuntu22.Dockerfile new file mode 100644 index 0000000..11bcc01 --- /dev/null +++ b/.cicd/platforms/ubuntu22.Dockerfile @@ -0,0 +1,11 @@ +FROM ubuntu:jammy +ENV TZ="America/New_York" +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get upgrade -y && \ + apt-get install -y build-essential \ + cmake \ + gcc-10 \ + g++-10 \ + git \ + python3-pip +RUN pip install -v "conan==1.60.2" diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index d84f233..d2c6b0c 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -79,7 +79,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [ ubuntu20 ] + platform: [ ubuntu22 ] runs-on: ubuntu-latest container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}} From 89b79f92f3c164a1e5b0dc3905d6873d980b7b89 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Fri, 28 Jul 2023 11:54:38 -0500 Subject: [PATCH 15/71] Upgrade compiler to gcc/g++ 11 --- .cicd/platforms/ubuntu22.Dockerfile | 4 ++-- .github/workflows/node.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.cicd/platforms/ubuntu22.Dockerfile b/.cicd/platforms/ubuntu22.Dockerfile index 11bcc01..0bce456 100644 --- a/.cicd/platforms/ubuntu22.Dockerfile +++ b/.cicd/platforms/ubuntu22.Dockerfile @@ -4,8 +4,8 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get upgrade -y && \ apt-get install -y build-essential \ cmake \ - gcc-10 \ - g++-10 \ + gcc-11 \ + g++-11 \ git \ python3-pip RUN pip install -v "conan==1.60.2" diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index d2c6b0c..e204d33 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -101,8 +101,8 @@ jobs: - name: Build EOS EVM Node run: .github/workflows/build-node.sh env: - CC: gcc-10 - CXX: g++-10 + CC: gcc-11 + CXX: g++-11 - name: Upload Artifacts uses: actions/upload-artifact@v3 From c2fae993e24280bdc7c3d9e80f90f259e634b4c3 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Fri, 28 Jul 2023 12:33:49 -0500 Subject: [PATCH 16/71] Remove ubuntu20 Dockerfile. --- .cicd/platforms/ubuntu20.Dockerfile | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .cicd/platforms/ubuntu20.Dockerfile diff --git a/.cicd/platforms/ubuntu20.Dockerfile b/.cicd/platforms/ubuntu20.Dockerfile deleted file mode 100644 index 264d78c..0000000 --- a/.cicd/platforms/ubuntu20.Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:focal -ENV TZ="America/New_York" -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get upgrade -y && \ - apt-get install -y build-essential \ - cmake \ - gcc-10 \ - g++-10 \ - git \ - python3-pip -RUN pip install -v "conan==1.60.2" From 9bc8f69c221fa42a735192460c095eb4c4d5d329 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Fri, 28 Jul 2023 12:34:38 -0500 Subject: [PATCH 17/71] Dependencies are now installed on the base image. --- .github/workflows/build-node.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/build-node.sh b/.github/workflows/build-node.sh index a9d674f..2df4993 100755 --- a/.github/workflows/build-node.sh +++ b/.github/workflows/build-node.sh @@ -8,12 +8,6 @@ function ee() eval "$@" } -# install dependencies for self-hosted runners -# ee export DEBIAN_FRONTEND='noninteractive' -# ee sudo apt-get update -q -# ee sudo apt-get install -yqq cmake gcc-10 g++-10 -# ee sudo pip install -v "conan==1.60.2" - # debug code echo "CC='${CC}'" echo "CXX='${CXX}'" From 07743bbb0ad3335f12061743fb9f02017fb7f587 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Fri, 28 Jul 2023 12:35:12 -0500 Subject: [PATCH 18/71] Cleanup whitespace. --- .cicd/platforms.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.cicd/platforms.json b/.cicd/platforms.json index 03ebb72..2b0c8c4 100644 --- a/.cicd/platforms.json +++ b/.cicd/platforms.json @@ -3,4 +3,3 @@ "dockerfile": ".cicd/platforms/ubuntu22.Dockerfile" } } - \ No newline at end of file From 5e88edd3c1d169e3d0056527a53d401c24a7fc6c Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Fri, 28 Jul 2023 15:05:52 -0500 Subject: [PATCH 19/71] Port PR for leap integration test updates and workflow. Use eos-evm repo contract artifact. --- .github/workflows/node.yml | 133 ++++++++++++++++++++++++++++++-- peripherals/tx_wrapper/index.js | 4 +- tests/nodeos_eos_evm_test.py | 76 +++++++++++------- 3 files changed, 179 insertions(+), 34 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index e204d33..15ed344 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -7,11 +7,6 @@ on: - release/* pull_request: workflow_dispatch: - inputs: - upload-artifacts: - description: 'Upload artifacts, including the build.tar.gz, for debugging.' - type: boolean - default: false defaults: run: @@ -106,7 +101,133 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v3 - if: inputs.upload-artifacts || false with: name: build.tar.gz path: build.tar.gz + + integration-test: + name: EOS EVM Integration Tests + needs: [d, build] + if: always() && needs.d.result == 'success' && needs.build.result == 'success' + strategy: + fail-fast: false + matrix: + platform: [ ubuntu22 ] + runs-on: ubuntu-latest + container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}} + env: + CC: gcc-11 + CXX: g++-11 + DCMAKE_BUILD_TYPE: 'Release' + + steps: + - name: Download CDT + uses: AntelopeIO/asset-artifact-download-action@v3 + with: + owner: AntelopeIO + repo: cdt + target: 'v3.1.0' + prereleases: false + file: 'cdt_.*amd64.deb' + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install CDT + run: sudo apt-get install -y ./cdt*.deb + + - name: Download EOS EVM Contract + uses: AntelopeIO/asset-artifact-download-action@v3 + with: + owner: eosnetworkfoundation + repo: eos-evm + target: 'main' + file: 'contract.tar.gz' + artifact-name: contract.test-actions-off.tar.gz + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract EOS EVM Contract + run: | + mkdir contract + mv contract.tar.gz contract/ + cd contract + tar xvg contract.tar.gz + + - name: Download leap-dev binary + uses: AntelopeIO/asset-artifact-download-action@v3 + with: + owner: AntelopeIO + repo: leap + target: 'v4' + prereleases: false + file: 'leap-dev.*(x86_64|amd64).deb' + container-package: experimental-binaries + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Download leap binary + uses: AntelopeIO/asset-artifact-download-action@v3 + with: + owner: AntelopeIO + repo: leap + target: 'v4' + file: 'leap.*(x86_64|amd64).deb' + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Leap + run: | + sudo apt-get install -y ./leap*.deb + dpkg -L leap-dev | grep TestHarness + dpkg -L leap | grep cleos + + - name: Link Leap TestHarness Module (fix for v4 of leap) + run: sudo ln -s /usr/share/leap_testing/tests/TestHarness /usr/lib/python3/dist-packages/TestHarness + + - name: Checkout EOS EVM Node Repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: 'recursive' + token: ${{ steps.auth.outputs.token }} + + - name: Download EOS EVM Node builddir + uses: actions/download-artifact@v3 + with: + name: build.tar.gz + + - name: Extract EOS EVM Node builddir + run: | + tar xfv build.tar.gz + + - name: Install Test Depedencies + run: | + pip install --upgrade web3 + sudo apt install nodejs + sudo apt install npm + npm install eosjs + npm install ethereumjs-util + npm install node-fetch + npm install http-jsonrpc-server + npm install dotenv + npm install is-valid-hostname + + - name: Check Depedency Versions + run: | + pip show web3 + node --version + + - name: Test Leap Integration + run: | + mkdir test_run_root + cd test_run_root + ./../tests/leap/nodeos_eos_evm_test.py -v --eos-evm-contract-root ../contract/build --eos-evm-build-root ../build --use-tx-wrapper ../peripherals/tx_wrapper + + - name: Prepare Logs + if: failure() + run: | + tar -czf leap-int-test-logs.tar.gz test_run_root/* + + - name: Upload logs from failed tests + uses: actions/upload-artifact@v3 + if: failure() + with: + name: leap-int-test-logs.tar.gz + path: leap-int-test-logs.tar.gz + \ No newline at end of file diff --git a/peripherals/tx_wrapper/index.js b/peripherals/tx_wrapper/index.js index 1256e50..cdcf94c 100644 --- a/peripherals/tx_wrapper/index.js +++ b/peripherals/tx_wrapper/index.js @@ -1,7 +1,7 @@ const { Api, JsonRpc, RpcError } = require("eosjs"); const { JsSignatureProvider } = require("eosjs/dist/eosjs-jssig"); // development only -const fetch = require("node-fetch"); // node only; not needed in browsers -//const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); +// const fetch = require("node-fetch"); // node only; not needed in browsers +const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); const { TextEncoder, TextDecoder } = require("util"); // node only; native TextEncoder/Decoder const RpcServer = require("http-jsonrpc-server"); diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index 84c999b..0c34f62 100644 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -20,14 +20,15 @@ from web3 import Web3 import rlp -sys.path.append(os.getcwd()) sys.path.append(os.path.join(os.getcwd(), "tests")) -from TestHarness import Cluster, TestHelper, Utils, WalletMgr +os.environ["CORE_SYMBOL_NAME"]='EOS' +print(f"CORE_SYMBOL_NAME: {os.environ.get('CORE_SYMBOL_NAME')}") + +from TestHarness import Cluster, TestHelper, Utils, WalletMgr, CORE_SYMBOL from TestHarness.TestHelper import AppArgs from TestHarness.testUtils import ReturnType from TestHarness.testUtils import unhandledEnumType -from core_symbol import CORE_SYMBOL from antelope_name import convert_name_to_value @@ -53,10 +54,13 @@ # --eos-evm-build-root should point to the root of EOS EVM build dir # --eos-evm-contract-root should point to root of EOS EVM contract build dir # -# Example: -# cd ~/ext/leap/build -# edit tests/core_symbol.py to be EOS -# ~/ext/eos-evm/tests/leap/nodeos_eos_evm_test.py --eos-evm-contract-root ~/ext/eos-evm/contract/build --eos-evm-build-root ~/ext/eos-evm/build --use-tx-wrapper ~/ext/eos-evm/peripherals/tx_wrapper --leave-running +# Example (Running with leap src build): +# cd ~/leap/build +# ~/eos-evm/tests/leap/nodeos_eos_evm_test.py --eos-evm-contract-root ~/eos-evm/contract/build --eos-evm-build-root ~/eos-evm/build --use-tx-wrapper ~/eos-evm/peripherals/tx_wrapper --leave-running +# +# Example (Running with leap dev-install): +# export PYTHONPATH=/lib/python3/dist-packages +# ~/eos-evm/tests/leap/nodeos_eos_evm_test.py --eos-evm-contract-root ~/eos-evm/contract/build --eos-evm-build-root ~/eos-evm/build --use-tx-wrapper ~/eos-evm/peripherals/tx_wrapper --leave-running # # Launches wallet at port: 9899 # Example: bin/cleos --wallet-url http://127.0.0.1:9899 ... @@ -109,13 +113,13 @@ def interact_with_storage_contract(dest, nonce): nonce=nonce, gas=100000, #100k Gas gasPrice=gasP, - to=Web3.toChecksumAddress(dest), + to=Web3.to_checksum_address(dest), value=amount, data=unhexlify("6057361d00000000000000000000000000000000000000000000000000000000000000%02x" % nonce), chainId=evmChainId ), evmSendKey) - actData = {"miner":minerAcc.name, "rlptx":Web3.toHex(signed_trx.rawTransaction)[2:]} + actData = {"miner":minerAcc.name, "rlptx":Web3.to_hex(signed_trx.rawTransaction)[2:]} retValue = prodNode.pushMessage(evmAcc.name, "pushtx", json.dumps(actData), '-p {0}'.format(minerAcc.name)) assert retValue[0], "pushtx to ETH contract failed." Utils.Print("\tBlock#", retValue[1]["processed"]["block_num"]) @@ -135,6 +139,7 @@ def writeTxWrapperEnv(): PORT="18888" EOS_EVM_ACCOUNT="evmevmevmevm" EOS_SENDER="{txWrapAcc.name}" +EOS_PERMISSION="active" ''' envFile.write(env) @@ -183,6 +188,9 @@ def processUrllibRequest(endpoint, payload={}, silentErrors=False, exitOnError=F unhandledEnumType(returnType) else: return None + except: + Utils.Print("Unknown exception occurred during processUrllibRequest") + raise if exitMsg is not None: exitMsg=": " + exitMsg @@ -217,7 +225,7 @@ def normalize_address(x, allow_blank=False): return x def makeContractAddress(sender, nonce): - return Web3.toHex(Web3.keccak(rlp.encode([normalize_address(sender), nonce]))[12:]) + return Web3.to_hex(Web3.keccak(rlp.encode([normalize_address(sender), nonce]))[12:]) def makeReservedEvmAddress(account): bytearr = [0xbb, 0xbb, 0xbb, 0xbb, @@ -370,7 +378,7 @@ def makeReservedEvmAddress(account): # init with 1 Million EOS for i,k in enumerate(addys): - print("addys: [{0}] [{1}] [{2}]".format(i,k[2:].lower(), len(k[2:]))) + Utils.Print("addys: [{0}] [{1}] [{2}]".format(i,k[2:].lower(), len(k[2:]))) transferAmount="1000000.0000 {0}".format(CORE_SYMBOL) Print("Transfer funds %s from account %s to %s" % (transferAmount, cluster.eosioAccount.name, evmAcc.name)) prodNode.transferFunds(cluster.eosioAccount, evmAcc, transferAmount, "0x" + k[2:].lower(), waitForTransBlock=True) @@ -389,13 +397,13 @@ def makeReservedEvmAddress(account): nonce=nonce, gas=100000, #100k Gas gasPrice=gasP, - to=Web3.toChecksumAddress(toAdd), + to=Web3.to_checksum_address(toAdd), value=amount, data=b'', chainId=evmChainId ), evmSendKey) - actData = {"miner":minerAcc.name, "rlptx":Web3.toHex(signed_trx.rawTransaction)[2:]} + actData = {"miner":minerAcc.name, "rlptx":Web3.to_hex(signed_trx.rawTransaction)[2:]} trans = prodNode.pushMessage(evmAcc.name, "pushtx", json.dumps(actData), '-p {0}'.format(minerAcc.name)) prodNode.waitForTransBlockIfNeeded(trans[1], True) @@ -415,13 +423,13 @@ def makeReservedEvmAddress(account): nonce=nonce, gas=100000, #100k Gas gasPrice=gasP, - to=Web3.toChecksumAddress(toAdd), + to=Web3.to_checksum_address(toAdd), value=amount, data=b'', chainId=evmChainId ), evmSendKey) - actData = {"miner":minerAcc.name, "rlptx":Web3.toHex(signed_trx.rawTransaction)[2:]} + actData = {"miner":minerAcc.name, "rlptx":Web3.to_hex(signed_trx.rawTransaction)[2:]} Utils.Print("Send balance again, with correct nonce") retValue = prodNode.pushMessage(evmAcc.name, "pushtx", json.dumps(actData), '-p {0}'.format(minerAcc.name), silentErrors=True) assert retValue[0], f"push trx should have succeeded: {retValue}" @@ -434,13 +442,13 @@ def makeReservedEvmAddress(account): nonce=nonce, gas=100000, #100k Gas gasPrice=gasP, - to=Web3.toChecksumAddress(toAdd), + to=Web3.to_checksum_address(toAdd), value=amount, data=b'', chainId=evmChainId ), evmSendKey) - actData = {"miner":minerAcc.name, "rlptx":Web3.toHex(signed_trx.rawTransaction)[2:]} + actData = {"miner":minerAcc.name, "rlptx":Web3.to_hex(signed_trx.rawTransaction)[2:]} Utils.Print("Send balance again, with invalid chainid") retValue = prodNode.pushMessage(evmAcc.name, "pushtx", json.dumps(actData), '-p {0}'.format(minerAcc.name), silentErrors=True) assert not retValue[0], f"push trx should have failed: {retValue}" @@ -468,11 +476,11 @@ def makeReservedEvmAddress(account): nonce=nonce, gas=1000000, #5M Gas gasPrice=gasP, - data=Web3.toBytes(hexstr='608060405234801561001057600080fd5b50610150806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80632e64cec11461003b5780636057361d14610059575b600080fd5b610043610075565b60405161005091906100a1565b60405180910390f35b610073600480360381019061006e91906100ed565b61007e565b005b60008054905090565b8060008190555050565b6000819050919050565b61009b81610088565b82525050565b60006020820190506100b66000830184610092565b92915050565b600080fd5b6100ca81610088565b81146100d557600080fd5b50565b6000813590506100e7816100c1565b92915050565b600060208284031215610103576101026100bc565b5b6000610111848285016100d8565b9150509291505056fea2646970667358fe12209ffe32fe5779018f7ee58886c856a4cfdf550f2df32cec944f57716a3abf4a5964736f6c63430008110033'), + data=Web3.to_bytes(hexstr='608060405234801561001057600080fd5b50610150806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80632e64cec11461003b5780636057361d14610059575b600080fd5b610043610075565b60405161005091906100a1565b60405180910390f35b610073600480360381019061006e91906100ed565b61007e565b005b60008054905090565b8060008190555050565b6000819050919050565b61009b81610088565b82525050565b60006020820190506100b66000830184610092565b92915050565b600080fd5b6100ca81610088565b81146100d557600080fd5b50565b6000813590506100e7816100c1565b92915050565b600060208284031215610103576101026100bc565b5b6000610111848285016100d8565b9150509291505056fea2646970667358fe12209ffe32fe5779018f7ee58886c856a4cfdf550f2df32cec944f57716a3abf4a5964736f6c63430008110033'), chainId=evmChainId ), evmSendKey) - actData = {"miner":minerAcc.name, "rlptx":Web3.toHex(signed_trx.rawTransaction)[2:]} + actData = {"miner":minerAcc.name, "rlptx":Web3.to_hex(signed_trx.rawTransaction)[2:]} retValue = prodNode.pushMessage(evmAcc.name, "pushtx", json.dumps(actData), '-p {0}'.format(minerAcc.name), silentErrors=True) assert retValue[0], f"push trx should have succeeded: {retValue}" nonce = interact_with_storage_contract(makeContractAddress(fromAdd, nonce), nonce) @@ -588,12 +596,12 @@ def makeReservedEvmAddress(account): nonce=nonce, gas=100000, #100k Gas gasPrice=gasP, - to=Web3.toChecksumAddress(toAdd), + to=Web3.to_checksum_address(toAdd), value=int(amount*10000*szabo*100), # .0001 EOS is 100 szabos data=b'', chainId=evmChainId ), evmSendKey) - actData = {"miner":minerAcc.name, "rlptx":Web3.toHex(signed_trx.rawTransaction)[2:]} + actData = {"miner":minerAcc.name, "rlptx":Web3.to_hex(signed_trx.rawTransaction)[2:]} trans = prodNode.pushMessage(evmAcc.name, "pushtx", json.dumps(actData), '-p {0}'.format(minerAcc.name), silentErrors=True) prodNode.waitForTransBlockIfNeeded(trans[1], True) row4=prodNode.getTableRow(evmAcc.name, evmAcc.name, "account", 4) # 4th balance of this integration test @@ -621,12 +629,12 @@ def makeReservedEvmAddress(account): nonce=nonce, gas=100000, #100k Gas gasPrice=gasP, - to=Web3.toChecksumAddress(toAdd), + to=Web3.to_checksum_address(toAdd), value=int(amount*10000*szabo*100), data=b'', chainId=evmChainId ), evmSendKey) - actData = {"miner":minerAcc.name, "rlptx":Web3.toHex(signed_trx.rawTransaction)[2:]} + actData = {"miner":minerAcc.name, "rlptx":Web3.to_hex(signed_trx.rawTransaction)[2:]} trans = prodNode.pushMessage(evmAcc.name, "pushtx", json.dumps(actData), '-p {0}'.format(minerAcc.name), silentErrors=True) prodNode.waitForTransBlockIfNeeded(trans[1], True) row4=prodNode.getTableRow(evmAcc.name, evmAcc.name, "account", 4) # 4th balance of this integration test @@ -653,17 +661,33 @@ def makeReservedEvmAddress(account): os.makedirs(dataDir) outFile = open(nodeStdOutDir, "w") errFile = open(nodeStdErrDir, "w") - cmd = "%s/cmd/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json=%s --chain-data=%s --verbosity=5 --nocolor=1 --plugin=rpc_plugin --eos-evm-node=127.0.0.1:8080 --http-port=0.0.0.0:8881 --api-spec=eth,debug,net,trace --chaindata=%s" % (eosEvmBuildRoot, gensisJson, dataDir, dataDir) + cmd = "%s/cmd/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json=%s --chain-data=%s --verbosity=6 --nocolor=1 --plugin=rpc_plugin --eos-evm-node=127.0.0.1:8080 --http-port=0.0.0.0:8881 --api-spec=eth,debug,net,trace --chaindata=%s" % (eosEvmBuildRoot, gensisJson, dataDir, dataDir) Utils.Print("Launching: %s" % cmd) evmNodePOpen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile) - time.sleep(10) # allow time to sync trxs + Utils.Print(f"Allow time for evm node to start and sync trxs - start {time.ctime()}") + time.sleep(60) # allow time to sync trxs + Utils.Print(f"Allow time for evm node to start and sync trxs - finish {time.ctime()}") # Validate all balances are the same on both sides rows=prodNode.getTable(evmAcc.name, evmAcc.name, "account") for row in rows['rows']: Utils.Print("Checking 0x{0} balance".format(row['eth_address'])) - r = w3.eth.get_balance(Web3.toChecksumAddress('0x'+row['eth_address'])) + r = 0 + try: + r = w3.eth.get_balance(Web3.to_checksum_address('0x'+row['eth_address'])) + except: + Utils.Print("Exception thrown - Checking 0x{0} balance".format(row['eth_address'])) + if int(row['balance'],16) != 0: + max = 0 + while r == 0 and max < 60: + time.sleep(1) + max+=1 + Utils.Print("Re-Checking 0x{0} balance".format(row['eth_address'])) + try: + r = w3.eth.get_balance(Web3.to_checksum_address('0x'+row['eth_address'])) + except: + Utils.Print("Exception thrown - Re-Checking 0x{0} balance".format(row['eth_address'])) assert r == int(row['balance'],16), f"{row['eth_address']} {r} != {int(row['balance'],16)}" foundErr = False From 950a4838e4f22367147bce4b9a88273d2a93762a Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Fri, 28 Jul 2023 15:50:54 -0500 Subject: [PATCH 20/71] sudo not installed. --- .github/workflows/node.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 15ed344..ba98b2b 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -132,7 +132,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Install CDT - run: sudo apt-get install -y ./cdt*.deb + run: apt-get install -y ./cdt*.deb - name: Download EOS EVM Contract uses: AntelopeIO/asset-artifact-download-action@v3 @@ -173,12 +173,12 @@ jobs: - name: Install Leap run: | - sudo apt-get install -y ./leap*.deb + apt-get install -y ./leap*.deb dpkg -L leap-dev | grep TestHarness dpkg -L leap | grep cleos - name: Link Leap TestHarness Module (fix for v4 of leap) - run: sudo ln -s /usr/share/leap_testing/tests/TestHarness /usr/lib/python3/dist-packages/TestHarness + run: ln -s /usr/share/leap_testing/tests/TestHarness /usr/lib/python3/dist-packages/TestHarness - name: Checkout EOS EVM Node Repo uses: actions/checkout@v3 @@ -199,8 +199,8 @@ jobs: - name: Install Test Depedencies run: | pip install --upgrade web3 - sudo apt install nodejs - sudo apt install npm + apt install nodejs + apt install npm npm install eosjs npm install ethereumjs-util npm install node-fetch From bb3925aaf7c188fe4f195bc54a264240b5b4eee6 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Fri, 28 Jul 2023 16:25:08 -0500 Subject: [PATCH 21/71] Fix typo in tar extraction. --- .github/workflows/node.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index ba98b2b..234787c 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -146,10 +146,13 @@ jobs: - name: Extract EOS EVM Contract run: | + pwd + ls mkdir contract mv contract.tar.gz contract/ cd contract - tar xvg contract.tar.gz + ls + tar xvf contract.tar.gz - name: Download leap-dev binary uses: AntelopeIO/asset-artifact-download-action@v3 @@ -194,7 +197,9 @@ jobs: - name: Extract EOS EVM Node builddir run: | - tar xfv build.tar.gz + pwd + ls + tar xvf build.tar.gz - name: Install Test Depedencies run: | From f4305c3da173f111cd22e9e62cc97a7dd04c24aa Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Sat, 29 Jul 2023 20:17:44 -0500 Subject: [PATCH 22/71] Add Update Package Index & Upgrade Packages step to itegration-test job. --- .github/workflows/node.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 234787c..38dbb08 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -121,6 +121,11 @@ jobs: DCMAKE_BUILD_TYPE: 'Release' steps: + - name: Update Package Index & Upgrade Packages + run: | + apt-get update + apt-get upgrade -y + - name: Download CDT uses: AntelopeIO/asset-artifact-download-action@v3 with: From 638e2be9b4b20f585f919c70b41782076dc4a24b Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Mon, 31 Jul 2023 06:46:09 -0500 Subject: [PATCH 23/71] Install libssl-dev directly. Trying to manually solve error installing leap deb package around unmet dependencies. --- .github/workflows/node.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 38dbb08..04edac7 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -158,7 +158,11 @@ jobs: cd contract ls tar xvf contract.tar.gz - + + - name: Leap Dependency + run: | + apt-get install -y libssl-dev + - name: Download leap-dev binary uses: AntelopeIO/asset-artifact-download-action@v3 with: From b0ee240c6f361f0efff086b1f972d27508f265c0 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Mon, 31 Jul 2023 07:47:28 -0500 Subject: [PATCH 24/71] Target Ubuntu 22.04 leap package. --- .github/workflows/node.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 04edac7..95939f7 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -159,10 +159,6 @@ jobs: ls tar xvf contract.tar.gz - - name: Leap Dependency - run: | - apt-get install -y libssl-dev - - name: Download leap-dev binary uses: AntelopeIO/asset-artifact-download-action@v3 with: @@ -180,7 +176,7 @@ jobs: owner: AntelopeIO repo: leap target: 'v4' - file: 'leap.*(x86_64|amd64).deb' + file: 'leap.*ubuntu22.04_(x86_64|amd64).deb' token: ${{ secrets.GITHUB_TOKEN }} - name: Install Leap From a72d3c4101bfeb47b0abe29b767f72fe5596cb46 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Mon, 31 Jul 2023 08:26:00 -0500 Subject: [PATCH 25/71] Try using matrix platform substitution into file regex. --- .github/workflows/node.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 95939f7..3de5c6b 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -166,7 +166,7 @@ jobs: repo: leap target: 'v4' prereleases: false - file: 'leap-dev.*(x86_64|amd64).deb' + file: 'leap-dev.*${{matrix.platform}}.*(x86_64|amd64).deb' container-package: experimental-binaries token: ${{ secrets.GITHUB_TOKEN }} @@ -176,7 +176,7 @@ jobs: owner: AntelopeIO repo: leap target: 'v4' - file: 'leap.*ubuntu22.04_(x86_64|amd64).deb' + file: 'leap.*${{matrix.platform}}.*(x86_64|amd64).deb' token: ${{ secrets.GITHUB_TOKEN }} - name: Install Leap From 103ee0b825342b8151bef63f905d4ecce4fad46e Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Mon, 31 Jul 2023 09:31:23 -0500 Subject: [PATCH 26/71] Leap v4.0.4 only currently supports ubuntu20.04. Revert change. --- .github/workflows/node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 3de5c6b..28794ec 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -166,7 +166,7 @@ jobs: repo: leap target: 'v4' prereleases: false - file: 'leap-dev.*${{matrix.platform}}.*(x86_64|amd64).deb' + file: 'leap-dev.*(x86_64|amd64).deb' container-package: experimental-binaries token: ${{ secrets.GITHUB_TOKEN }} From 19b22ae64ff70e74cc518cfc46dbff257bf00760 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Mon, 31 Jul 2023 10:10:53 -0500 Subject: [PATCH 27/71] Add Authenticate step. --- .github/workflows/node.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 28794ec..c60385b 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -188,6 +188,13 @@ jobs: - name: Link Leap TestHarness Module (fix for v4 of leap) run: ln -s /usr/share/leap_testing/tests/TestHarness /usr/lib/python3/dist-packages/TestHarness + - name: Authenticate + id: auth + uses: AntelopeIO/github-app-token-action@v1 + with: + app_id: ${{ secrets.TRUSTEVM_CI_APP_ID }} + private_key: ${{ secrets.TRUSTEVM_CI_APP_KEY }} + - name: Checkout EOS EVM Node Repo uses: actions/checkout@v3 with: From 538ff1ff9f85e36bb40e5ac9b2dba6df3feafc7e Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Mon, 31 Jul 2023 10:48:17 -0500 Subject: [PATCH 28/71] Take care of install continue prompts with auto yes. --- .github/workflows/node.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index c60385b..2c55225 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -216,8 +216,8 @@ jobs: - name: Install Test Depedencies run: | pip install --upgrade web3 - apt install nodejs - apt install npm + apt install -y nodejs + apt install -y npm npm install eosjs npm install ethereumjs-util npm install node-fetch From 0eff6a0b5a0b9d13f2869b7fe837a9c6c9c645f9 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Mon, 31 Jul 2023 11:40:53 -0500 Subject: [PATCH 29/71] Fix directory structure, test is not longer in leap. --- .github/workflows/node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 2c55225..5a5fdf3 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -234,7 +234,7 @@ jobs: run: | mkdir test_run_root cd test_run_root - ./../tests/leap/nodeos_eos_evm_test.py -v --eos-evm-contract-root ../contract/build --eos-evm-build-root ../build --use-tx-wrapper ../peripherals/tx_wrapper + ./../tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ../contract/build --eos-evm-build-root ../build --use-tx-wrapper ../peripherals/tx_wrapper - name: Prepare Logs if: failure() From 83c2039a09c549ddcaf9c89304fe7f753755063d Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Mon, 31 Jul 2023 12:19:51 -0500 Subject: [PATCH 30/71] Give test executable permissions. --- tests/nodeos_eos_evm_test.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tests/nodeos_eos_evm_test.py diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py old mode 100644 new mode 100755 From 42f88e3359a88c497c3316f1d77f7577a6dd3e04 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Mon, 31 Jul 2023 13:32:53 -0500 Subject: [PATCH 31/71] Use absolute paths instead of relative. Set up absolute paths as workflow step outputs to be reused in test invokation. --- .github/workflows/node.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 5a5fdf3..7e565c0 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -150,14 +150,19 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Extract EOS EVM Contract + id: evm-contract run: | pwd ls mkdir contract mv contract.tar.gz contract/ cd contract + pwd ls tar xvf contract.tar.gz + cd build + pwd + echo "EVM_CONTRACT=$(pwd)" >> "$GITHUB_OUTPUT" - name: Download leap-dev binary uses: AntelopeIO/asset-artifact-download-action@v3 @@ -208,10 +213,17 @@ jobs: name: build.tar.gz - name: Extract EOS EVM Node builddir + id: evm-node-build run: | pwd ls + cd peripherals + cd tx_wrapper + echo "EVM_NODE_TX_WRAPPER=$(pwd)" >> "$GITHUB_OUTPUT" + cd ../.. tar xvf build.tar.gz + cd build + echo "EVM_NODE_BUILD=$(pwd)" >> "$GITHUB_OUTPUT" - name: Install Test Depedencies run: | @@ -234,7 +246,7 @@ jobs: run: | mkdir test_run_root cd test_run_root - ./../tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ../contract/build --eos-evm-build-root ../build --use-tx-wrapper ../peripherals/tx_wrapper + ./../tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} - name: Prepare Logs if: failure() From 135c31aaa27e4d7b8badbdfb2b1f75dbe6c32839 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Mon, 31 Jul 2023 14:55:40 -0500 Subject: [PATCH 32/71] Working to debug test failure in cicd. --- .github/workflows/node.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 7e565c0..845169c 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -246,6 +246,13 @@ jobs: run: | mkdir test_run_root cd test_run_root + pwd + echo "See if contract root still looks good." + ls ${{ steps.evm-contract.outputs.EVM_CONTRACT }} + echo "See if build root still looks good." + ls ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} + echo "See if tx_wrapper still looks good." + ls ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} ./../tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} - name: Prepare Logs From 574cf3b4fa199a8e69d1ea004530781e1f9cdb74 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Mon, 31 Jul 2023 16:12:38 -0500 Subject: [PATCH 33/71] Try some relative paths to debug cicd. --- .github/workflows/node.yml | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 845169c..4d87712 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -244,15 +244,35 @@ jobs: - name: Test Leap Integration run: | + pwd + ls mkdir test_run_root + ls cd test_run_root + ls + pwd + echo "Shoule be in /__w/eos-evm-node/eos-evm-node/." + pushd .. + pwd + ls + echo "Shoule be in /__w/eos-evm-node/eos-evm-node/contract." + pushd contract pwd - echo "See if contract root still looks good." - ls ${{ steps.evm-contract.outputs.EVM_CONTRACT }} - echo "See if build root still looks good." - ls ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} - echo "See if tx_wrapper still looks good." - ls ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} + ls + echo "Shoule be in /__w/eos-evm-node/eos-evm-node/contract/build." + pushd build + pwd + ls + echo "Shoule be in /__w/eos-evm-node/eos-evm-node/test_run_root" + popd + pwd + ls + echo "Shoule be in /__w/eos-evm-node/eos-evm-node/peripherals/trx_wrapper" + popd + pushd ../peripherals/tx_wrapper + pwd + ls + popd ./../tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} - name: Prepare Logs From a3ee342765b351492f812b4bccbab639a7787f91 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Mon, 31 Jul 2023 19:25:42 -0500 Subject: [PATCH 34/71] checkout into specific path to not overwrite other checkouts. --- .github/workflows/node.yml | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 4d87712..aaa11a8 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -206,6 +206,7 @@ jobs: fetch-depth: 0 submodules: 'recursive' token: ${{ steps.auth.outputs.token }} + path: eos-evm-node - name: Download EOS EVM Node builddir uses: actions/download-artifact@v3 @@ -221,6 +222,8 @@ jobs: cd tx_wrapper echo "EVM_NODE_TX_WRAPPER=$(pwd)" >> "$GITHUB_OUTPUT" cd ../.. + mv build.tar.gz eos-node-build/ + cd eod-node-build tar xvf build.tar.gz cd build echo "EVM_NODE_BUILD=$(pwd)" >> "$GITHUB_OUTPUT" @@ -251,29 +254,13 @@ jobs: cd test_run_root ls pwd - echo "Shoule be in /__w/eos-evm-node/eos-evm-node/." - pushd .. - pwd - ls - echo "Shoule be in /__w/eos-evm-node/eos-evm-node/contract." - pushd contract - pwd - ls - echo "Shoule be in /__w/eos-evm-node/eos-evm-node/contract/build." - pushd build - pwd - ls - echo "Shoule be in /__w/eos-evm-node/eos-evm-node/test_run_root" - popd - pwd - ls - echo "Shoule be in /__w/eos-evm-node/eos-evm-node/peripherals/trx_wrapper" - popd - pushd ../peripherals/tx_wrapper - pwd - ls - popd - ./../tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} + echo "See if contract root still looks good." + ls ${{ steps.evm-contract.outputs.EVM_CONTRACT }} + echo "See if build root still looks good." + ls ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} + echo "See if tx_wrapper still looks good." + ls ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} + ./../tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} - name: Prepare Logs if: failure() From 9a40beb7cb312b7a872aa453d8d76ae20debbd22 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Mon, 31 Jul 2023 21:12:56 -0500 Subject: [PATCH 35/71] Fixing path issues. --- .github/workflows/node.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index aaa11a8..7b99c5a 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -218,12 +218,11 @@ jobs: run: | pwd ls - cd peripherals - cd tx_wrapper + pushd eos-evm-node/peripherals/tx_wrapper echo "EVM_NODE_TX_WRAPPER=$(pwd)" >> "$GITHUB_OUTPUT" - cd ../.. - mv build.tar.gz eos-node-build/ - cd eod-node-build + popd + mv build.tar.gz eos-evm-node/ + cd eos-evm-node tar xvf build.tar.gz cd build echo "EVM_NODE_BUILD=$(pwd)" >> "$GITHUB_OUTPUT" From b15eeaa666cc8b86263a24ed2c5e2fc0d6b6e296 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Tue, 1 Aug 2023 05:51:25 -0500 Subject: [PATCH 36/71] Fix path to test. --- .github/workflows/node.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 7b99c5a..08c3ec2 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -223,6 +223,7 @@ jobs: popd mv build.tar.gz eos-evm-node/ cd eos-evm-node + echo "EVM_NODE_ROOT=$(pwd)" >> "$GITHUB_OUTPUT" tar xvf build.tar.gz cd build echo "EVM_NODE_BUILD=$(pwd)" >> "$GITHUB_OUTPUT" @@ -259,7 +260,7 @@ jobs: ls ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} echo "See if tx_wrapper still looks good." ls ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} - ./../tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} + .${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }}/tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} - name: Prepare Logs if: failure() From 9b4db479d93c87f5ef48cad4137555164d2f30b6 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Tue, 1 Aug 2023 06:46:01 -0500 Subject: [PATCH 37/71] Debug node root. --- .github/workflows/node.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 08c3ec2..c6e568b 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -223,6 +223,7 @@ jobs: popd mv build.tar.gz eos-evm-node/ cd eos-evm-node + ls echo "EVM_NODE_ROOT=$(pwd)" >> "$GITHUB_OUTPUT" tar xvf build.tar.gz cd build @@ -260,6 +261,8 @@ jobs: ls ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} echo "See if tx_wrapper still looks good." ls ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} + echo "See if node root still looks good." + ls ${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }} .${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }}/tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} - name: Prepare Logs From 7eb8c6d1550197d9ec77d57451ca02a1b77e23bc Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Tue, 1 Aug 2023 08:18:54 -0500 Subject: [PATCH 38/71] CICD test still not found. Debugging. --- .github/workflows/node.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index c6e568b..3377354 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -263,7 +263,9 @@ jobs: ls ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} echo "See if node root still looks good." ls ${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }} - .${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }}/tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} + echo "See if node root tests still looks good." + ls ${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }}/tests + ${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }}/tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} - name: Prepare Logs if: failure() From 10e2319cf954f8bcbab45b763d1ff76884e42716 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Tue, 1 Aug 2023 09:05:29 -0500 Subject: [PATCH 39/71] Remove unnecessary object files from build dir artifact. --- .github/workflows/build-node.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-node.sh b/.github/workflows/build-node.sh index 2df4993..e3f986d 100755 --- a/.github/workflows/build-node.sh +++ b/.github/workflows/build-node.sh @@ -21,6 +21,6 @@ ee make -j "$(nproc)" # pack ee popd -ee 'tar -czf build.tar.gz build/*' +ee 'tar -czf --exclude "*.o" build.tar.gz build/*' echo "Done! - ${0##*/}" From 162a96e04bad61f8ffd60cf061dce726aa7a56a6 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Tue, 1 Aug 2023 09:06:35 -0500 Subject: [PATCH 40/71] Move EOS EVM Contract step after cdt and leap steps. --- .github/workflows/node.yml | 50 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 3377354..780569d 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -139,31 +139,6 @@ jobs: - name: Install CDT run: apt-get install -y ./cdt*.deb - - name: Download EOS EVM Contract - uses: AntelopeIO/asset-artifact-download-action@v3 - with: - owner: eosnetworkfoundation - repo: eos-evm - target: 'main' - file: 'contract.tar.gz' - artifact-name: contract.test-actions-off.tar.gz - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract EOS EVM Contract - id: evm-contract - run: | - pwd - ls - mkdir contract - mv contract.tar.gz contract/ - cd contract - pwd - ls - tar xvf contract.tar.gz - cd build - pwd - echo "EVM_CONTRACT=$(pwd)" >> "$GITHUB_OUTPUT" - - name: Download leap-dev binary uses: AntelopeIO/asset-artifact-download-action@v3 with: @@ -193,6 +168,31 @@ jobs: - name: Link Leap TestHarness Module (fix for v4 of leap) run: ln -s /usr/share/leap_testing/tests/TestHarness /usr/lib/python3/dist-packages/TestHarness + - name: Download EOS EVM Contract + uses: AntelopeIO/asset-artifact-download-action@v3 + with: + owner: eosnetworkfoundation + repo: eos-evm + target: 'main' + file: 'contract.tar.gz' + artifact-name: contract.test-actions-off.tar.gz + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract EOS EVM Contract + id: evm-contract + run: | + pwd + ls + mkdir contract + mv contract.tar.gz contract/ + cd contract + pwd + ls + tar xvf contract.tar.gz + cd build + pwd + echo "EVM_CONTRACT=$(pwd)" >> "$GITHUB_OUTPUT" + - name: Authenticate id: auth uses: AntelopeIO/github-app-token-action@v1 From a849bba077fcf0c86ef66c9cb9a6dbe62df50d22 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Tue, 1 Aug 2023 09:07:27 -0500 Subject: [PATCH 41/71] Fix evm-contract step name. --- .github/workflows/node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 780569d..ea91d88 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -265,7 +265,7 @@ jobs: ls ${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }} echo "See if node root tests still looks good." ls ${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }}/tests - ${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }}/tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} + ${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }}/tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} - name: Prepare Logs if: failure() From b9f60d1d577ade1367e3e580161739be72586c6f Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Tue, 1 Aug 2023 09:42:01 -0500 Subject: [PATCH 42/71] Fix exclude in tar step. --- .github/workflows/build-node.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-node.sh b/.github/workflows/build-node.sh index e3f986d..1af8f7c 100755 --- a/.github/workflows/build-node.sh +++ b/.github/workflows/build-node.sh @@ -21,6 +21,6 @@ ee make -j "$(nproc)" # pack ee popd -ee 'tar -czf --exclude "*.o" build.tar.gz build/*' +ee 'tar -czf build.tar.gz --exclude="*.o" build/*' echo "Done! - ${0##*/}" From d2f4a5736923fd30576a89e559ca578292116607 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Tue, 1 Aug 2023 10:26:37 -0500 Subject: [PATCH 43/71] Give test more time yet to see how long it takes, if it succeeds. --- tests/nodeos_eos_evm_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index 0c34f62..33afd62 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -680,7 +680,7 @@ def makeReservedEvmAddress(account): Utils.Print("Exception thrown - Checking 0x{0} balance".format(row['eth_address'])) if int(row['balance'],16) != 0: max = 0 - while r == 0 and max < 60: + while r == 0 and max < 600: time.sleep(1) max+=1 Utils.Print("Re-Checking 0x{0} balance".format(row['eth_address'])) From 224b6e5a2bb11d7a36440344e481f84414ba876a Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Tue, 1 Aug 2023 13:22:44 -0500 Subject: [PATCH 44/71] Add tests and peripherals into the build. Having tests and peripherals in the build allows simply downloading the archived build artifact and having everything necessary to run integration tests. Update node.yaml workflow for using only the build artifact. It no longer needs to clone the eos-evm-node repository. --- .github/workflows/node.yml | 29 ++++--------------- CMakeLists.txt | 2 ++ peripherals/CMakeLists.txt | 1 + peripherals/tx_wrapper/CMakeLists.txt | 4 +++ tests/CMakeLists.txt | 5 ++++ tests/nodeos_eos_evm_server/CMakeLists.txt | 7 +++++ .../contracts/CMakeLists.txt | 9 ++++++ .../scripts/CMakeLists.txt | 7 +++++ 8 files changed, 40 insertions(+), 24 deletions(-) create mode 100644 peripherals/CMakeLists.txt create mode 100644 peripherals/tx_wrapper/CMakeLists.txt create mode 100644 tests/CMakeLists.txt create mode 100644 tests/nodeos_eos_evm_server/CMakeLists.txt create mode 100644 tests/nodeos_eos_evm_server/contracts/CMakeLists.txt create mode 100644 tests/nodeos_eos_evm_server/scripts/CMakeLists.txt diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index ea91d88..27f5c00 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -200,14 +200,6 @@ jobs: app_id: ${{ secrets.TRUSTEVM_CI_APP_ID }} private_key: ${{ secrets.TRUSTEVM_CI_APP_KEY }} - - name: Checkout EOS EVM Node Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: 'recursive' - token: ${{ steps.auth.outputs.token }} - path: eos-evm-node - - name: Download EOS EVM Node builddir uses: actions/download-artifact@v3 with: @@ -216,18 +208,13 @@ jobs: - name: Extract EOS EVM Node builddir id: evm-node-build run: | - pwd - ls - pushd eos-evm-node/peripherals/tx_wrapper - echo "EVM_NODE_TX_WRAPPER=$(pwd)" >> "$GITHUB_OUTPUT" - popd + mkdir eos-evm-node mv build.tar.gz eos-evm-node/ - cd eos-evm-node - ls - echo "EVM_NODE_ROOT=$(pwd)" >> "$GITHUB_OUTPUT" + pushd eos-evm-node tar xvf build.tar.gz - cd build + pushd build echo "EVM_NODE_BUILD=$(pwd)" >> "$GITHUB_OUTPUT" + popd - name: Install Test Depedencies run: | @@ -259,13 +246,7 @@ jobs: ls ${{ steps.evm-contract.outputs.EVM_CONTRACT }} echo "See if build root still looks good." ls ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} - echo "See if tx_wrapper still looks good." - ls ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} - echo "See if node root still looks good." - ls ${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }} - echo "See if node root tests still looks good." - ls ${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }}/tests - ${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }}/tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} + ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/peripherals/tx_wrapper - name: Prepare Logs if: failure() diff --git a/CMakeLists.txt b/CMakeLists.txt index eac606a..9354013 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,3 +29,5 @@ endif() add_subdirectory(external) add_subdirectory(version) add_subdirectory(src) +add_subdirectory(peripherals) +add_subdirectory(tests) diff --git a/peripherals/CMakeLists.txt b/peripherals/CMakeLists.txt new file mode 100644 index 0000000..73fa698 --- /dev/null +++ b/peripherals/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory( tx_wrapper ) \ No newline at end of file diff --git a/peripherals/tx_wrapper/CMakeLists.txt b/peripherals/tx_wrapper/CMakeLists.txt new file mode 100644 index 0000000..2bbd2e3 --- /dev/null +++ b/peripherals/tx_wrapper/CMakeLists.txt @@ -0,0 +1,4 @@ +configure_file( index.js . COPYONLY ) +configure_file( package-lock.json . COPYONLY ) +configure_file( package.json . COPYONLY ) +configure_file( yarn.lock . COPYONLY ) \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..cb905e4 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,5 @@ +add_subdirectory( nodeos_eos_evm_server ) + +configure_file(antelope_name.py . COPYONLY) +configure_file(nodeos_eos_evm_server.py . COPYONLY) +configure_file(nodeos_eos_evm_test.py . COPYONLY) \ No newline at end of file diff --git a/tests/nodeos_eos_evm_server/CMakeLists.txt b/tests/nodeos_eos_evm_server/CMakeLists.txt new file mode 100644 index 0000000..9615f79 --- /dev/null +++ b/tests/nodeos_eos_evm_server/CMakeLists.txt @@ -0,0 +1,7 @@ +add_subdirectory( contracts ) +add_subdirectory( scripts ) + +configure_file( extract-logtime-cmd.sh . COPYONLY ) +configure_file( hardhat.config.js . COPYONLY ) +configure_file( package.json . COPYONLY ) +configure_file( yarn.lock . COPYONLY ) \ No newline at end of file diff --git a/tests/nodeos_eos_evm_server/contracts/CMakeLists.txt b/tests/nodeos_eos_evm_server/contracts/CMakeLists.txt new file mode 100644 index 0000000..cddeb1e --- /dev/null +++ b/tests/nodeos_eos_evm_server/contracts/CMakeLists.txt @@ -0,0 +1,9 @@ +configure_file( BlockNum.sol . COPYONLY ) +configure_file( Blockhash.sol . COPYONLY ) +configure_file( CMakeLists.txt . COPYONLY ) +configure_file( Eventor.sol . COPYONLY ) +configure_file( Lock.sol . COPYONLY ) +configure_file( Recursive.sol . COPYONLY ) +configure_file( Storage.sol . COPYONLY ) +configure_file( Token.sol . COPYONLY ) +configure_file( WEOS.sol . COPYONLY ) \ No newline at end of file diff --git a/tests/nodeos_eos_evm_server/scripts/CMakeLists.txt b/tests/nodeos_eos_evm_server/scripts/CMakeLists.txt new file mode 100644 index 0000000..89b2a76 --- /dev/null +++ b/tests/nodeos_eos_evm_server/scripts/CMakeLists.txt @@ -0,0 +1,7 @@ +configure_file( deploy-blockhash.js . COPYONLY ) +configure_file( deploy-blocknum.js . COPYONLY ) +configure_file( deploy-eventor.js . COPYONLY ) +configure_file( deploy-recursive.js . COPYONLY ) +configure_file( deploy-token.js . COPYONLY ) +configure_file( deploy-uniswap.js . COPYONLY ) +configure_file( deploy.js . COPYONLY ) \ No newline at end of file From 412eaa7de077b836c4ae851b80e1ee24d882ec44 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Tue, 1 Aug 2023 14:45:51 -0500 Subject: [PATCH 45/71] eos-evm-node executable is no longer in cmd but is still in src in the build. --- tests/nodeos_eos_evm_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index 33afd62..59f996c 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -661,7 +661,7 @@ def makeReservedEvmAddress(account): os.makedirs(dataDir) outFile = open(nodeStdOutDir, "w") errFile = open(nodeStdErrDir, "w") - cmd = "%s/cmd/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json=%s --chain-data=%s --verbosity=6 --nocolor=1 --plugin=rpc_plugin --eos-evm-node=127.0.0.1:8080 --http-port=0.0.0.0:8881 --api-spec=eth,debug,net,trace --chaindata=%s" % (eosEvmBuildRoot, gensisJson, dataDir, dataDir) + cmd = "%s/src/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json=%s --chain-data=%s --verbosity=6 --nocolor=1 --plugin=rpc_plugin --eos-evm-node=127.0.0.1:8080 --http-port=0.0.0.0:8881 --api-spec=eth,debug,net,trace --chaindata=%s" % (eosEvmBuildRoot, gensisJson, dataDir, dataDir) Utils.Print("Launching: %s" % cmd) evmNodePOpen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile) From 1886713cc4e7f10580294cb64f5218b81474868a Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Tue, 1 Aug 2023 16:22:19 -0500 Subject: [PATCH 46/71] Update eos-evm-node arguments. --- tests/nodeos_eos_evm_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index 59f996c..51bcac9 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -661,7 +661,7 @@ def makeReservedEvmAddress(account): os.makedirs(dataDir) outFile = open(nodeStdOutDir, "w") errFile = open(nodeStdErrDir, "w") - cmd = "%s/src/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json=%s --chain-data=%s --verbosity=6 --nocolor=1 --plugin=rpc_plugin --eos-evm-node=127.0.0.1:8080 --http-port=0.0.0.0:8881 --api-spec=eth,debug,net,trace --chaindata=%s" % (eosEvmBuildRoot, gensisJson, dataDir, dataDir) + cmd = "%s/src/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json=%s --chain-data=%s --verbosity=6 --nocolor=1 --plugin=rpc_plugin --engine-port=127.0.0.1:8080 --chain-data=%s" % (eosEvmBuildRoot, gensisJson, dataDir, dataDir) Utils.Print("Launching: %s" % cmd) evmNodePOpen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile) From 3bdced9752b245ff5955fe19ba6251030708e61e Mon Sep 17 00:00:00 2001 From: Areg Hayrapetian Date: Tue, 1 Aug 2023 19:11:08 -0700 Subject: [PATCH 47/71] Update supported Ubuntu and gcc versions in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index db97544..f414fe9 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ git submodule update --init --recursive ### compile eos-evm-node, eos-evm-rpc Prerequisites: -- Ubuntu 20 or later or other compatible Linux -- gcc 10 or later +- Ubuntu 22 or later or other compatible Linux +- gcc 11 or later Easy Steps: ``` From 1923dc02293dc75c703762f7c752654aeb8b466d Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 09:35:45 -0500 Subject: [PATCH 48/71] Need to update test for split of eos-evm-node and eos-evm-rpc and launch an eos-evm-rpc. Also add error checking for the eos-evm-rpc logs and killing of the process at end of test. --- tests/nodeos_eos_evm_test.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index 51bcac9..d2de302 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -661,14 +661,23 @@ def makeReservedEvmAddress(account): os.makedirs(dataDir) outFile = open(nodeStdOutDir, "w") errFile = open(nodeStdErrDir, "w") - cmd = "%s/src/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json=%s --chain-data=%s --verbosity=6 --nocolor=1 --plugin=rpc_plugin --engine-port=127.0.0.1:8080 --chain-data=%s" % (eosEvmBuildRoot, gensisJson, dataDir, dataDir) - Utils.Print("Launching: %s" % cmd) + cmd = f"{eosEvmBuildRoot}/src/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json={gensisJson} --verbosity=6 --nocolor=1 --chain-data={dataDir}" + Utils.Print(f"Launching: {cmd}") evmNodePOpen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile) Utils.Print(f"Allow time for evm node to start and sync trxs - start {time.ctime()}") - time.sleep(60) # allow time to sync trxs + time.sleep(20) # allow time to sync trxs Utils.Print(f"Allow time for evm node to start and sync trxs - finish {time.ctime()}") + # Launch eos-evm-rpc + rpcStdOutDir = dataDir + "/eos-evm-rpc.stdout" + rpcStdErrDir = dataDir + "/eos-evm-rpc.stderr" + outFile = open(rpcStdOutDir, "w") + errFile = open(rpcStdErrDir, "w") + cmd = f"{eosEvmBuildRoot}/src/eos-evm-rpc --eos-evm-node=127.0.0.1:8080 --http-port=0.0.0.0:8881 --chaindata={dataDir} --api-spec=eth,debug,net,trace" + Utils.Print(f"Launching: {cmd}") + evmRPCPOpen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile) + # Validate all balances are the same on both sides rows=prodNode.getTable(evmAcc.name, evmAcc.name, "account") for row in rows['rows']: @@ -695,7 +704,14 @@ def makeReservedEvmAddress(account): lines = stdErrFile.readlines() for line in lines: if line.find("ERROR") != -1 or line.find("CRIT") != -1: - Utils.Print(" Found ERROR in EOS EVM log: ", line) + Utils.Print(" Found ERROR in EOS EVM NODE log: ", line) + foundErr = True + + stdErrFile = open(rpcStdErrDir, "r") + lines = stdErrFile.readlines() + for line in lines: + if line.find("ERROR") != -1 or line.find("CRIT") != -1: + Utils.Print(" Found ERROR in EOS EVM RPC log: ", line) foundErr = True testSuccessful= not foundErr @@ -704,6 +720,8 @@ def makeReservedEvmAddress(account): if killEosInstances: if evmNodePOpen is not None: evmNodePOpen.kill() + if evmRPCPOpen is not None: + evmRPCPOpen.kill() if txWrapPOpen is not None: txWrapPOpen.kill() From 51fbcc8eadb4ac0a0f2ccacf296d4d67a03b4532 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 09:36:16 -0500 Subject: [PATCH 49/71] Fix genesis spelling. --- tests/nodeos_eos_evm_test.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index d2de302..36dd721 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -84,7 +84,7 @@ killAll=args.clean_run eosEvmContractRoot=args.eos_evm_contract_root eosEvmBuildRoot=args.eos_evm_build_root -gensisJson=args.genesis_json +genesisJson=args.genesis_json useTrxWrapper=args.use_tx_wrapper assert eosEvmContractRoot is not None, "--eos-evm-contract-root is required" @@ -485,16 +485,16 @@ def makeReservedEvmAddress(account): assert retValue[0], f"push trx should have succeeded: {retValue}" nonce = interact_with_storage_contract(makeContractAddress(fromAdd, nonce), nonce) - if gensisJson[0] != '/': gensisJson = os.path.realpath(gensisJson) - f=open(gensisJson,"w") + if genesisJson[0] != '/': genesisJson = os.path.realpath(genesisJson) + f=open(genesisJson,"w") f.write(json.dumps(genesis_info)) f.close() Utils.Print("#####################################################") - Utils.Print("Generated EVM json genesis file in: %s" % gensisJson) + Utils.Print("Generated EVM json genesis file in: %s" % genesisJson) Utils.Print("") Utils.Print("You can now run:") - Utils.Print(" eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json=%s --chain-data=/tmp/data --verbosity=5" % gensisJson) + Utils.Print(" eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json=%s --chain-data=/tmp/data --verbosity=5" % genesisJson) Utils.Print(" eos-evm-rpc --eos-evm-node=127.0.0.1:8080 --http-port=0.0.0.0:8881 --chaindata=/tmp/data --api-spec=eth,debug,net,trace") Utils.Print("") @@ -661,7 +661,7 @@ def makeReservedEvmAddress(account): os.makedirs(dataDir) outFile = open(nodeStdOutDir, "w") errFile = open(nodeStdErrDir, "w") - cmd = f"{eosEvmBuildRoot}/src/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json={gensisJson} --verbosity=6 --nocolor=1 --chain-data={dataDir}" + cmd = f"{eosEvmBuildRoot}/src/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json={genesisJson} --verbosity=6 --nocolor=1 --chain-data={dataDir}" Utils.Print(f"Launching: {cmd}") evmNodePOpen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile) From 0c86e4245ab098e7ae0d03167446dfbba688cec8 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 10:42:01 -0500 Subject: [PATCH 50/71] Workflow and test cleanup. --- .github/workflows/node.yml | 21 --------------------- tests/nodeos_eos_evm_test.py | 20 ++++---------------- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 27f5c00..b90833e 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -162,8 +162,6 @@ jobs: - name: Install Leap run: | apt-get install -y ./leap*.deb - dpkg -L leap-dev | grep TestHarness - dpkg -L leap | grep cleos - name: Link Leap TestHarness Module (fix for v4 of leap) run: ln -s /usr/share/leap_testing/tests/TestHarness /usr/lib/python3/dist-packages/TestHarness @@ -181,16 +179,11 @@ jobs: - name: Extract EOS EVM Contract id: evm-contract run: | - pwd - ls mkdir contract mv contract.tar.gz contract/ cd contract - pwd - ls tar xvf contract.tar.gz cd build - pwd echo "EVM_CONTRACT=$(pwd)" >> "$GITHUB_OUTPUT" - name: Authenticate @@ -228,24 +221,10 @@ jobs: npm install dotenv npm install is-valid-hostname - - name: Check Depedency Versions - run: | - pip show web3 - node --version - - name: Test Leap Integration run: | - pwd - ls mkdir test_run_root - ls cd test_run_root - ls - pwd - echo "See if contract root still looks good." - ls ${{ steps.evm-contract.outputs.EVM_CONTRACT }} - echo "See if build root still looks good." - ls ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/peripherals/tx_wrapper - name: Prepare Logs diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index 36dd721..75a88dd 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -59,7 +59,6 @@ # ~/eos-evm/tests/leap/nodeos_eos_evm_test.py --eos-evm-contract-root ~/eos-evm/contract/build --eos-evm-build-root ~/eos-evm/build --use-tx-wrapper ~/eos-evm/peripherals/tx_wrapper --leave-running # # Example (Running with leap dev-install): -# export PYTHONPATH=/lib/python3/dist-packages # ~/eos-evm/tests/leap/nodeos_eos_evm_test.py --eos-evm-contract-root ~/eos-evm/contract/build --eos-evm-build-root ~/eos-evm/build --use-tx-wrapper ~/eos-evm/peripherals/tx_wrapper --leave-running # # Launches wallet at port: 9899 @@ -661,13 +660,11 @@ def makeReservedEvmAddress(account): os.makedirs(dataDir) outFile = open(nodeStdOutDir, "w") errFile = open(nodeStdErrDir, "w") - cmd = f"{eosEvmBuildRoot}/src/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json={genesisJson} --verbosity=6 --nocolor=1 --chain-data={dataDir}" + cmd = f"{eosEvmBuildRoot}/src/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json={genesisJson} --verbosity=5 --nocolor=1 --chain-data={dataDir}" Utils.Print(f"Launching: {cmd}") evmNodePOpen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile) - Utils.Print(f"Allow time for evm node to start and sync trxs - start {time.ctime()}") - time.sleep(20) # allow time to sync trxs - Utils.Print(f"Allow time for evm node to start and sync trxs - finish {time.ctime()}") + time.sleep(10) # allow time to sync trxs # Launch eos-evm-rpc rpcStdOutDir = dataDir + "/eos-evm-rpc.stdout" @@ -686,17 +683,8 @@ def makeReservedEvmAddress(account): try: r = w3.eth.get_balance(Web3.to_checksum_address('0x'+row['eth_address'])) except: - Utils.Print("Exception thrown - Checking 0x{0} balance".format(row['eth_address'])) - if int(row['balance'],16) != 0: - max = 0 - while r == 0 and max < 600: - time.sleep(1) - max+=1 - Utils.Print("Re-Checking 0x{0} balance".format(row['eth_address'])) - try: - r = w3.eth.get_balance(Web3.to_checksum_address('0x'+row['eth_address'])) - except: - Utils.Print("Exception thrown - Re-Checking 0x{0} balance".format(row['eth_address'])) + Utils.Print("ERROR - RPC endpoint not available - Exception thrown - Checking 0x{0} balance".format(row['eth_address'])) + raise assert r == int(row['balance'],16), f"{row['eth_address']} {r} != {int(row['balance'],16)}" foundErr = False From 8dbc1120694fd0b611d13c2533fe15bc51ba1921 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 10:47:54 -0500 Subject: [PATCH 51/71] Update notes on running test. --- tests/nodeos_eos_evm_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index 75a88dd..f88a84f 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -56,10 +56,11 @@ # # Example (Running with leap src build): # cd ~/leap/build -# ~/eos-evm/tests/leap/nodeos_eos_evm_test.py --eos-evm-contract-root ~/eos-evm/contract/build --eos-evm-build-root ~/eos-evm/build --use-tx-wrapper ~/eos-evm/peripherals/tx_wrapper --leave-running +# ~/eos-evm-node/build/tests/nodeos_eos_evm_test.py --eos-evm-contract-root ~/eos-evm/build --eos-evm-build-root ~/eos-evm-node/build --use-tx-wrapper ~/eos-evm-node/build/peripherals/tx_wrapper --leave-running # # Example (Running with leap dev-install): -# ~/eos-evm/tests/leap/nodeos_eos_evm_test.py --eos-evm-contract-root ~/eos-evm/contract/build --eos-evm-build-root ~/eos-evm/build --use-tx-wrapper ~/eos-evm/peripherals/tx_wrapper --leave-running +# ln -s /usr/share/leap_testing/tests/TestHarness /usr/lib/python3/dist-packages/TestHarness +# ~/eos-evm-node/build/tests/nodeos_eos_evm_test.py --eos-evm-contract-root ~/eos-evm/build --eos-evm-build-root ~/eos-evm-node/build --use-tx-wrapper ~/eos-evm-node/build/peripherals/tx_wrapper --leave-running # # Launches wallet at port: 9899 # Example: bin/cleos --wallet-url http://127.0.0.1:9899 ... From cf5d57c060e10f97d14699de369da8723a81d1cf Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 10:50:22 -0500 Subject: [PATCH 52/71] Copy eos-evm-node and eos-evm-rpc executables into the bin directory during build. --- CMakeLists.txt | 3 +++ CMakeModules/utils.cmake | 4 ++++ README.md | 4 ++-- src/CMakeLists.txt | 5 ++++- tests/nodeos_eos_evm_server/PERFORMANCE.md | 4 ++-- tests/nodeos_eos_evm_test.py | 4 ++-- 6 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 CMakeModules/utils.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 9354013..640a82e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,10 @@ cmake_minimum_required(VERSION 3.16.2) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") + include(cmake/cable/bootstrap.cmake) include(CableBuildType) +include(utils) cable_set_build_type(DEFAULT Release CONFIGURATION_TYPES Release Debug) if(NOT CMAKE_TOOLCHAIN_FILE) diff --git a/CMakeModules/utils.cmake b/CMakeModules/utils.cmake new file mode 100644 index 0000000..d0d5528 --- /dev/null +++ b/CMakeModules/utils.cmake @@ -0,0 +1,4 @@ +macro( copy_bin file ) + add_custom_command( TARGET ${file} POST_BUILD COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin ) + add_custom_command( TARGET ${file} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${file}${CMAKE_EXECUTABLE_SUFFIX} ${CMAKE_BINARY_DIR}/bin/ ) +endmacro( copy_bin ) diff --git a/README.md b/README.md index db97544..a993a69 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,8 @@ make -j8 ``` You'll get the list of binaries with other tools: ``` -src/eos-evm-node -src/eos-evm-rpc +bin/eos-evm-node +bin/eos-evm-rpc ``` Alternatively, to build with specific compiler: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7e1bbd4..a3e949b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,4 +30,7 @@ target_link_libraries(eos-evm-node PRIVATE appbase abieos sys_plugin engine_plug add_executable(eos-evm-rpc eos-evm-rpc.cpp) target_include_directories(eos-evm-rpc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries(eos-evm-rpc PRIVATE appbase abieos sys_plugin rpc_plugin boost_filesystem version) \ No newline at end of file +target_link_libraries(eos-evm-rpc PRIVATE appbase abieos sys_plugin rpc_plugin boost_filesystem version) + +copy_bin( eos-evm-node ) +copy_bin( eos-evm-rpc ) diff --git a/tests/nodeos_eos_evm_server/PERFORMANCE.md b/tests/nodeos_eos_evm_server/PERFORMANCE.md index 374fef1..c2a35c9 100644 --- a/tests/nodeos_eos_evm_server/PERFORMANCE.md +++ b/tests/nodeos_eos_evm_server/PERFORMANCE.md @@ -68,14 +68,14 @@ cd .. ### Launch eos-evm-node ``` -cd ~/evmperf/eos-evm/build/cmd +cd ~/evmperf/eos-evm/build/bin rm -rf chaindata etl-temp config-dir ./eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json=$HOME/evmperf/leap/build/eos-evm-genesis.json --verbosity=4 ``` ### Launch eos-evm-rpc ``` -cd ~/evmperf/eos-evm/build/cmd +cd ~/evmperf/eos-evm/build/bin ./eos-evm-rpc --eos-evm-node=127.0.0.1:8080 --http-port=0.0.0.0:8881 --chaindata=./ --api-spec=eth,debug,net,trace --verbosity=4 ``` diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index f88a84f..534554b 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -661,7 +661,7 @@ def makeReservedEvmAddress(account): os.makedirs(dataDir) outFile = open(nodeStdOutDir, "w") errFile = open(nodeStdErrDir, "w") - cmd = f"{eosEvmBuildRoot}/src/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json={genesisJson} --verbosity=5 --nocolor=1 --chain-data={dataDir}" + cmd = f"{eosEvmBuildRoot}/bin/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json={genesisJson} --verbosity=5 --nocolor=1 --chain-data={dataDir}" Utils.Print(f"Launching: {cmd}") evmNodePOpen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile) @@ -672,7 +672,7 @@ def makeReservedEvmAddress(account): rpcStdErrDir = dataDir + "/eos-evm-rpc.stderr" outFile = open(rpcStdOutDir, "w") errFile = open(rpcStdErrDir, "w") - cmd = f"{eosEvmBuildRoot}/src/eos-evm-rpc --eos-evm-node=127.0.0.1:8080 --http-port=0.0.0.0:8881 --chaindata={dataDir} --api-spec=eth,debug,net,trace" + cmd = f"{eosEvmBuildRoot}/bin/eos-evm-rpc --eos-evm-node=127.0.0.1:8080 --http-port=0.0.0.0:8881 --chaindata={dataDir} --api-spec=eth,debug,net,trace" Utils.Print(f"Launching: {cmd}") evmRPCPOpen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile) From cdbb6e6030a6b941c343fee76a382e1a03aba74d Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 10:57:30 -0500 Subject: [PATCH 53/71] Fix no newline at end of file. --- .github/workflows/node.yml | 1 - peripherals/CMakeLists.txt | 2 +- peripherals/tx_wrapper/CMakeLists.txt | 2 +- tests/nodeos_eos_evm_server/CMakeLists.txt | 2 +- tests/nodeos_eos_evm_server/contracts/CMakeLists.txt | 2 +- tests/nodeos_eos_evm_server/scripts/CMakeLists.txt | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index b90833e..327c1fb 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -238,4 +238,3 @@ jobs: with: name: leap-int-test-logs.tar.gz path: leap-int-test-logs.tar.gz - \ No newline at end of file diff --git a/peripherals/CMakeLists.txt b/peripherals/CMakeLists.txt index 73fa698..f5e2e2f 100644 --- a/peripherals/CMakeLists.txt +++ b/peripherals/CMakeLists.txt @@ -1 +1 @@ -add_subdirectory( tx_wrapper ) \ No newline at end of file +add_subdirectory( tx_wrapper ) diff --git a/peripherals/tx_wrapper/CMakeLists.txt b/peripherals/tx_wrapper/CMakeLists.txt index 2bbd2e3..76b1597 100644 --- a/peripherals/tx_wrapper/CMakeLists.txt +++ b/peripherals/tx_wrapper/CMakeLists.txt @@ -1,4 +1,4 @@ configure_file( index.js . COPYONLY ) configure_file( package-lock.json . COPYONLY ) configure_file( package.json . COPYONLY ) -configure_file( yarn.lock . COPYONLY ) \ No newline at end of file +configure_file( yarn.lock . COPYONLY ) diff --git a/tests/nodeos_eos_evm_server/CMakeLists.txt b/tests/nodeos_eos_evm_server/CMakeLists.txt index 9615f79..d91d8b4 100644 --- a/tests/nodeos_eos_evm_server/CMakeLists.txt +++ b/tests/nodeos_eos_evm_server/CMakeLists.txt @@ -4,4 +4,4 @@ add_subdirectory( scripts ) configure_file( extract-logtime-cmd.sh . COPYONLY ) configure_file( hardhat.config.js . COPYONLY ) configure_file( package.json . COPYONLY ) -configure_file( yarn.lock . COPYONLY ) \ No newline at end of file +configure_file( yarn.lock . COPYONLY ) diff --git a/tests/nodeos_eos_evm_server/contracts/CMakeLists.txt b/tests/nodeos_eos_evm_server/contracts/CMakeLists.txt index cddeb1e..ee09993 100644 --- a/tests/nodeos_eos_evm_server/contracts/CMakeLists.txt +++ b/tests/nodeos_eos_evm_server/contracts/CMakeLists.txt @@ -6,4 +6,4 @@ configure_file( Lock.sol . COPYONLY ) configure_file( Recursive.sol . COPYONLY ) configure_file( Storage.sol . COPYONLY ) configure_file( Token.sol . COPYONLY ) -configure_file( WEOS.sol . COPYONLY ) \ No newline at end of file +configure_file( WEOS.sol . COPYONLY ) diff --git a/tests/nodeos_eos_evm_server/scripts/CMakeLists.txt b/tests/nodeos_eos_evm_server/scripts/CMakeLists.txt index 89b2a76..788c5e4 100644 --- a/tests/nodeos_eos_evm_server/scripts/CMakeLists.txt +++ b/tests/nodeos_eos_evm_server/scripts/CMakeLists.txt @@ -4,4 +4,4 @@ configure_file( deploy-eventor.js . COPYONLY ) configure_file( deploy-recursive.js . COPYONLY ) configure_file( deploy-token.js . COPYONLY ) configure_file( deploy-uniswap.js . COPYONLY ) -configure_file( deploy.js . COPYONLY ) \ No newline at end of file +configure_file( deploy.js . COPYONLY ) From ef8d9cc2bb629ef25995d058a771537417dac2bd Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 13:44:22 -0500 Subject: [PATCH 54/71] Add configurability to workflow for leap, leap-dev, cdt, and eos-evm-contract artifact acquisition. --- .cicd/defaults.json | 18 ++++++++ .github/workflows/node.yml | 95 +++++++++++++++++++++++++++++++++++--- 2 files changed, 107 insertions(+), 6 deletions(-) create mode 100644 .cicd/defaults.json diff --git a/.cicd/defaults.json b/.cicd/defaults.json new file mode 100644 index 0000000..258ba4e --- /dev/null +++ b/.cicd/defaults.json @@ -0,0 +1,18 @@ +{ + "leap-dev":{ + "target":"4", + "prerelease":false + }, + "leap":{ + "target":"4", + "prerelease":false + }, + "cdt":{ + "target":"3.1.0", + "prerelease":false + }, + "eos-evm-contract":{ + "target":"main", + "prerelease":false + } +} diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 327c1fb..7c85efd 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -7,6 +7,47 @@ on: - release/* pull_request: workflow_dispatch: + inputs: + override-leap-dev: + description: Override leap-dev target + type: string + override-leap-dev-prerelease: + type: choice + description: Override leap-dev prelease + options: + - default + - true + - false + override-leap: + description: Override leap target + type: string + override-leap-prerelease: + type: choice + description: Override leap prelease + options: + - default + - true + - false + override-cdt: + description: 'Override cdt target' + type: string + override-cdt-prerelease: + type: choice + description: Override cdt prelease + options: + - default + - true + - false + override-eos-evm-contract: + description: 'Override eos-evm-contract target' + type: string + override-eos-evm-contract-prerelease: + type: choice + description: Override eos-evm-contract prelease + options: + - default + - true + - false defaults: run: @@ -121,6 +162,46 @@ jobs: DCMAKE_BUILD_TYPE: 'Release' steps: + - name: Setup leap-dev & cdt versions + id: versions + env: + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + run: | + DEFAULTS_JSON=$(curl -sSfL $(gh api https://api.github.com/repos/${{github.repository}}/contents/.cicd/defaults.json?ref=${{github.sha}} --jq .download_url)) + echo leap-dev-target=$(echo "$DEFAULTS_JSON" | jq -r '."leap-dev".target') >> $GITHUB_OUTPUT + echo leap-dev-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '."leap-dev".prerelease') >> $GITHUB_OUTPUT + echo leap-target=$(echo "$DEFAULTS_JSON" | jq -r '."leap".target') >> $GITHUB_OUTPUT + echo leap-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '."leap".prerelease') >> $GITHUB_OUTPUT + echo cdt-target=$(echo "$DEFAULTS_JSON" | jq -r '.cdt.target') >> $GITHUB_OUTPUT + echo cdt-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '.cdt.prerelease') >> $GITHUB_OUTPUT + echo eos-evm-contract-target=$(echo "$DEFAULTS_JSON" | jq -r '.eos-evm-contract.target') >> $GITHUB_OUTPUT + echo eos-evm-contract-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '.eos-evm-contract.prerelease') >> $GITHUB_OUTPUT + + if [[ "${{inputs.override-leap-dev}}" != "" ]]; then + echo leap-dev-target=${{inputs.override-leap-dev}} >> $GITHUB_OUTPUT + fi + if [[ "${{inputs.override-leap-dev-prerelease}}" == +(true|false) ]]; then + echo leap-dev-prerelease=${{inputs.override-leap-dev-prerelease}} >> $GITHUB_OUTPUT + fi + if [[ "${{inputs.override-leap}}" != "" ]]; then + echo leap-target=${{inputs.override-leap}} >> $GITHUB_OUTPUT + fi + if [[ "${{inputs.override-leap-prerelease}}" == +(true|false) ]]; then + echo leap-prerelease=${{inputs.override-leap-prerelease}} >> $GITHUB_OUTPUT + fi + if [[ "${{inputs.override-cdt}}" != "" ]]; then + echo cdt-target=${{inputs.override-cdt}} >> $GITHUB_OUTPUT + fi + if [[ "${{inputs.override-cdt-prerelease}}" == +(true|false) ]]; then + echo cdt-prerelease=${{inputs.override-cdt-prerelease}} >> $GITHUB_OUTPUT + fi + if [[ "${{inputs.override-eos-evm-contract}}" != "" ]]; then + echo eos-evm-contract-target=${{inputs.override-eos-evm-contract}} >> $GITHUB_OUTPUT + fi + if [[ "${{inputs.override-eos-evm-contract-prerelease}}" == +(true|false) ]]; then + echo eos-evm-contract-prerelease=${{inputs.override-eos-evm-contract-prerelease}} >> $GITHUB_OUTPUT + fi + - name: Update Package Index & Upgrade Packages run: | apt-get update @@ -131,8 +212,8 @@ jobs: with: owner: AntelopeIO repo: cdt - target: 'v3.1.0' - prereleases: false + target: '${{steps.versions.outputs.cdt-target}}' + prereleases: ${{fromJSON(steps.versions.outputs.cdt-prerelease)}} file: 'cdt_.*amd64.deb' token: ${{ secrets.GITHUB_TOKEN }} @@ -144,8 +225,8 @@ jobs: with: owner: AntelopeIO repo: leap - target: 'v4' - prereleases: false + target: '${{steps.versions.outputs.leap-dev-target}}' + prereleases: ${{fromJSON(steps.versions.outputs.leap-dev-prerelease)}} file: 'leap-dev.*(x86_64|amd64).deb' container-package: experimental-binaries token: ${{ secrets.GITHUB_TOKEN }} @@ -155,7 +236,8 @@ jobs: with: owner: AntelopeIO repo: leap - target: 'v4' + target: '${{steps.versions.outputs.leap-target}}' + prereleases: ${{fromJSON(steps.versions.outputs.leap-prerelease)}} file: 'leap.*${{matrix.platform}}.*(x86_64|amd64).deb' token: ${{ secrets.GITHUB_TOKEN }} @@ -171,7 +253,8 @@ jobs: with: owner: eosnetworkfoundation repo: eos-evm - target: 'main' + target: '${{steps.versions.outputs.eos-evm-contract-target}}' + prereleases: ${{fromJSON(steps.versions.outputs.eos-evm-contract-prerelease)}} file: 'contract.tar.gz' artifact-name: contract.test-actions-off.tar.gz token: ${{ secrets.GITHUB_TOKEN }} From 12ee317c5a8f43be099c07dec874eb82276c307d Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 14:34:01 -0500 Subject: [PATCH 55/71] Move version discovery into own job. Run this job on a github runner that already has gh command line tools and curl installed instead of our built up from bare bones container. --- .github/workflows/node.yml | 59 +++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 7c85efd..701cc86 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -146,23 +146,20 @@ jobs: name: build.tar.gz path: build.tar.gz - integration-test: - name: EOS EVM Integration Tests - needs: [d, build] - if: always() && needs.d.result == 'success' && needs.build.result == 'success' - strategy: - fail-fast: false - matrix: - platform: [ ubuntu22 ] + versions: + name: Determine Versions runs-on: ubuntu-latest - container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}} - env: - CC: gcc-11 - CXX: g++-11 - DCMAKE_BUILD_TYPE: 'Release' - + outputs: + leap-dev-target: ${{steps.versions.outputs.leap-dev-target}} + leap-dev-prerelease: ${{steps.versions.outputs.leap-dev-prerelease}} + leap-target: ${{steps.versions.outputs.leap-target}} + leap-prerelease: ${{steps.versions.outputs.leap-prerelease}} + cdt-target: ${{steps.versions.outputs.cdt-target}} + cdt-prerelease: ${{steps.versions.outputs.cdt-prerelease}} + eos-evm-contract-target: ${{steps.versions.outputs.eos-evm-contract-target}} + eos-evm-contract-prerelease: ${{steps.versions.outputs.eos-evm-contract-prerelease}} steps: - - name: Setup leap-dev & cdt versions + - name: Setup versions from input or defaults id: versions env: GH_TOKEN: ${{secrets.GITHUB_TOKEN}} @@ -202,6 +199,22 @@ jobs: echo eos-evm-contract-prerelease=${{inputs.override-eos-evm-contract-prerelease}} >> $GITHUB_OUTPUT fi + integration-test: + name: EOS EVM Integration Tests + needs: [d, build, versions] + if: always() && needs.d.result == 'success' && needs.build.result == 'success' && needs.versions.result == 'success' + strategy: + fail-fast: false + matrix: + platform: [ ubuntu22 ] + runs-on: ubuntu-latest + container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}} + env: + CC: gcc-11 + CXX: g++-11 + DCMAKE_BUILD_TYPE: 'Release' + + steps: - name: Update Package Index & Upgrade Packages run: | apt-get update @@ -212,8 +225,8 @@ jobs: with: owner: AntelopeIO repo: cdt - target: '${{steps.versions.outputs.cdt-target}}' - prereleases: ${{fromJSON(steps.versions.outputs.cdt-prerelease)}} + target: '${{needs.versions.outputs.cdt-target}}' + prereleases: ${{fromJSON(needs.versions.outputs.cdt-prerelease)}} file: 'cdt_.*amd64.deb' token: ${{ secrets.GITHUB_TOKEN }} @@ -225,8 +238,8 @@ jobs: with: owner: AntelopeIO repo: leap - target: '${{steps.versions.outputs.leap-dev-target}}' - prereleases: ${{fromJSON(steps.versions.outputs.leap-dev-prerelease)}} + target: '${{needs.versions.outputs.leap-dev-target}}' + prereleases: ${{fromJSON(needs.versions.outputs.leap-dev-prerelease)}} file: 'leap-dev.*(x86_64|amd64).deb' container-package: experimental-binaries token: ${{ secrets.GITHUB_TOKEN }} @@ -236,8 +249,8 @@ jobs: with: owner: AntelopeIO repo: leap - target: '${{steps.versions.outputs.leap-target}}' - prereleases: ${{fromJSON(steps.versions.outputs.leap-prerelease)}} + target: '${{needs.versions.outputs.leap-target}}' + prereleases: ${{fromJSON(needs.versions.outputs.leap-prerelease)}} file: 'leap.*${{matrix.platform}}.*(x86_64|amd64).deb' token: ${{ secrets.GITHUB_TOKEN }} @@ -253,8 +266,8 @@ jobs: with: owner: eosnetworkfoundation repo: eos-evm - target: '${{steps.versions.outputs.eos-evm-contract-target}}' - prereleases: ${{fromJSON(steps.versions.outputs.eos-evm-contract-prerelease)}} + target: '${{needs.versions.outputs.eos-evm-contract-target}}' + prereleases: ${{fromJSON(needs.versions.outputs.eos-evm-contract-prerelease)}} file: 'contract.tar.gz' artifact-name: contract.test-actions-off.tar.gz token: ${{ secrets.GITHUB_TOKEN }} From ae68d043213af52d8ba880b032a1ddc2981934ce Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 14:47:20 -0500 Subject: [PATCH 56/71] Fix quotes for jq --- .github/workflows/node.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 701cc86..9473dde 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -169,10 +169,10 @@ jobs: echo leap-dev-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '."leap-dev".prerelease') >> $GITHUB_OUTPUT echo leap-target=$(echo "$DEFAULTS_JSON" | jq -r '."leap".target') >> $GITHUB_OUTPUT echo leap-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '."leap".prerelease') >> $GITHUB_OUTPUT - echo cdt-target=$(echo "$DEFAULTS_JSON" | jq -r '.cdt.target') >> $GITHUB_OUTPUT - echo cdt-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '.cdt.prerelease') >> $GITHUB_OUTPUT - echo eos-evm-contract-target=$(echo "$DEFAULTS_JSON" | jq -r '.eos-evm-contract.target') >> $GITHUB_OUTPUT - echo eos-evm-contract-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '.eos-evm-contract.prerelease') >> $GITHUB_OUTPUT + echo cdt-target=$(echo "$DEFAULTS_JSON" | jq -r '."cdt".target') >> $GITHUB_OUTPUT + echo cdt-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '."cdt".prerelease') >> $GITHUB_OUTPUT + echo eos-evm-contract-target=$(echo "$DEFAULTS_JSON" | jq -r '."eos-evm-contract".target') >> $GITHUB_OUTPUT + echo eos-evm-contract-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '."eos-evm-contract".prerelease') >> $GITHUB_OUTPUT if [[ "${{inputs.override-leap-dev}}" != "" ]]; then echo leap-dev-target=${{inputs.override-leap-dev}} >> $GITHUB_OUTPUT From 6f37a2e41a5838ddbc852b85dcafca12ba2257cd Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 15:28:01 -0500 Subject: [PATCH 57/71] Fix no newline at end of file. --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index cb905e4..04d2925 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,4 +2,4 @@ add_subdirectory( nodeos_eos_evm_server ) configure_file(antelope_name.py . COPYONLY) configure_file(nodeos_eos_evm_server.py . COPYONLY) -configure_file(nodeos_eos_evm_test.py . COPYONLY) \ No newline at end of file +configure_file(nodeos_eos_evm_test.py . COPYONLY) From 51c323c6c0ae35339abc7e01a82ca1a2682c1f7d Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 15:28:34 -0500 Subject: [PATCH 58/71] Revert change to index.js that may no longer be necessary. --- peripherals/tx_wrapper/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/peripherals/tx_wrapper/index.js b/peripherals/tx_wrapper/index.js index cdcf94c..4d26c5d 100644 --- a/peripherals/tx_wrapper/index.js +++ b/peripherals/tx_wrapper/index.js @@ -1,7 +1,7 @@ const { Api, JsonRpc, RpcError } = require("eosjs"); const { JsSignatureProvider } = require("eosjs/dist/eosjs-jssig"); // development only -// const fetch = require("node-fetch"); // node only; not needed in browsers -const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); +const fetch = require("node-fetch"); // node only; not needed in browsers +// const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); const { TextEncoder, TextDecoder } = require("util"); // node only; native TextEncoder/Decoder const RpcServer = require("http-jsonrpc-server"); From f7c496acbf04de703de6f45a136863882eff94a6 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 16:06:53 -0500 Subject: [PATCH 59/71] Update docs for version of web3 bumped up to >6 --- tests/nodeos_eos_evm_server/PERFORMANCE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/nodeos_eos_evm_server/PERFORMANCE.md b/tests/nodeos_eos_evm_server/PERFORMANCE.md index c2a35c9..14304ab 100644 --- a/tests/nodeos_eos_evm_server/PERFORMANCE.md +++ b/tests/nodeos_eos_evm_server/PERFORMANCE.md @@ -50,7 +50,7 @@ ln -s ~/evmperf/eos-evm/tests/leap/nodeos_eos_evm_server.py nodeos_eos_evm_serve sed -i 's/SYS/EOS/g' core_symbol.py python3 -m venv venv source venv/bin/activate -pip install 'web3<6' flask flask-cors +pip install 'web3>=6' flask flask-cors ``` From 7c92aed805ef36b515080332f79e26ef07b121d6 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 16:12:14 -0500 Subject: [PATCH 60/71] Define evmRPCPOpen earlier in test. --- tests/nodeos_eos_evm_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index 534554b..fc099f8 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -102,6 +102,7 @@ pnodes=1 total_nodes=pnodes + 2 evmNodePOpen = None +evmRPCPOpen = None def interact_with_storage_contract(dest, nonce): for i in range(1, 5): # execute a few From 24a98d7b7e5561788f7d1cb4cc865e18c42a8fbc Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 16:12:30 -0500 Subject: [PATCH 61/71] Revert "Revert change to index.js that may no longer be necessary." Seems this change is still necessary. This reverts commit 51c323c6c0ae35339abc7e01a82ca1a2682c1f7d. --- peripherals/tx_wrapper/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/peripherals/tx_wrapper/index.js b/peripherals/tx_wrapper/index.js index 4d26c5d..cdcf94c 100644 --- a/peripherals/tx_wrapper/index.js +++ b/peripherals/tx_wrapper/index.js @@ -1,7 +1,7 @@ const { Api, JsonRpc, RpcError } = require("eosjs"); const { JsSignatureProvider } = require("eosjs/dist/eosjs-jssig"); // development only -const fetch = require("node-fetch"); // node only; not needed in browsers -// const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); +// const fetch = require("node-fetch"); // node only; not needed in browsers +const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); const { TextEncoder, TextDecoder } = require("util"); // node only; native TextEncoder/Decoder const RpcServer = require("http-jsonrpc-server"); From 1a8317b19890097664d4adfc222e21b7feda6df8 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 2 Aug 2023 17:12:20 -0500 Subject: [PATCH 62/71] Address peer review comments around js and node versions. --- .github/workflows/node.yml | 4 ++++ peripherals/tx_wrapper/package.json | 1 + 2 files changed, 5 insertions(+) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 9473dde..494bed7 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -219,6 +219,8 @@ jobs: run: | apt-get update apt-get upgrade -y + apt update + apt upgrade -y - name: Download CDT uses: AntelopeIO/asset-artifact-download-action@v3 @@ -307,6 +309,8 @@ jobs: - name: Install Test Depedencies run: | + apt install -y nvm + nvm use lts/hydrogen pip install --upgrade web3 apt install -y nodejs apt install -y npm diff --git a/peripherals/tx_wrapper/package.json b/peripherals/tx_wrapper/package.json index cb0e4d7..3ff8804 100644 --- a/peripherals/tx_wrapper/package.json +++ b/peripherals/tx_wrapper/package.json @@ -1,5 +1,6 @@ { "name": "evm_poc_tx_wrapper", + "type": "module", "version": "1.0.0", "main": "index.js", "repository": "https://github.com/yarkinwho/evm_poc_tx_wrapper", From 90f99b781a56b06fec471d903256eeeeef752928 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Thu, 3 Aug 2023 07:54:11 -0500 Subject: [PATCH 63/71] Fix install of nvm --- .github/workflows/node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 494bed7..3414b95 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -309,7 +309,7 @@ jobs: - name: Install Test Depedencies run: | - apt install -y nvm + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash nvm use lts/hydrogen pip install --upgrade web3 apt install -y nodejs From 018e69b9e7ac5cb785c14e01a86de58cb80e9397 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Thu, 3 Aug 2023 08:44:20 -0500 Subject: [PATCH 64/71] Install curl. --- .github/workflows/node.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 3414b95..0cdc9de 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -309,6 +309,7 @@ jobs: - name: Install Test Depedencies run: | + apt install -y curl curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash nvm use lts/hydrogen pip install --upgrade web3 From fc55ee1bce1975794a11c1d372e8887c277f5516 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Thu, 3 Aug 2023 10:00:53 -0500 Subject: [PATCH 65/71] Install lts node from downloaded archive. --- .github/workflows/node.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 0cdc9de..18bf5bf 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -309,11 +309,12 @@ jobs: - name: Install Test Depedencies run: | - apt install -y curl - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash - nvm use lts/hydrogen + apt install -y wget + wget https://nodejs.org/dist/v18.17.0/node-v18.17.0-linux-x64.tar.xz + tar svfJ node-v18.17.0-linux-x64.tar.xz + cp -r node-v18.17.0-linux-x64/{bin,include,lib,share} /usr/ + node --version pip install --upgrade web3 - apt install -y nodejs apt install -y npm npm install eosjs npm install ethereumjs-util From 9eeded28a2248f1cc64a9a0bf146230693ffb4d3 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Thu, 3 Aug 2023 10:44:50 -0500 Subject: [PATCH 66/71] Fix typo. --- .github/workflows/node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 18bf5bf..ce71cb5 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -311,7 +311,7 @@ jobs: run: | apt install -y wget wget https://nodejs.org/dist/v18.17.0/node-v18.17.0-linux-x64.tar.xz - tar svfJ node-v18.17.0-linux-x64.tar.xz + tar xvfJ node-v18.17.0-linux-x64.tar.xz cp -r node-v18.17.0-linux-x64/{bin,include,lib,share} /usr/ node --version pip install --upgrade web3 From 27910a468bf01fed4923d647ed977a6a8ee3175e Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Thu, 3 Aug 2023 11:46:04 -0500 Subject: [PATCH 67/71] Fix spelling. --- .github/workflows/node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index ce71cb5..4958279 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -307,7 +307,7 @@ jobs: echo "EVM_NODE_BUILD=$(pwd)" >> "$GITHUB_OUTPUT" popd - - name: Install Test Depedencies + - name: Install Test Dependencies run: | apt install -y wget wget https://nodejs.org/dist/v18.17.0/node-v18.17.0-linux-x64.tar.xz From ac91998c674a0957a7219e9887a110c84e585fd3 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Thu, 3 Aug 2023 12:27:06 -0500 Subject: [PATCH 68/71] Use the npm installed from the tarball. --- .github/workflows/node.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 4958279..b7d5c13 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -309,13 +309,13 @@ jobs: - name: Install Test Dependencies run: | + pip install --upgrade web3 apt install -y wget wget https://nodejs.org/dist/v18.17.0/node-v18.17.0-linux-x64.tar.xz tar xvfJ node-v18.17.0-linux-x64.tar.xz cp -r node-v18.17.0-linux-x64/{bin,include,lib,share} /usr/ node --version - pip install --upgrade web3 - apt install -y npm + npm --version npm install eosjs npm install ethereumjs-util npm install node-fetch From 1af990b889c093a4b400642f329cbb357b3e7f13 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Thu, 3 Aug 2023 13:30:17 -0500 Subject: [PATCH 69/71] Use import instead of require. require is not defined in ES module scope, you should use import instead. --- peripherals/tx_wrapper/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/peripherals/tx_wrapper/index.js b/peripherals/tx_wrapper/index.js index cdcf94c..d80375c 100644 --- a/peripherals/tx_wrapper/index.js +++ b/peripherals/tx_wrapper/index.js @@ -1,14 +1,14 @@ -const { Api, JsonRpc, RpcError } = require("eosjs"); -const { JsSignatureProvider } = require("eosjs/dist/eosjs-jssig"); // development only +const { Api, JsonRpc, RpcError } = import("eosjs"); +const { JsSignatureProvider } = import("eosjs/dist/eosjs-jssig"); // development only // const fetch = require("node-fetch"); // node only; not needed in browsers const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); -const { TextEncoder, TextDecoder } = require("util"); // node only; native TextEncoder/Decoder +const { TextEncoder, TextDecoder } = import("util"); // node only; native TextEncoder/Decoder -const RpcServer = require("http-jsonrpc-server"); -const dotenv = require("dotenv"); -const isValidHostname = require('is-valid-hostname') +const RpcServer = import("http-jsonrpc-server"); +const dotenv = import("dotenv"); +const isValidHostname = import('is-valid-hostname') -const { keccak256 } = require('ethereumjs-util'); +const { keccak256 } = import('ethereumjs-util'); // Local helpers function validateNum(input, min, max) { From 793bbee1bdc46b70cfae4ce7a32703237c2e8a8c Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Thu, 3 Aug 2023 15:37:18 -0500 Subject: [PATCH 70/71] Fix up module imports and index.js Update package-lock.json and yarn.lock --- peripherals/tx_wrapper/index.js | 32 +- peripherals/tx_wrapper/package-lock.json | 430 +++++++++++++++++++++-- peripherals/tx_wrapper/yarn.lock | 146 ++++---- 3 files changed, 484 insertions(+), 124 deletions(-) diff --git a/peripherals/tx_wrapper/index.js b/peripherals/tx_wrapper/index.js index d80375c..e628a58 100644 --- a/peripherals/tx_wrapper/index.js +++ b/peripherals/tx_wrapper/index.js @@ -1,14 +1,15 @@ -const { Api, JsonRpc, RpcError } = import("eosjs"); -const { JsSignatureProvider } = import("eosjs/dist/eosjs-jssig"); // development only -// const fetch = require("node-fetch"); // node only; not needed in browsers +import { config } from 'dotenv'; +config() + +import { Api, JsonRpc, RpcError } from "eosjs"; +import { JsSignatureProvider } from "eosjs/dist/eosjs-jssig.js"; // development only const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); -const { TextEncoder, TextDecoder } = import("util"); // node only; native TextEncoder/Decoder +import { TextEncoder, TextDecoder } from "util"; // node only; native TextEncoder/Decoder -const RpcServer = import("http-jsonrpc-server"); -const dotenv = import("dotenv"); -const isValidHostname = import('is-valid-hostname') +import RpcServer from "http-jsonrpc-server"; +import isValidHostname from 'is-valid-hostname'; -const { keccak256 } = import('ethereumjs-util'); +import { keccak256 } from 'ethereumjs-util'; // Local helpers function validateNum(input, min, max) { @@ -16,9 +17,6 @@ function validateNum(input, min, max) { return num >= min && num <= max && input === num.toString(); } -// Read and Validate Configs -dotenv.config(); - if (!process.env.EOS_KEY) { console.log("Missing EOS_KEY in .env file!"); process.exit(); @@ -55,7 +53,7 @@ if (!process.env.PORT || !validateNum(process.env.PORT, 1, 65535)) { process.exit(); } -expire_sec = 300; +let expire_sec = 300; if (!process.env.EXPIRE_SEC) { console.log("Missing EXPIRE_SEC, default to " + expire_sec); } else { @@ -63,15 +61,15 @@ if (!process.env.EXPIRE_SEC) { } // Setting up EOS -rpc_list = process.env.EOS_RPC.split("|"); +let rpc_list = process.env.EOS_RPC.split("|"); console.log("number of RPC endpoints = " + rpc_list.length + ", using " + rpc_list[0]); -rpc_index = 0; +let rpc_index = 0; -rpc = new JsonRpc(rpc_list[rpc_index], { fetch }); +let rpc = new JsonRpc(rpc_list[rpc_index], { fetch }); const defaultPrivateKey = process.env.EOS_KEY; const signatureProvider = new JsSignatureProvider([defaultPrivateKey]); -api = new Api({ +let api = new Api({ rpc, signatureProvider, textDecoder: new TextDecoder(), @@ -121,7 +119,7 @@ async function push_tx(strRlptx) { expireSeconds: +expire_sec, } ); - latency = Date.now() - t0; + const latency = Date.now() - t0; console.log("----response(" + id + ", " + latency + "ms) ----"); console.log(result); return result; diff --git a/peripherals/tx_wrapper/package-lock.json b/peripherals/tx_wrapper/package-lock.json index e2da0ce..de027e1 100644 --- a/peripherals/tx_wrapper/package-lock.json +++ b/peripherals/tx_wrapper/package-lock.json @@ -1,29 +1,157 @@ { "name": "evm_poc_tx_wrapper", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "bn.js": { + "packages": { + "": { + "name": "evm_poc_tx_wrapper", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "dotenv": "^16.0.0", + "eosjs": "^22.1.0", + "ethereumjs-util": "^7.1.4", + "http-jsonrpc-server": "^1.1.0", + "is-valid-hostname": "^1.0.2", + "node-fetch": "^2.6.6" + } + }, + "node_modules/@types/bn.js": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.1.tgz", + "integrity": "sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "20.4.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.6.tgz", + "integrity": "sha512-q0RkvNgMweWWIvSMDiXhflGUKMdIxBo2M2tYM/0kEGDueQByFzK4KZAgu5YHGFNxziTlppNpTIBcqHQAxlfHdA==" + }, + "node_modules/@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/base-x": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", + "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/blakejs": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" + }, + "node_modules/bn.js": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" }, - "brorand": { + "node_modules/brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, - "dotenv": { + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dependencies": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/dotenv": { "version": "16.0.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz", - "integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==" + "integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==", + "engines": { + "node": ">=12" + } }, - "elliptic": { + "node_modules/elliptic": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "requires": { + "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", "hash.js": "^1.0.0", @@ -31,98 +159,332 @@ "inherits": "^2.0.4", "minimalistic-assert": "^1.0.1", "minimalistic-crypto-utils": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - } } }, - "eosjs": { + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/eosjs": { "version": "22.1.0", "resolved": "https://registry.npmjs.org/eosjs/-/eosjs-22.1.0.tgz", "integrity": "sha512-Ka8KO7akC3RxNdSg/3dkGWuUWUQESTzSUzQljBdVP16UG548vmQoBqSGnZdnjlZyfcab8VOu2iEt+JjyfYc5+A==", - "requires": { + "dependencies": { "bn.js": "5.2.0", "elliptic": "6.5.4", "hash.js": "1.1.7", "pako": "2.0.3" } }, - "hash.js": { + "node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/ethereumjs-util": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", + "dependencies": { + "@types/bn.js": "^5.1.0", + "bn.js": "^5.1.2", + "create-hash": "^1.1.2", + "ethereum-cryptography": "^0.1.3", + "rlp": "^2.2.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "requires": { + "dependencies": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" } }, - "hmac-drbg": { + "node_modules/hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "requires": { + "dependencies": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", "minimalistic-crypto-utils": "^1.0.1" } }, - "http-jsonrpc-server": { + "node_modules/http-jsonrpc-server": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/http-jsonrpc-server/-/http-jsonrpc-server-1.1.0.tgz", - "integrity": "sha512-qtiJEG59Q0w1lCmUXWrTb+MPv7xcS7YsanT7OeVmqyxuMGe/wyr2j1euikeBDHgDB6Pbcu99F2l6XhHlRYNuow==" + "integrity": "sha512-qtiJEG59Q0w1lCmUXWrTb+MPv7xcS7YsanT7OeVmqyxuMGe/wyr2j1euikeBDHgDB6Pbcu99F2l6XhHlRYNuow==", + "engines": { + "node": ">=6.0.0" + } }, - "inherits": { + "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "is-valid-hostname": { + "node_modules/is-valid-hostname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-valid-hostname/-/is-valid-hostname-1.0.2.tgz", "integrity": "sha512-X/kiF3Xndj6WI7l/yLyzR7V1IbQd6L4S4cewSL0fRciemPmHbaXIKR2qtf+zseH+lbMG0vFp4HvCUe7amGZVhw==" }, - "minimalistic-assert": { + "node_modules/keccak": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.3.tgz", + "integrity": "sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ==", + "hasInstallScript": true, + "dependencies": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" }, - "minimalistic-crypto-utils": { + "node_modules/minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" }, - "node-fetch": { + "node_modules/node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + }, + "node_modules/node-fetch": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { + "dependencies": { "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-gyp-build": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", + "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" } }, - "pako": { + "node_modules/pako": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/pako/-/pako-2.0.3.tgz", "integrity": "sha512-WjR1hOeg+kki3ZIOjaf4b5WVcay1jaliKSYiEaB1XzwhMQZJxRdQRv0V31EKBYlxb4T7SK3hjfc/jxyU64BoSw==" }, - "tr46": { + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/rlp": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", + "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", + "dependencies": { + "bn.js": "^5.2.0" + }, + "bin": { + "rlp": "bin/rlp" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + }, + "node_modules/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "hasInstallScript": true, + "dependencies": { + "elliptic": "^6.5.4", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" }, - "webidl-conversions": { + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" }, - "whatwg-url": { + "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "requires": { + "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } diff --git a/peripherals/tx_wrapper/yarn.lock b/peripherals/tx_wrapper/yarn.lock index c964896..95b281a 100644 --- a/peripherals/tx_wrapper/yarn.lock +++ b/peripherals/tx_wrapper/yarn.lock @@ -3,61 +3,61 @@ "@types/bn.js@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" - integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== + version "5.1.1" + resolved "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.1.tgz" + integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== dependencies: "@types/node" "*" "@types/node@*": - version "17.0.23" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.23.tgz#3b41a6e643589ac6442bdbd7a4a3ded62f33f7da" - integrity sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw== + version "20.4.6" + resolved "https://registry.npmjs.org/@types/node/-/node-20.4.6.tgz" + integrity sha512-q0RkvNgMweWWIvSMDiXhflGUKMdIxBo2M2tYM/0kEGDueQByFzK4KZAgu5YHGFNxziTlppNpTIBcqHQAxlfHdA== "@types/pbkdf2@^3.0.0": version "3.1.0" - resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" + resolved "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz" integrity sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ== dependencies: "@types/node" "*" "@types/secp256k1@^4.0.1": version "4.0.3" - resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" + resolved "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz" integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w== dependencies: "@types/node" "*" base-x@^3.0.2: version "3.0.9" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + resolved "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz" integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== dependencies: safe-buffer "^5.0.1" blakejs@^1.1.0: version "1.2.1" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" + resolved "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz" integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== -bn.js@5.2.0, bn.js@^5.1.2, bn.js@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" - integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== - bn.js@^4.11.9: version "4.12.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== +bn.js@^5.1.2, bn.js@^5.2.0, bn.js@5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz" + integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== + brorand@^1.1.0: version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= browserify-aes@^1.2.0: version "1.2.0" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + resolved "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz" integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== dependencies: buffer-xor "^1.0.3" @@ -69,14 +69,14 @@ browserify-aes@^1.2.0: bs58@^4.0.0: version "4.0.1" - resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" - integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= + resolved "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz" + integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== dependencies: base-x "^3.0.2" bs58check@^2.1.2: version "2.1.2" - resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" + resolved "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz" integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== dependencies: bs58 "^4.0.0" @@ -85,12 +85,12 @@ bs58check@^2.1.2: buffer-xor@^1.0.3: version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= + resolved "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz" + integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + resolved "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz" integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== dependencies: inherits "^2.0.1" @@ -98,7 +98,7 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + resolved "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz" integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== dependencies: cipher-base "^1.0.1" @@ -109,7 +109,7 @@ create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: create-hmac@^1.1.4, create-hmac@^1.1.7: version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + resolved "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz" integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== dependencies: cipher-base "^1.0.3" @@ -121,12 +121,12 @@ create-hmac@^1.1.4, create-hmac@^1.1.7: dotenv@^16.0.0: version "16.0.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.0.tgz#c619001253be89ebb638d027b609c75c26e47411" + resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz" integrity sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q== -elliptic@6.5.4, elliptic@^6.5.4: +elliptic@^6.5.4, elliptic@6.5.4: version "6.5.4" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== dependencies: bn.js "^4.11.9" @@ -139,7 +139,7 @@ elliptic@6.5.4, elliptic@^6.5.4: eosjs@^22.1.0: version "22.1.0" - resolved "https://registry.yarnpkg.com/eosjs/-/eosjs-22.1.0.tgz#7ac40e2f1f959fab70539c30ac8ae46c9038aa3c" + resolved "https://registry.npmjs.org/eosjs/-/eosjs-22.1.0.tgz" integrity sha512-Ka8KO7akC3RxNdSg/3dkGWuUWUQESTzSUzQljBdVP16UG548vmQoBqSGnZdnjlZyfcab8VOu2iEt+JjyfYc5+A== dependencies: bn.js "5.2.0" @@ -149,7 +149,7 @@ eosjs@^22.1.0: ethereum-cryptography@^0.1.3: version "0.1.3" - resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" + resolved "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz" integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== dependencies: "@types/pbkdf2" "^3.0.0" @@ -169,9 +169,9 @@ ethereum-cryptography@^0.1.3: setimmediate "^1.0.5" ethereumjs-util@^7.1.4: - version "7.1.4" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz#a6885bcdd92045b06f596c7626c3e89ab3312458" - integrity sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A== + version "7.1.5" + resolved "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz" + integrity sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg== dependencies: "@types/bn.js" "^5.1.0" bn.js "^5.1.2" @@ -181,7 +181,7 @@ ethereumjs-util@^7.1.4: evp_bytestokey@^1.0.3: version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + resolved "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz" integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== dependencies: md5.js "^1.3.4" @@ -189,16 +189,16 @@ evp_bytestokey@^1.0.3: hash-base@^3.0.0: version "3.1.0" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz" integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== dependencies: inherits "^2.0.4" readable-stream "^3.6.0" safe-buffer "^5.2.0" -hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: +hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7, hash.js@1.1.7: version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz" integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== dependencies: inherits "^2.0.3" @@ -206,7 +206,7 @@ hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: hmac-drbg@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz" integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= dependencies: hash.js "^1.0.3" @@ -215,23 +215,23 @@ hmac-drbg@^1.0.1: http-jsonrpc-server@^1.1.0: version "1.1.0" - resolved "https://registry.yarnpkg.com/http-jsonrpc-server/-/http-jsonrpc-server-1.1.0.tgz#577729e05043b0911103d7f785f9f93a3b6350a3" + resolved "https://registry.npmjs.org/http-jsonrpc-server/-/http-jsonrpc-server-1.1.0.tgz" integrity sha512-qtiJEG59Q0w1lCmUXWrTb+MPv7xcS7YsanT7OeVmqyxuMGe/wyr2j1euikeBDHgDB6Pbcu99F2l6XhHlRYNuow== inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4: version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== is-valid-hostname@^1.0.2: version "1.0.2" - resolved "https://registry.yarnpkg.com/is-valid-hostname/-/is-valid-hostname-1.0.2.tgz#23fdc84e86cb793a43207686e7edb2f796e82406" + resolved "https://registry.npmjs.org/is-valid-hostname/-/is-valid-hostname-1.0.2.tgz" integrity sha512-X/kiF3Xndj6WI7l/yLyzR7V1IbQd6L4S4cewSL0fRciemPmHbaXIKR2qtf+zseH+lbMG0vFp4HvCUe7amGZVhw== keccak@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.2.tgz#4c2c6e8c54e04f2670ee49fa734eb9da152206e0" - integrity sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ== + version "3.0.3" + resolved "https://registry.npmjs.org/keccak/-/keccak-3.0.3.tgz" + integrity sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ== dependencies: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" @@ -239,7 +239,7 @@ keccak@^3.0.0: md5.js@^1.3.4: version "1.3.5" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + resolved "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz" integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== dependencies: hash-base "^3.0.0" @@ -248,39 +248,39 @@ md5.js@^1.3.4: minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz" integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== minimalistic-crypto-utils@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= node-addon-api@^2.0.0: version "2.0.2" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" + resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz" integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== node-fetch@^2.6.6: version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== dependencies: whatwg-url "^5.0.0" node-gyp-build@^4.2.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.4.0.tgz#42e99687ce87ddeaf3a10b99dc06abc11021f3f4" - integrity sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ== + version "4.6.0" + resolved "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz" + integrity sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ== pako@2.0.3: version "2.0.3" - resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.3.tgz#cdf475e31b678565251406de9e759196a0ea7a43" + resolved "https://registry.npmjs.org/pako/-/pako-2.0.3.tgz" integrity sha512-WjR1hOeg+kki3ZIOjaf4b5WVcay1jaliKSYiEaB1XzwhMQZJxRdQRv0V31EKBYlxb4T7SK3hjfc/jxyU64BoSw== pbkdf2@^3.0.17: version "3.1.2" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + resolved "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz" integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== dependencies: create-hash "^1.1.2" @@ -291,15 +291,15 @@ pbkdf2@^3.0.17: randombytes@^2.1.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== dependencies: safe-buffer "^5.1.0" readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + version "3.6.2" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== dependencies: inherits "^2.0.3" string_decoder "^1.1.1" @@ -307,7 +307,7 @@ readable-stream@^3.6.0: ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + resolved "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz" integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== dependencies: hash-base "^3.0.0" @@ -315,24 +315,24 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: rlp@^2.2.4: version "2.2.7" - resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" + resolved "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz" integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== dependencies: bn.js "^5.2.0" safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== scrypt-js@^3.0.0: version "3.0.1" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" + resolved "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz" integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== secp256k1@^4.0.1: version "4.0.3" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" + resolved "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz" integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== dependencies: elliptic "^6.5.4" @@ -341,12 +341,12 @@ secp256k1@^4.0.1: setimmediate@^1.0.5: version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= + resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz" + integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + resolved "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz" integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== dependencies: inherits "^2.0.1" @@ -354,29 +354,29 @@ sha.js@^2.4.0, sha.js@^2.4.8: string_decoder@^1.1.1: version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== dependencies: safe-buffer "~5.2.0" tr46@~0.0.3: version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= util-deprecate@^1.0.1: version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== webidl-conversions@^3.0.0: version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= whatwg-url@^5.0.0: version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= dependencies: tr46 "~0.0.3" From 41ed154450319765ec94012e7032be2c4d64815c Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Thu, 3 Aug 2023 15:41:34 -0500 Subject: [PATCH 71/71] Use npm install in tx_wrapper instead of trying to install dependencies individually. --- .github/workflows/node.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index b7d5c13..4233aec 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -316,12 +316,9 @@ jobs: cp -r node-v18.17.0-linux-x64/{bin,include,lib,share} /usr/ node --version npm --version - npm install eosjs - npm install ethereumjs-util - npm install node-fetch - npm install http-jsonrpc-server - npm install dotenv - npm install is-valid-hostname + pushd ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/peripherals/tx_wrapper + npm install + popd - name: Test Leap Integration run: |