Skip to content

Commit

Permalink
chore: add spam before snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
albert-llimos committed Feb 24, 2024
1 parent 19fde2b commit b6b6bd7
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 7 deletions.
39 changes: 32 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,31 @@ jobs:
./test-node.bash script send-l2 --to address_0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --ethamount 10000
./test-node.bash script send-l2 --to address_0x70997970C51812dc3A010C7d01b50e0d17dc79C8 --ethamount 10000
############### Add spamming of the network here ###############
- 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 +309,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 +371,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
24 changes: 24 additions & 0 deletions scripts/spam_txs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import sys
import os

sys.path.append(os.path.abspath("tests"))
from shared_tests import *
from utils import prompt_user_continue_or_break
from consts import *
from brownie import accounts, network

AUTONOMY_SEED = os.environ["SEED"]
cf_accs = accounts.from_mnemonic(AUTONOMY_SEED, count=10)
DEPLOYER_ACCOUNT_INDEX = int(os.environ.get("DEPLOYER_ACCOUNT_INDEX") or 0)

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

# NUM_SPAM_TXS = int(os.environ["NUM_SPAM_TXS"])
NUM_SPAM_TXS = 100


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

0 comments on commit b6b6bd7

Please sign in to comment.