From 49df5626b7cb8972e308ec686ae60136bec3c5e0 Mon Sep 17 00:00:00 2001 From: Vid Kersic <38610409+Vid201@users.noreply.github.com> Date: Sun, 12 May 2024 18:08:49 +0200 Subject: [PATCH] Skandha<->Silius p2p tests (#45) * fix: silius add missing parameter * feat: silius p2p --- README.md | 2 +- bundlers/silius/.env | 2 +- bundlers/silius/p2p-boot.yml | 33 +++++++++++++++++++++++++++++++ bundlers/silius/p2p-boot/node-enr | 1 + bundlers/silius/p2p-boot/node-key | 1 + bundlers/silius/p2p-peer.yml | 25 +++++++++++++++++++++++ bundlers/silius/p2p-peer/node-enr | 1 + bundlers/silius/p2p-peer/node-key | 2 ++ bundlers/silius/silius.yml | 2 +- runall.sh | 6 +++--- runbundler/run2bundlers.yml | 24 +++++++++++----------- tests/silius-silius.env | 4 ++++ tests/silius-skandha.env | 5 +++++ tests/skandha-silius.env | 6 ++++++ 14 files changed, 97 insertions(+), 17 deletions(-) create mode 100644 bundlers/silius/p2p-boot.yml create mode 100644 bundlers/silius/p2p-boot/node-enr create mode 100644 bundlers/silius/p2p-boot/node-key create mode 100644 bundlers/silius/p2p-peer.yml create mode 100644 bundlers/silius/p2p-peer/node-enr create mode 100644 bundlers/silius/p2p-peer/node-key create mode 100644 tests/silius-silius.env create mode 100644 tests/silius-skandha.env create mode 100644 tests/skandha-silius.env diff --git a/README.md b/README.md index f78aa73..78657b3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This repo runs the `bundler-spec-test` against a list of bundlers, and show the The result page is in: https://www.erc4337.io/bundlers -Or https://bundler-test-results.eip4337.com/ +Or https://bundler-test-results.erc4337.io/ Each bundler to run has a folder and yml file [./bundlers](./bundlers) folder diff --git a/bundlers/silius/.env b/bundlers/silius/.env index 2a7063d..c4f869d 100644 --- a/bundlers/silius/.env +++ b/bundlers/silius/.env @@ -1 +1 @@ -BUNDLER_ACCOUNT=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ No newline at end of file +BOOT_ENR=enr:-Iu4QKWfapgYurSypiE8Oa1ZdOyK8lC2BLytkihEd-b5QwWtd-szKPuncudIbUUQ9wHMhZk-cbzTsEUxS4QiTtrYKPwBgmlkgnY0gmlwhMCoZGWJc2VjcDI1NmsxoQJEdmi_LPA0b8j2BHHDsyGi_Y086wDplSGNVe96M4sWnIN0Y3CCIyiDdWRwgiMo \ No newline at end of file diff --git a/bundlers/silius/p2p-boot.yml b/bundlers/silius/p2p-boot.yml new file mode 100644 index 0000000..dc1cf32 --- /dev/null +++ b/bundlers/silius/p2p-boot.yml @@ -0,0 +1,33 @@ +services: + bundler: + ports: [ "3000:3000" ] + image: ghcr.io/silius-rs/silius:latest + command: node + --eth-client-address $ETH_RPC_URL + --datadir data/silius + --mnemonic-file /root/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + --entry-points $ENTRYPOINT + --http --http.addr 0.0.0.0 + --http.port 3000 + --http.api eth,debug,web3 + --poll-interval "5" + --enable-p2p + --p2p.addr $BUNDLER_IP + --p2p.baddr $BUNDLER_IP + volumes: + - ./keys:/root + - ./p2p-boot:/data/silius/p2p + networks: + default: + p2p: + ipv4_address: $BUNDLER_IP + + bundler-verify: + image: docker + # volumes: + # - /var/run/docker.sock:/var/run/docker.sock + depends_on: + bundler: + condition: service_started + command: echo docker exec runbundler-bundler-1 cat /data/silius/p2p/node-enr diff --git a/bundlers/silius/p2p-boot/node-enr b/bundlers/silius/p2p-boot/node-enr new file mode 100644 index 0000000..4273c44 --- /dev/null +++ b/bundlers/silius/p2p-boot/node-enr @@ -0,0 +1 @@ +enr:-Iu4QKWfapgYurSypiE8Oa1ZdOyK8lC2BLytkihEd-b5QwWtd-szKPuncudIbUUQ9wHMhZk-cbzTsEUxS4QiTtrYKPwBgmlkgnY0gmlwhMCoZGWJc2VjcDI1NmsxoQJEdmi_LPA0b8j2BHHDsyGi_Y086wDplSGNVe96M4sWnIN0Y3CCIyiDdWRwgiMo \ No newline at end of file diff --git a/bundlers/silius/p2p-boot/node-key b/bundlers/silius/p2p-boot/node-key new file mode 100644 index 0000000..b2d8077 --- /dev/null +++ b/bundlers/silius/p2p-boot/node-key @@ -0,0 +1 @@ + ‚Å!4}ÍÏâ@;²ÍÓv‡Â|™ù rCç<ƒÏˆRdÕ \ No newline at end of file diff --git a/bundlers/silius/p2p-peer.yml b/bundlers/silius/p2p-peer.yml new file mode 100644 index 0000000..97cfa66 --- /dev/null +++ b/bundlers/silius/p2p-peer.yml @@ -0,0 +1,25 @@ +services: + bundler: + ports: [ "3001:3000" ] + image: ghcr.io/silius-rs/silius:latest + command: node + --eth-client-address $ETH_RPC_URL + --datadir data/silius + --mnemonic-file /root/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + --entry-points $ENTRYPOINT + --http --http.addr 0.0.0.0 + --http.port 3000 + --http.api eth,debug,web3 + --poll-interval "5" + --enable-p2p + --bootnodes $BOOT_ENR + --p2p.addr $BUNDLER2_IP + --p2p.baddr $BUNDLER2_IP + volumes: + - ./keys:/root + - ./p2p-peer:/data/silius/p2p + networks: + default: + p2p: + ipv4_address: $BUNDLER2_IP \ No newline at end of file diff --git a/bundlers/silius/p2p-peer/node-enr b/bundlers/silius/p2p-peer/node-enr new file mode 100644 index 0000000..6f46f19 --- /dev/null +++ b/bundlers/silius/p2p-peer/node-enr @@ -0,0 +1 @@ +enr:-Iu4QBIlfz_fSAGGmUkgPxFEvv_kgplO49l08Rg-la7v1zJoDYqvvatwDLl4Rk6xGXt0-OAd9Jakg-P8LNfPna-cvwABgmlkgnY0gmlwhMCoZGaJc2VjcDI1NmsxoQOKdUBFbAaoQIlmcvxyt2qn3yEwQK5fA3AUKElwyK1Zg4N0Y3CCIyiDdWRwgiMo \ No newline at end of file diff --git a/bundlers/silius/p2p-peer/node-key b/bundlers/silius/p2p-peer/node-key new file mode 100644 index 0000000..9a52ce5 --- /dev/null +++ b/bundlers/silius/p2p-peer/node-key @@ -0,0 +1,2 @@ + ÇÝ%#JÁ +…cÏ”u!ÆLʆI¿ªÃÖ%evêà \ No newline at end of file diff --git a/bundlers/silius/silius.yml b/bundlers/silius/silius.yml index 553e874..2168e55 100644 --- a/bundlers/silius/silius.yml +++ b/bundlers/silius/silius.yml @@ -8,7 +8,7 @@ services: - --datadir - data/silius - --mnemonic-file - - /root/${BUNDLER_ACCOUNT} + - /root/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 - --beneficiary - "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" - --entry-points diff --git a/runall.sh b/runall.sh index 6bbed23..21a5c47 100755 --- a/runall.sh +++ b/runall.sh @@ -64,8 +64,8 @@ if $root/runbundler/runbundler.sh $bundler pull-start; then echo "`date`: started bundler $bundler, name=$name" | tee -a $outraw case "$bundler" in - *yml) PYTEST_FOLDER=`getEnv $root/runbundler/runbundler.env PYTEST_FOLDER tests/single` ;; - *env) PYTEST_FOLDER=`getEnv $bundler PYTEST_FOLDER tests/p2p` ;; + *yml) PYTEST_FOLDER=`getEnv $root/runbundler/runbundler.env PYTEST_FOLDER tests/single` ; TEST_SUITE=test ;; + *env) PYTEST_FOLDER=`getEnv $bundler PYTEST_FOLDER tests/p2p` ; TEST_SUITE=p2ptest ;; esac OPTIONS=" @@ -74,7 +74,7 @@ if $root/runbundler/runbundler.sh $bundler pull-start; then $PYTEST_FOLDER " # --log-rpc - pdm run test -o junit_suite_name="$name" $OPTIONS "$@" | tee -a $outraw + pdm run $TEST_SUITE -o junit_suite_name="$name" $OPTIONS "$@" | tee -a $outraw test -r $outxml && xq . $outxml > $outjson fi diff --git a/runbundler/run2bundlers.yml b/runbundler/run2bundlers.yml index ca79140..136c495 100644 --- a/runbundler/run2bundlers.yml +++ b/runbundler/run2bundlers.yml @@ -50,33 +50,35 @@ services: file: $BUNDLER2_YML service: bundler depends_on: - bundler-waiter: + deployer: condition: service_completed_successfully bundler-waiter: - image: ghcr.io/foundry-rs/foundry:latest - command: - - "./waitForBundler $BUNDLER_URL" + image: curlimages/curl + command: "/waitForBundler $BUNDLER_URL" volumes: - ./runbundler/waiter/waitForBundler:/waitForBundler depends_on: - bundler: - condition: service_started + deployer: + condition: service_completed_successfully bundler-waiter2: - image: ghcr.io/foundry-rs/foundry:latest - command: - - "./waitForBundler $BUNDLER2_URL" + image: curlimages/curl + command: "/waitForBundler $BUNDLER2_URL" volumes: - ./runbundler/waiter/waitForBundler:/waitForBundler depends_on: - bundler2: - condition: service_started + deployer: + condition: service_completed_successfully wait-all: image: ghcr.io/foundry-rs/foundry:latest command: echo started depends_on: + bundler: + condition: service_started + bundler2: + condition: service_started bundler-waiter: condition: service_completed_successfully bundler-waiter2: diff --git a/tests/silius-silius.env b/tests/silius-silius.env new file mode 100644 index 0000000..bf0faf9 --- /dev/null +++ b/tests/silius-silius.env @@ -0,0 +1,4 @@ +export BUNDLER_YML=bundlers/silius/p2p-boot.yml +export BUNDLER2_YML=bundlers/silius/p2p-peer.yml + +export ENVFILE=bundlers/silius/.env \ No newline at end of file diff --git a/tests/silius-skandha.env b/tests/silius-skandha.env new file mode 100644 index 0000000..f3f62f2 --- /dev/null +++ b/tests/silius-skandha.env @@ -0,0 +1,5 @@ +export BUNDLER_YML=bundlers/silius/p2p-boot.yml +export BUNDLER2_YML=bundlers/skandha/p2p-peer.yml + +# the peer should use this enr to connect to +export ENVFILE=bundlers/silius/.env \ No newline at end of file diff --git a/tests/skandha-silius.env b/tests/skandha-silius.env new file mode 100644 index 0000000..5a58c59 --- /dev/null +++ b/tests/skandha-silius.env @@ -0,0 +1,6 @@ +export BUNDLER_YML=bundlers/skandha/p2p-boot.yml +export BUNDLER2_YML=bundlers/silius/p2p-peer.yml + +#the skanha env file defines the BOOT_ENR that is exposed by p2p-boot. +# the peer should use this enr to connect to +export ENVFILE=bundlers/skandha/.env \ No newline at end of file