-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #238 from cerc-io/roy/v5-dev
Update to geth 1.11.5-statediff-v5
- Loading branch information
Showing
103 changed files
with
8,928 additions
and
24,680 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,212 +1,91 @@ | ||
name: Test the stack. | ||
on: | ||
workflow_call: | ||
secrets: | ||
BUILD_HOSTNAME: | ||
required: true | ||
BUILD_USERNAME: | ||
required: true | ||
BUILD_KEY: | ||
required: true | ||
inputs: | ||
STACK_ORCHESTRATOR_REF: | ||
required: true | ||
type: string | ||
GO_ETHEREUM_REF: | ||
required: true | ||
type: string | ||
IPLD_ETH_DB_REF: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
name: Run docker build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run docker build | ||
run: make docker-build | ||
test: | ||
name: Run unit tests | ||
env: | ||
GOPATH: /tmp/go | ||
# To run the unit tests you need to add secrets to your repository. | ||
BUILD_HOSTNAME: ${{ secrets.BUILD_HOSTNAME }} | ||
BUILD_USERNAME: ${{ secrets.BUILD_USERNAME }} | ||
BUILD_KEY: ${{ secrets.BUILD_KEY }} | ||
#strategy: | ||
# matrix: | ||
# go-version: [1.16.x, 1.17.x, 1.18.x] | ||
name: "Run unit tests" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Passed experience with GHA has taught me to store variables in files instead of passing them as variables. | ||
- name: Output variables to files | ||
run: | | ||
echo $GITHUB_REPOSITORY > /tmp/git_repository | ||
[ -z "$GITHUB_HEAD_REF" ] && echo $GITHUB_REF_NAME > /tmp/git_head_ref || echo $GITHUB_HEAD_REF > /tmp/git_head_ref | ||
echo "-----BEGIN OPENSSH PRIVATE KEY-----" >> /tmp/key | ||
echo ${{ env.BUILD_KEY }} >> /tmp/key | ||
echo "-----END OPENSSH PRIVATE KEY-----" >> /tmp/key | ||
chmod 400 /tmp/key | ||
cat /tmp/git_repository | ||
cat /tmp/git_head_ref | ||
- name: Raw SCP | ||
run: | | ||
scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key /tmp/git_repository ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/git_repository | ||
scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key /tmp/git_head_ref ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/git_head_ref | ||
scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key .github/workflows/run_unit_test.sh ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/run_unit_test.sh | ||
- name: Trigger Unit Test | ||
run: | | ||
ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} go install github.com/onsi/ginkgo/ginkgo@latest | ||
ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} /tmp/run_unit_test.sh | ||
- name: Get the logs and cat them | ||
run: | | ||
scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/test.log . | ||
cat ./test.log | ||
- name: Check Error Code | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
check-latest: true | ||
- name: "Run DB container" | ||
run: docker compose -f test/compose-db.yml up --wait --quiet-pull | ||
- name: "Build and run tests" | ||
run: | | ||
scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/return_test.txt . | ||
[ $(cat ./return_test.txt) -eq 0 ] | ||
go install github.com/onsi/ginkgo/v2/ginkgo | ||
ginkgo -v -r --skipPackage=./integration | ||
integrationtest: | ||
name: Run integration tests | ||
env: | ||
GOPATH: /tmp/go | ||
DB_WRITE: true | ||
ETH_FORWARD_ETH_CALLS: false | ||
ETH_PROXY_ON_ERROR: false | ||
ETH_HTTP_PATH: "go-ethereum:8545" | ||
integration-test: | ||
name: "Run integration tests" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create GOPATH | ||
run: mkdir -p /tmp/go | ||
- uses: actions/setup-go@v3 | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.18.x" | ||
go-version-file: 'go.mod' | ||
check-latest: true | ||
- uses: actions/checkout@v2 | ||
- name: "Install stack-orchestrator" | ||
# FIXME: using my dev branch for v5 migration changes until a release has them | ||
# run: | | ||
# curl -L -O https://github.com/cerc-io/stack-orchestrator/releases/latest/download/laconic-so | ||
uses: actions/checkout@v3 | ||
with: | ||
path: "./ipld-eth-server" | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ inputs.STACK_ORCHESTRATOR_REF }} | ||
path: "./stack-orchestrator/" | ||
repository: vulcanize/stack-orchestrator | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ inputs.GO_ETHEREUM_REF }} | ||
repository: cerc-io/go-ethereum | ||
path: "./go-ethereum/" | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ inputs.IPLD_ETH_DB_REF }} | ||
repository: cerc-io/ipld-eth-db | ||
path: "./ipld-eth-db/" | ||
- name: Create config file | ||
run: | | ||
echo vulcanize_go_ethereum=$GITHUB_WORKSPACE/go-ethereum/ > ./config.sh | ||
echo vulcanize_ipld_eth_db=$GITHUB_WORKSPACE/ipld-eth-db/ >> ./config.sh | ||
echo vulcanize_ipld_eth_server=$GITHUB_WORKSPACE/ipld-eth-server/ >> ./config.sh | ||
echo vulcanize_test_contract=$GITHUB_WORKSPACE/ipld-eth-server/test/contract >> ./config.sh | ||
echo genesis_file_path=start-up-files/go-ethereum/genesis.json >> ./config.sh | ||
echo db_write=$DB_WRITE >> ./config.sh | ||
echo eth_forward_eth_calls=$ETH_FORWARD_ETH_CALLS >> ./config.sh | ||
echo eth_proxy_on_error=$ETH_PROXY_ON_ERROR >> ./config.sh | ||
echo eth_http_path=$ETH_HTTP_PATH >> ./config.sh | ||
cat ./config.sh | ||
- name: Build geth | ||
run: | | ||
cd $GITHUB_WORKSPACE/stack-orchestrator/helper-scripts | ||
./compile-geth.sh \ | ||
-p "$GITHUB_WORKSPACE/config.sh" \ | ||
-e docker | ||
- name: Run docker compose | ||
run: | | ||
docker-compose \ | ||
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-db-sharding.yml" \ | ||
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" \ | ||
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \ | ||
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-contract.yml" \ | ||
--env-file "$GITHUB_WORKSPACE/config.sh" \ | ||
up -d --build | ||
- name: Test | ||
repository: cerc-io/stack-orchestrator | ||
ref: roy/ipld-eth-ci | ||
path: ./stack-orchestrator | ||
- run: pip install ./stack-orchestrator | ||
- name: "Run testnet stack" | ||
run: ./scripts/integration-setup.sh | ||
- name: "Build and run server" | ||
env: | ||
ETH_FORWARD_ETH_CALLS: false | ||
ETH_CHAIN_ID: ${{ env.ETH_CHAIN_ID }} | ||
ETH_CHAIN_CONFIG: ${{ env.ETH_CHAIN_CONFIG }} | ||
DEPLOYER_PRIVATE_KEY: ${{ env.DEPLOYER_PRIVATE_KEY }} | ||
run: docker compose -f test/compose-server.yml up --wait --quiet-pull | ||
- name: "Run tests" | ||
env: | ||
ETH_CHAIN_ID: ${{ env.ETH_CHAIN_ID }} | ||
ETH_HTTP_PATH: ${{ env.ETH_HTTP_PATH }} | ||
run: | | ||
cd $GITHUB_WORKSPACE/ipld-eth-server | ||
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8081)" != "200" ]; do echo "waiting for ipld-eth-server..." && sleep 5; done && \ | ||
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8545)" != "200" ]; do echo "waiting for geth-statediff..." && sleep 5; done && \ | ||
make integrationtest | ||
go install github.com/onsi/ginkgo/v2/ginkgo | ||
ginkgo -v --label-filter '!proxy' -r ./integration | ||
integrationtest_forwardethcalls: | ||
name: Run integration tests for direct proxy fall-through of eth_calls | ||
env: | ||
GOPATH: /tmp/go | ||
DB_WRITE: false | ||
ETH_FORWARD_ETH_CALLS: true | ||
ETH_PROXY_ON_ERROR: false | ||
ETH_HTTP_PATH: "go-ethereum:8545" | ||
integration-test-eth-proxy: | ||
name: "Run direct-proxy integration tests" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create GOPATH | ||
run: mkdir -p /tmp/go | ||
- uses: actions/setup-go@v3 | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.18.x" | ||
go-version-file: 'go.mod' | ||
check-latest: true | ||
- uses: actions/checkout@v2 | ||
- name: "Install stack-orchestrator" | ||
uses: actions/checkout@v3 | ||
with: | ||
path: "./ipld-eth-server" | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ inputs.STACK_ORCHESTRATOR_REF }} | ||
path: "./stack-orchestrator/" | ||
repository: vulcanize/stack-orchestrator | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ inputs.GO_ETHEREUM_REF }} | ||
repository: cerc-io/go-ethereum | ||
path: "./go-ethereum/" | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ inputs.IPLD_ETH_DB_REF }} | ||
repository: cerc-io/ipld-eth-db | ||
path: "./ipld-eth-db/" | ||
- name: Create config file | ||
run: | | ||
echo vulcanize_go_ethereum=$GITHUB_WORKSPACE/go-ethereum/ > ./config.sh | ||
echo vulcanize_ipld_eth_db=$GITHUB_WORKSPACE/ipld-eth-db/ >> ./config.sh | ||
echo vulcanize_ipld_eth_server=$GITHUB_WORKSPACE/ipld-eth-server/ >> ./config.sh | ||
echo vulcanize_test_contract=$GITHUB_WORKSPACE/ipld-eth-server/test/contract >>./config.sh | ||
echo genesis_file_path=start-up-files/go-ethereum/genesis.json >> ./config.sh | ||
echo db_write=$DB_WRITE >> ./config.sh | ||
echo eth_forward_eth_calls=$ETH_FORWARD_ETH_CALLS >> ./config.sh | ||
echo eth_proxy_on_error=$ETH_PROXY_ON_ERROR >> ./config.sh | ||
echo eth_http_path=$ETH_HTTP_PATH >> ./config.sh | ||
cat ./config.sh | ||
- name: Build geth | ||
run: | | ||
cd $GITHUB_WORKSPACE/stack-orchestrator/helper-scripts | ||
./compile-geth.sh \ | ||
-p "$GITHUB_WORKSPACE/config.sh" \ | ||
-e docker | ||
- name: Run docker compose | ||
run: | | ||
docker-compose \ | ||
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-db-sharding.yml" \ | ||
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" \ | ||
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \ | ||
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-contract.yml" \ | ||
--env-file "$GITHUB_WORKSPACE/config.sh" \ | ||
up -d --build | ||
- name: Test | ||
repository: cerc-io/stack-orchestrator | ||
ref: roy/ipld-eth-ci | ||
path: ./stack-orchestrator | ||
- run: pip install ./stack-orchestrator | ||
- name: "Run testnet stack" | ||
env: | ||
CERC_RUN_STATEDIFF: false | ||
run: ./scripts/integration-setup.sh | ||
- name: "Build and run server" | ||
env: | ||
ETH_FORWARD_ETH_CALLS: true | ||
ETH_CHAIN_ID: ${{ env.ETH_CHAIN_ID }} | ||
ETH_CHAIN_CONFIG: ${{ env.ETH_CHAIN_CONFIG }} | ||
DEPLOYER_PRIVATE_KEY: ${{ env.DEPLOYER_PRIVATE_KEY }} | ||
run: docker compose -f test/compose-server.yml up --wait --quiet-pull | ||
- name: "Run tests" | ||
env: | ||
ETH_CHAIN_ID: ${{ env.ETH_CHAIN_ID }} | ||
ETH_HTTP_PATH: ${{ env.ETH_HTTP_PATH }} | ||
run: | | ||
cd $GITHUB_WORKSPACE/ipld-eth-server | ||
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8081)" != "200" ]; do echo "waiting for ipld-eth-server..." && sleep 5; done && \ | ||
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8545)" != "200" ]; do echo "waiting for geth-statediff..." && sleep 5; done && \ | ||
make integrationtest | ||
go install github.com/onsi/ginkgo/v2/ginkgo | ||
ginkgo -v --label-filter 'proxy' -r ./integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.