Skip to content

Commit

Permalink
test(nightly): stagger, add bridge tests (erigontech#578)
Browse files Browse the repository at this point in the history
  • Loading branch information
revitteth authored Jun 7, 2024
1 parent 18960e5 commit b43e4d2
Show file tree
Hide file tree
Showing 81 changed files with 3,067 additions and 2 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/nightly-bridge-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Nightly Bridge Tests

on:
schedule:
- cron: '0 0 * * *' # run at midnight
workflow_dispatch:
inputs:
dry_run:
description: 'Set dry run mode'
required: false
default: 'false'

jobs:
build-and-run:
runs-on: ubuntu-latest

services:
docker:
image: docker:19.03.12
options: --privileged

strategy:
matrix:
config:
- name: "network5"
destination_net: "8282"
destination_address: "0x814764FD16DDA0052a09BAccf4939524EE308FE1" # this is a L1 sepolia address (funded via L1)
ether_value: "0.02"
token_address: "0x0f25eE4CA85Db4362a9749782872c558873566e4"
is_forced: "true"
bridge_address: "0xb566BE17B22404BD46F389030ec5592F8ffAde12"
meta_bytes: "0x"
eth_rpc_url: "http://34.175.214.161:8500"
bridge_api_url: "http://34.175.214.161:8085"
dry_run: "${{ github.event.inputs.dry_run || 'false' }}"

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Run Docker Compose
env:
RAW_PRIVATE_KEY: ${{ secrets.L1_SEPOLIA_FUNDED_PRIVATE_KEY }}
DESTINATION_NET: ${{ matrix.config.destination_net }}
DESTINATION_ADDRESS: ${{ matrix.config.destination_address }}
ETHER_VALUE: ${{ matrix.config.ether_value }}
TOKEN_ADDRESS: ${{ matrix.config.token_address }}
IS_FORCED: ${{ matrix.config.is_forced }}
BRIDGE_ADDRESS: ${{ matrix.config.bridge_address }}
META_BYTES: ${{ matrix.config.meta_bytes }}
ETH_RPC_URL: ${{ matrix.config.eth_rpc_url }}
BRIDGE_API_URL: ${{ matrix.config.bridge_api_url }}
DRY_RUN: ${{ matrix.config.dry_run }}
run: |
cd zk/tests/bridge && docker-compose up --build
2 changes: 1 addition & 1 deletion .github/workflows/nightly-eth-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Nightly - ETH Bench

on:
schedule:
- cron: '0 0 * * *'
- cron: '0 1 * * *' # run at 1am to stagger tests
workflow_dispatch:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-node-compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Nightly - Compare Blocks

on:
schedule:
- cron: '0 0 * * *'
- cron: '0 2 * * *' # run at 2am to give time for other suites to run first
workflow_dispatch:

jobs:
Expand Down
71 changes: 71 additions & 0 deletions zk/tests/ansible/evm-rpc-tests/README.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
Adding some tests which are runnable via ansible


#+begin_src bash
echo -n 'data:,{"msg":"eip-1559 equal fee"}' | xxd -p | tr -d "\n";echo
#+end_src


#+begin_src bash
# build the jerigon image (in a different repo)
docker build -t erigon:local .

# run kurtosis
kurtosis run --enclave my-testnet github.com/kurtosis-tech/ethereum-package@3.0.0 --args-file network_params.yml

# Run the loads
ansible-playbook -i hosts site.yml

# Extract some witnesses
$(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc)
./rpc fetch --rpc-url $(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc) --block-number 363 --checkpoint-block-number 362 > initial-contract-deploy.json
./rpc fetch --rpc-url $(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc) --block-number 364 --checkpoint-block-number 363 > ec-pairing.json
./rpc fetch --rpc-url $(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc) --block-number 365 --checkpoint-block-number 364 > ed25519verifier.json
./rpc fetch --rpc-url $(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc) --block-number 366 --checkpoint-block-number 365 > large-30m-sha3.json
./rpc fetch --rpc-url $(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc) --block-number 367 --checkpoint-block-number 366 > large-identity.json
./rpc fetch --rpc-url $(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc) --block-number 368 --checkpoint-block-number 367 > large-sha2.json
./rpc fetch --rpc-url $(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc) --block-number 369 --checkpoint-block-number 368 > large-sha3.json
./rpc fetch --rpc-url $(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc) --block-number 370 --checkpoint-block-number 369 > loop-log0.json
./rpc fetch --rpc-url $(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc) --block-number 371 --checkpoint-block-number 370 > loop-sload.json
./rpc fetch --rpc-url $(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc) --block-number 372 --checkpoint-block-number 371 > modexp-256-huge-precompile.json
./rpc fetch --rpc-url $(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc) --block-number 373 --checkpoint-block-number 372 > modexp-slow-precompile.json
./rpc fetch --rpc-url $(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc) --block-number 374 --checkpoint-block-number 373 > simple-fibonacci.json

./rpc fetch --rpc-url $(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc) --block-number 375 --checkpoint-block-number 374 > loop-sload-access-list.json


# Get all of the witnesses using the zero-bin rpc binary
seq 0 240 | awk '{print "./rpc fetch --rpc-url $(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc) --block-number " $1 " --checkpoint-block-number 0 > " sprintf("witness-%04d", $1) ".json"}' | bash
seq 0 240 | awk '{print "cast block -j --full --rpc-url $(kurtosis port print my-testnet el-2-erigon-lighthouse ws-rpc) " $1 " > " sprintf("block-%04d", $1) ".json"}' | bash
tar caf testchain-witnesses.tbz2 block-* witness-*


wit=large-sha2.json
atop -w $wit.atop 10 &
echo $! > atop.pid

env RUST_BACKTRACE=full \
RUST_LOG=info \
RUST_MIN_STACK=33554432 \
ARITHMETIC_CIRCUIT_SIZE="15..28" \
BYTE_PACKING_CIRCUIT_SIZE="9..28" \
CPU_CIRCUIT_SIZE="12..28" \
KECCAK_CIRCUIT_SIZE="14..28" \
KECCAK_SPONGE_CIRCUIT_SIZE="9..28" \
LOGIC_CIRCUIT_SIZE="12..28" \
MEMORY_CIRCUIT_SIZE="17..30" \
./leader \
--runtime in-memory \
--num-workers 1 \
stdio \
< $wit | tee $wit.out

sleep 10
kill $(cat atop.pid)

#+end_src



erigon --networkid=3151908 --log.console.verbosity=3 --datadir=/data/erigon/execution-data --port=30303 --http.api=eth,erigon,engine,web3,net,debug,trace,txpool,admin --http.vhosts=* --ws --allow-insecure-unlock --nat=extip:172.16.0.12 --http --http.addr=0.0.0.0 --http.corsdomain=* --http.port=8545 --authrpc.jwtsecret=/jwt/jwtsecret --authrpc.addr=0.0.0.0 --authrpc.port=8551 --authrpc.vhosts=* --metrics --metrics.addr=0.0.0.0 --metrics.port=9001 --db.size.limit=3000MB --bootnodes=enode://f96c94d23764060bdf8beb9c374c4570e1c542e378880087cffa9e8268f5e4ec7d3513de717a18da5328fd808cc572204dbbf819cf5640d3b564507c25a5ad6a@172.16.0.11:30303

6 changes: 6 additions & 0 deletions zk/tests/ansible/evm-rpc-tests/ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[defaults]
stdout_callback = yaml
callback_whitelist = log_plays

[callback_log_plays]
log_folder = /tmp/rpc-tests.d
31 changes: 31 additions & 0 deletions zk/tests/ansible/evm-rpc-tests/group_vars/all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---

# this is the json RPC URL that we'll use for all tests that require
# an RPC. It doesn't matter if this is L1 or L2.
rpc_url: http://127.0.0.1:32773

# this is the hex private key that we'll use for sending
# transactions. It's expected that this key has some value
private_key: ""

# the eth address can be determined from the private key, but it's
# convent to have both as variables here
eth_address: ""

# Some of the commands will write out logs. This is the file where
# they should go
log_file: /tmp/rpc-tests.log

# Some of the commands will create files / directories, this is the
# location for working
work_dir: /tmp/rpc-tests.d

# A configuration that we should use for configure the largest size of
# tx
max_block_size: 25_000_000

# Specifically a flag to send eip-1559 tx
legacy_flag: "--legacy"

# A block interval that's used for setting a timeout period
block_interval: 12
1 change: 1 addition & 0 deletions zk/tests/ansible/evm-rpc-tests/hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
localhost
35 changes: 35 additions & 0 deletions zk/tests/ansible/evm-rpc-tests/network_params.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
participants:
- el_type: geth
el_extra_params:
- "--http.api=admin,engine,net,eth,web3,debug,txpool"
- "--txpool.locals 0x8943545177806ED17B9F23F0a21ee5948eCaa776"

- el_type: erigon
el_image: "erigon:local"



additional_services: []
# - assertoor
# - broadcaster
# - tx_spammer
# - blob_spammer
# - custom_flood
# - goomy_blob
# - el_forkmon
# - blockscout
# - beacon_metrics_gazer
# - dora
# - full_beaconchain_explorer
# - prometheus_grafana
# - blobscan
# - dugtrio
# - blutgang
# - apache

# configured for shanghai right now. Set deneb_fork_epoch to trigger dencun
network_params:
deneb_fork_epoch: 0
electra_fork_epoch: 100000001
eip7594_fork_epoch: 100000002
Loading

0 comments on commit b43e4d2

Please sign in to comment.