Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions .github/workflows/kurtosis_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
# Run nightly at 00:00 UTC
schedule:
- cron: '0 0 * * *'
push:
branches:
- main
pull_request:
branches:
- main

jobs:
integration-tests:
Expand All @@ -21,18 +27,28 @@ jobs:
with:
toolchain: stable
profile: minimal

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install Just
uses: taiki-e/install-action@just

- name: Install Contender
run: |
sudo apt-get update
sudo apt-get install -y libsqlite3-dev libfontconfig1-dev libfontconfig
./scripts/ci/kurtosis.sh install-contender
./scripts/ci/stress.sh install-contender

- name: Install Kurtosis
run: ./scripts/ci/kurtosis.sh install

- name: Deploy Optimism Package
run: ./scripts/ci/kurtosis.sh deploy
run: ./scripts/ci/stress.sh install

- name: Deploy Devnet
run: |
kurtosis analytics disable
just devnet-up

- name: Run Integration Tests
run: ./scripts/ci/kurtosis.sh run
run: just stress-test
15 changes: 15 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
devnet-up: build spawn

devnet-down:
kurtosis enclave rm -f op-rollup-boost
kurtosis clean

stress-test:
chmod +x ./scripts/ci/stress.sh \
&& ./scripts/ci/stress.sh run

build:
docker buildx build -t flashbots/rollup-boost:develop .

spawn:
kurtosis run github.com/ethpandaops/optimism-package --args-file ./scripts/ci/kurtosis-params.yaml --enclave op-rollup-boost
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,26 @@ To run rollup-boost in debug mode with a specific execution mode, you can use th
rollup-boost debug set-execution-mode [enabled|dry-run|disabled]
```

### Rollup Boost Devnet
To run rollup-boost in an op-stack devnet first make sure you have [just](https://github.com/casey/just), and [kurtosis-cli](https://docs.kurtosis.com/install/) installed.

Then run the following command to start the devnet:
```sh
just devnet-up
```

To stop the devnet run:
```sh
just devnet-down
```

To run a stress test against the devnet with [contender](https://github.com/flashbots/contender) first make sure you have contender installed.

Then run the following command:
```sh
just stress-test
```

## License

The code in this project is free software under the [MIT License](/LICENSE).
Expand Down
18 changes: 14 additions & 4 deletions scripts/ci/kurtosis-params.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
optimism_package:
observability:
enabled: true
chains:
- participants:
- el_type: op-geth
el_image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101500.0
el_builder_image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101500.0
el_builder_type: op-reth
cl_builder_type: op-node
network_params:
network: "kurtosis"
additional_services: ["rollup-boost"]
fund_dev_accounts: true
seconds_per_slot: 2
fjord_time_offset: 0
granite_time_offset: 0
# isthmus_time_offset: 0
fund_dev_accounts: true
mev_params:
rollup_boost_image: "flashbots/rollup-boost:0.3rc4"
rollup_boost_image: "flashbots/rollup-boost:develop"
additional_services:
- rollup-boost
- blockscout
ethereum_package:
participants:
- el_type: geth
Expand Down
34 changes: 15 additions & 19 deletions scripts/ci/kurtosis.sh → scripts/ci/stress.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -exu

install() {
# https://docs.kurtosis.com/install/
echo "Installing Kurtosis..."
Expand All @@ -21,27 +23,24 @@ install_contender() {
cargo install --git https://github.com/flashbots/contender --bin contender --force
}

deploy() {
# Run the kurtosis optimism package
echo "Running Kurtosis..."
kurtosis analytics disable
kurtosis run github.com/ethpandaops/optimism-package --args-file ./scripts/ci/kurtosis-params.yaml
}

run() {
# Note we use `rollup-boost` in combination with `op-geth-builder` as the JSON RPC servers to assert transaction relaying functionality
# as well as inclusion of transactions that have only been sent to the builder (verifying the builder's payloads are being included in the canonical chain)

# Execute 100 transfer transactions sent directly to the builder
# Only if the builder is running and connected to the network with rollup-boost
# the transactions will be included in the canonical blocks and finalized.

# Figure out first the builder's JSON-RPC URL
L2_PORT=$(docker inspect --format='{{(index .NetworkSettings.Ports "8545/tcp" 0).HostPort}}' $(docker ps --filter "name=op-el-builder-" -q))

ROLLUP_BOOST_SOCKET=$(kurtosis port print op-rollup-boost op-rollup-boost-1-op-kurtosis rpc)
OP_RETH_BUILDER_SOCKET=$(kurtosis port print op-rollup-boost op-el-builder-1-op-reth-op-node-op-kurtosis rpc)

# Private key with prefunded balance
PREFUNDED_PRIV_KEY=0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
PREFUNDED_ADDRESS=$(cast wallet address --private-key $PREFUNDED_PRIV_KEY)

# Safe check to ensure there is balance in the prefunded address
BALANCE=$(cast balance --rpc-url http://localhost:$L2_PORT $PREFUNDED_ADDRESS)
BALANCE=$(cast balance --rpc-url $ROLLUP_BOOST_SOCKET $PREFUNDED_ADDRESS)

# We have to check for "0" string because it is returned in wei and the value is too big to compare as a number
if [ "$BALANCE" = "0" ]; then
Expand All @@ -50,16 +49,16 @@ run() {
else
echo "✅ Prefunded address has balance"
fi

# Download the scenario for contender
wget https://raw.githubusercontent.com/flashbots/contender/refs/heads/main/scenarios/stress.toml -O /tmp/scenario.toml
wget https://raw.githubusercontent.com/flashbots/contender/refs/heads/main/scenarios/stress.toml -O "/tmp/scenario.toml"

# Deploy the contract with contender, this should be enough to check that the
# builder is working as expected
# I have not managed to send a working transaction with cast yet. That should replace
# this setup eventually since we are only testing if a single transaction is included
# in the canonical chain.
contender setup -p $PREFUNDED_PRIV_KEY /tmp/scenario.toml http://localhost:$L2_PORT
contender setup -p $PREFUNDED_PRIV_KEY "/tmp/scenario.toml" $ROLLUP_BOOST_SOCKET

# Run the scenario on the builder
contender run -p $PREFUNDED_PRIV_KEY fill-block $OP_RETH_BUILDER_SOCKET
}

clean() {
Expand All @@ -76,9 +75,6 @@ case "$1" in
"install-contender")
install_contender
;;
"deploy")
deploy
;;
"run")
run
;;
Expand Down
Loading