Skip to content

Commit

Permalink
Chore/v1.1.1 debug spam (#497)
Browse files Browse the repository at this point in the history
* chore: add spam before snapshot

* chore: not run stateless

* chore: spam with second account

* chore: fix spamming source

* chore: cleanup

* chore: comments
  • Loading branch information
albert-llimos authored Feb 27, 2024
1 parent 0015c42 commit 469c9a3
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 9 deletions.
38 changes: 31 additions & 7 deletions .github/workflows/create-geth-arb-network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
runs-on: [self-hosted, linux, x64, ephemeral]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3
Expand Down Expand Up @@ -100,12 +100,12 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: ${{ inputs.tag }}

- name: Checkout chainflip-backend @ ${{ inputs.chainflip_backend_ref }}
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
token: ${{ secrets.CF_GITHUB_BOT_READONLY_BACKEND_REPO }}
repository: chainflip-io/chainflip-backend
Expand Down Expand Up @@ -188,7 +188,7 @@ jobs:
- build-geth-state
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Checkout chainflip-io/nitro-testnode @ ${{ inputs.nitro_testnodes_ref }}
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
Expand All @@ -200,7 +200,7 @@ jobs:
submodules: true

- name: Checkout chainflip-backend @ ${{ inputs.chainflip_backend_ref }}
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
token: ${{ secrets.CF_GITHUB_BOT_READONLY_BACKEND_REPO }}
repository: chainflip-io/chainflip-backend
Expand Down Expand Up @@ -244,6 +244,30 @@ jobs:
./test-node.bash script send-l2 --to address_0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --ethamount 10000
./test-node.bash script send-l2 --to address_0x70997970C51812dc3A010C7d01b50e0d17dc79C8 --ethamount 10000
# Spamming Arbitrum so the final state contains all the previous funding transactions

- name: Install Python virtualenv
run: pip install virtualenv

- name: Setup Node
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
with:
node-version: "16"

- name: Install Poetry
uses: snok/install-poetry@93ada01c735cc8a383ce0ce2ae205a21c415379b

- run: npm install --global ganache-cli
- run: npm install --global yarn
- run: yarn
- run: poetry install

- name: Add the network
run: poetry run brownie networks add Ethereum arb-l2 host=http://localhost:8547 chainid=412346

- name: Spam txs
run: poetry run brownie run spam_txs --network arb-l2

- name: Stop Containers
run: |
# Stop ARB containers in order to preserve a clean state
Expand Down Expand Up @@ -284,7 +308,7 @@ jobs:
runs-on: [self-hosted, linux, x64, ephemeral]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Set up QEMU ⚙️
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3
Expand Down Expand Up @@ -346,7 +370,7 @@ jobs:
runs-on: [self-hosted, linux, x64, ephemeral]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Set up QEMU ⚙️
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/stateless-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
name: Stateless Tests
on: push
on:
pull_request:
branches:
- master
types: [opened, synchronize]
push:
branches:
- master

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand All @@ -15,7 +22,7 @@ jobs:
timeout-minutes: 360
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Install Python virtualenv
run: pip install virtualenv
Expand Down
18 changes: 18 additions & 0 deletions scripts/spam_txs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os
from brownie import accounts, network

AUTONOMY_SEED = os.environ["SEED"]
cf_accs = accounts.from_mnemonic(AUTONOMY_SEED, count=10)
# Use the second account for the initial spamming
DEPLOYER_ACCOUNT_INDEX = 1

DEPLOYER = cf_accs[DEPLOYER_ACCOUNT_INDEX]
print(f"DEPLOYER = {DEPLOYER}")
network.priority_fee("1 gwei")

NUM_SPAM_TXS = 100


def main():
for _ in range(NUM_SPAM_TXS):
DEPLOYER.transfer(DEPLOYER, "1 ether")

0 comments on commit 469c9a3

Please sign in to comment.