-
Notifications
You must be signed in to change notification settings - Fork 90
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 #149 from 0xPolygon/jhilliard-uncessary-l1-dep
Minor changes to better support external L1
- Loading branch information
Showing
21 changed files
with
1,102 additions
and
511 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 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 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 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 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 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 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,44 +1,87 @@ | ||
* Connect Directly to Container Network | ||
|
||
#+begin_src bash | ||
export ETH_RPC_URL="$(kurtosis port print cdk-v1 el-1-geth-lighthouse rpc)" | ||
docker run -it --net=container:f0ce09999e30 nicolaka/netshoot:latest /bin/bash | ||
#+end_src | ||
|
||
kurtosis files download cdk-v1 zkevm /tmp | ||
pol_addr=$(cat /tmp/zkevm/combined.json | jq -r '.polTokenAddress') | ||
rollup_addr=$(cat /tmp/zkevm/combined.json | jq -r '.rollupAddress') | ||
* Chaos | ||
|
||
cast call $pol_addr 'balanceOf(address)(uint256)' 0x5b06837A43bdC3dD9F114558DAf4B26ed49842Ed | ||
#+begin_src bash | ||
docker run --rm --name dsapp --network kt-cdk-v1 -it -v $PWD:/app ubuntu:latest /bin/bash | ||
|
||
# do an approval for spend | ||
cast send --private-key 0x183c492d0ba156041a7f31a1b188958a7a22eebadca741a7fe64436092dc3181 $pol_addr 'mint(address,uint256)' $rollup_addr 10000000000000000000000000 | ||
#inside container | ||
apt update | ||
apt install iproute2 curl | ||
cd app | ||
./dsapp client --server zkevm-node-sequencer-001:6900 | ||
|
||
# pumba | ||
./.bin/github.com/alexei-led/pumba netem --duration 5m rate --rate 10bit dsapp | ||
./.bin/github.com/alexei-led/pumba netem --duration 1m delay --time 100000 dsapp | ||
./.bin/github.com/alexei-led/pumba pause --duration 1m dsapp | ||
#+end_src | ||
|
||
* Interruption | ||
|
||
#+begin_src bash | ||
export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-trusted-rpc-001 http-rpc)" | ||
cast rpc zkevm_batchNumber | ||
cast rpc zkevm_virtualBatchNumber | ||
cast rpc zkevm_verifiedBatchNumber | ||
#+end_src | ||
|
||
Check DAC and Sequencing | ||
#+begin_src bash | ||
kurtosis files download cdk-v1 zkevm /tmp | ||
cast call --rpc-url $(kurtosis port print cdk-v1 el-1-geth-lighthouse rpc) $(jq -r .rollupAddress /tmp/zkevm/combined.json) 'dataAvailabilityProtocol()(address)' | ||
cast call --rpc-url $(kurtosis port print cdk-v1 el-1-geth-lighthouse rpc) $(jq -r .polygonDataCommitteeAddress /tmp/zkevm/combined.json) 'requiredAmountOfSignatures()(uint256)' | ||
docker run --rm --name dsapp --network kt-cdk-v1 -it -v $PWD:/app ubuntu:latest /bin/bash | ||
cd app | ||
./dsapp relay --server zkevm-node-sequencer-001:6900 | ||
|
||
cat *.json | jq '.abi[] | select(.type != "receive")' | jq -s | polycli abi decode | sort -t: -k3 -u | ||
docker run -it --net=container:f0ce09999e30 nicolaka/netshoot:latest /bin/bash | ||
docker network inspect kt-cdk-v1 | ||
|
||
client_ip="172.16.0.19" | ||
server_ip="172.16.0.15" | ||
|
||
# Drop | ||
sudo iptables -I DOCKER -s $client_ip -d $server_ip -j DROP | ||
sudo iptables -I DOCKER -s $server_ip -d $client_ip -j DROP | ||
|
||
# Restore | ||
sudo iptables -D DOCKER -s $client_ip -d $server_ip -j DROP | ||
sudo iptables -D DOCKER -s $server_ip -d $client_ip -j DROP | ||
|
||
docker run -it --net=container:zkevm-prover-001--620987a8d7e44c60a3bc8a8742025635 nicolaka/netshoot:latest /bin/bash | ||
|
||
sudo /usr/sbin/tcpkill -i br-edd588fc6880 host $client_ip and host $server_ip | ||
#+end_src | ||
|
||
* Slow Outbound from Sequencer | ||
|
||
Confirm that we're on the correct fork | ||
#+begin_src bash | ||
export ETH_RPC_URL="$(kurtosis port print cdk-v1 el-1-geth-lighthouse rpc)" | ||
cast call 0x2F50ef6b8e8Ee4E579B17619A92dE3E2ffbD8AD2 'rollupIDToRollupData(uint32)(address,uint64,address,uint64,bytes32,uint64,uint64,uint64,uint64,uint64,uint64,uint8)' 1 | ||
docker run -it --rm --name seqshoot --net=container:zkevm-node-sequencer-001--ede742f7c75e4d8d860c2a54756df797 nicolaka/netshoot:latest /bin/bash | ||
./.bin/github.com/alexei-led/pumba netem --duration 1m --egress-port 6900 rate --rate 10bit seqshoot | ||
#+end_src | ||
* Chaos | ||
|
||
* Determine interface | ||
|
||
From inside the container we'll need to get the details of the link: | ||
|
||
#+begin_src bash | ||
apt install iproute2 | ||
ip link show eth0 | ||
#+end_src | ||
|
||
#+begin_example | ||
294: eth0@if295: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1440 qdisc noqueue state UP mode DEFAULT group default | ||
link/ether 02:42:ac:10:00:11 brd ff:ff:ff:ff:ff:ff link-netnsid 0 | ||
#+end_example | ||
|
||
In this case 294 is the ifindex for the interface within the | ||
container. ~eth0@if295~ indicates that this interface is iflink. | ||
|
||
From the host OS, I can run: | ||
|
||
#+begin_src bash | ||
ip link | grep ^295 | ||
#+end_src | ||
|
||
#+begin_example | ||
295: veth39145be@if294: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1440 qdisc noqueue master br-edd588fc6880 state UP mode DEFAULT group default | ||
#+end_example | ||
|
||
Now I have the interface name ~br-edd588fc6880~ and I can use that for | ||
~tcpdump~, ~tcpkill~ and things like that | ||
|
||
https://github.com/torvalds/linux/blob/55027e689933ba2e64f3d245fb1ff185b3e7fc81/Documentation/ABI/testing/sysfs-class-net#L188-L207 | ||
|
Oops, something went wrong.