Skip to content

Commit

Permalink
Skandha<->Silius p2p tests (#45)
Browse files Browse the repository at this point in the history
* fix: silius add missing parameter

* feat: silius p2p
  • Loading branch information
Vid201 authored May 12, 2024
1 parent d1dd26c commit 49df562
Show file tree
Hide file tree
Showing 14 changed files with 97 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion bundlers/silius/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BUNDLER_ACCOUNT=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
BOOT_ENR=enr:-Iu4QKWfapgYurSypiE8Oa1ZdOyK8lC2BLytkihEd-b5QwWtd-szKPuncudIbUUQ9wHMhZk-cbzTsEUxS4QiTtrYKPwBgmlkgnY0gmlwhMCoZGWJc2VjcDI1NmsxoQJEdmi_LPA0b8j2BHHDsyGi_Y086wDplSGNVe96M4sWnIN0Y3CCIyiDdWRwgiMo
33 changes: 33 additions & 0 deletions bundlers/silius/p2p-boot.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions bundlers/silius/p2p-boot/node-enr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enr:-Iu4QKWfapgYurSypiE8Oa1ZdOyK8lC2BLytkihEd-b5QwWtd-szKPuncudIbUUQ9wHMhZk-cbzTsEUxS4QiTtrYKPwBgmlkgnY0gmlwhMCoZGWJc2VjcDI1NmsxoQJEdmi_LPA0b8j2BHHDsyGi_Y086wDplSGNVe96M4sWnIN0Y3CCIyiDdWRwgiMo
1 change: 1 addition & 0 deletions bundlers/silius/p2p-boot/node-key
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
 ��!4}���@;���v��|�� rC�<�ψRd�
25 changes: 25 additions & 0 deletions bundlers/silius/p2p-peer.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions bundlers/silius/p2p-peer/node-enr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enr:-Iu4QBIlfz_fSAGGmUkgPxFEvv_kgplO49l08Rg-la7v1zJoDYqvvatwDLl4Rk6xGXt0-OAd9Jakg-P8LNfPna-cvwABgmlkgnY0gmlwhMCoZGaJc2VjcDI1NmsxoQOKdUBFbAaoQIlmcvxyt2qn3yEwQK5fA3AUKElwyK1Zg4N0Y3CCIyiDdWRwgiMo
2 changes: 2 additions & 0 deletions bundlers/silius/p2p-peer/node-key
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
 ǁ�%#J�
�c��u!��LʆI����%ev��
2 changes: 1 addition & 1 deletion bundlers/silius/silius.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
- --datadir
- data/silius
- --mnemonic-file
- /root/${BUNDLER_ACCOUNT}
- /root/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
- --beneficiary
- "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
- --entry-points
Expand Down
6 changes: 3 additions & 3 deletions runall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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="
Expand All @@ -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
Expand Down
24 changes: 13 additions & 11 deletions runbundler/run2bundlers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions tests/silius-silius.env
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions tests/silius-skandha.env
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions tests/skandha-silius.env
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 49df562

Please sign in to comment.