Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a0ae824
Add devnet test for batcher restart
jbearer Aug 7, 2025
616dcca
Check error returns
jbearer Aug 7, 2025
1fc52de
Separate op-geth instances for each L2 node
jbearer Aug 13, 2025
b01792f
Build devnet dockers in CI
jbearer Aug 13, 2025
6470fb7
Build op-deployer in CI
jbearer Aug 13, 2025
7dfd4f4
Try larger runner
jbearer Aug 13, 2025
7c35059
Increase test outage and recovery time
jbearer Aug 13, 2025
c87223c
Try to speed up transaction verification
jbearer Aug 13, 2025
c7ef32e
Do not drop batches before we have seen a finalized L1 block
jbearer Aug 14, 2025
23fd979
Remove unnecessary sleep
jbearer Aug 14, 2025
84430ee
Add scripts for demo and documentation
shenkeyao Aug 15, 2025
d1e47cd
Build containers in dependency order
jbearer Aug 18, 2025
b54ff4c
Don't copy config file into Docker image at build time
jbearer Aug 18, 2025
8ba82f9
Fix syntax
shenkeyao Aug 18, 2025
b5e1b91
Checkout submodules in CI
jbearer Aug 18, 2025
1892c97
Don't copy config file into Docker image at build time
jbearer Aug 18, 2025
8fa0034
Remove another COPY
shenkeyao Aug 18, 2025
8c968a1
Run devnet test in separate workflow
jbearer Aug 18, 2025
6c33fe9
Add exposed ports for more nodes in docker-compose
Ayiga Aug 18, 2025
71e03ed
Fix CAFF environment variables
Ayiga Aug 18, 2025
58a4bf4
Set `caff.node` to `true` for `caff-node`
Ayiga Aug 18, 2025
67bd454
Support alias and input check
shenkeyao Aug 18, 2025
332a89f
Merge branch 'keyao/demo' of github.com:EspressoSystems/optimism-espr…
shenkeyao Aug 18, 2025
4f0a009
Add scripts and instructions for running utility script
Ayiga Aug 19, 2025
65c06ea
Merge branch 'jb/ta1-batcher-restart' into keyao/demo
shenkeyao Aug 19, 2025
f6d4e68
Update scripts after separating geth
shenkeyao Aug 19, 2025
e725939
Merge branch 'keyao/demo' of github.com:EspressoSystems/optimism-espr…
shenkeyao Aug 19, 2025
f14a392
Merge branch 'celo-integration-rebase-13.2' into keyao/demo
shenkeyao Aug 19, 2025
c7a9279
Update readme
shenkeyao Aug 19, 2025
7f49c1e
tmux in flake.nix
philippecamacho Aug 19, 2025
106b4af
Update shell being targeted in get_sync_status.sh
Ayiga Aug 19, 2025
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
86 changes: 85 additions & 1 deletion README_ESPRESSO.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ docker compose down -v
docker volume prune -a
```

* If you have changed OP contracts, you will have to start the devnet fresh and re-generate
* If you have changed OP contracts, you will have to start the devnet fresh and re-generate
the genesis allocations by running `prepare-allocs.sh`


Expand Down Expand Up @@ -380,3 +380,87 @@ In order to refresh this AMI one needs to:
1. Create an AWS EC2 instance with the characteristics described in (see `.github/workflows/enclave.yaml` *Launch EC2 Instance* job).
2. Copy the script `espresso/scrips/enclave-prepare-ami.sh` in the EC2 instance (e.g. using scp) and run it.
3. [Export the AMI instance](https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/tkv-create-ami-from-instance.html).

## Demo to Celo
For convenience some scripts have been added to make it easier to showcase the
results, and monitor the progress of the docker compose file. The primary
script concerns evaluating `optimism_syncStatus` and displaying the results.

This script requires the commands `tmux`, and `watch` to be installed and
in the `PATH`. Check to see if you have them, and if you don't, be sure to
install them using whatever method you deem necessary in order to run the
script.

After that has been done you should be able to spin up the simple script
using the following command:
```console
./espresso/scripts/demo_tmux_get_sync_status.sh
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I run this script I get "sh: 1: ./get_sync_status.sh: not found ".

```

This will launch a `tmux` session setup with a script to automatically
query and display the `optimism_syncStatus` result for the `sequencer`,
`verifier`, and `caff-node`.

It assumes that the `docker-file.yml` is being run with the default values
and will attempt to connect to them as needed.

If you're not used to `tmux` you should be able to disconnect from the session
using `<C-b> d`. This only detaches from the session, the session will still
exist and be running in the background. You can kill the session using the
following command:
```console
tmux kill-session
```

Or you can reattach to it using this command instead:
```console
tmux attach
```

If you want to target different RPC endpoints for optimism, if you're not
running the local demo, and want to target the remote, you can always
specify environment variables before running the script:
```console
OP_RPC_SEQUENCER=http://sequencer.example.com:4545 \
OP_RPC_VERIFIER=http://verifier.example.com:4545 \
OP_RPC_CAFF=http://caff.example.com:4545 \
./espresso/scripts/demo_tmux_get_sync_status.sh
```

### Prepare for the Demo
* Go to the scripts directory.
```console
cd espresso/scripts
```
* Allow access to scripts.
```console
chmod +x startup.sh
chmod +x logs.sh
chmod +x shutdown.sh
```

### Prebuild Everything and Start All Services
Note that `l2-genesis` is expected to take around 2 minutes.
```console
./startup.sh
```

### View Logs
There are 15 services in total, as listed in `logs.sh`. It is supported to run logs for any
service, but we may want to show logs selectively, e.g., by running the following commands one by
one. Note that some service names are replaced by more convenient alias, but it is also suported to
use their full names.
```console
./logs.sh l1-geth
./logs.sh dev-node
./logs.sh op-geth-sequencer
./logs.sh sequencer
./logs.sh verifier
./logs.sh caff-node
./logs.sh batcher
```

### Shut Down All Services
```console
./shutdown.sh
```
2 changes: 2 additions & 0 deletions espresso/.env
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ L1_HTTP_PORT=8545
L1_BEACON_PORT=5052

ROLLUP_PORT=9545
VERIFIER_PORT=9546
CAFF_PORT=9547

OP_ENGINE_PORT=8552
OP_HTTP_PORT=8546
Expand Down
2 changes: 1 addition & 1 deletion espresso/devnet-tests/devnet_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (d *Devnet) Up() (err error) {
}()

// Open RPC clients for the different nodes.
d.L2Seq, err = d.serviceClient("op-geth-seq", 8546)
d.L2Seq, err = d.serviceClient("op-geth-sequencer", 8546)
if err != nil {
return err
}
Expand Down
33 changes: 21 additions & 12 deletions espresso/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ services:
environment:
- MODE=rollup
- L1_RPC=http://l1-geth:${L1_HTTP_PORT:?err}
- OP_RPC=http://op-geth-seq:${OP_HTTP_PORT:?err}
- OP_RPC=http://op-geth-sequencer:${OP_HTTP_PORT:?err}
depends_on:
l1-geth:
condition: service_healthy
l1-genesis:
condition: service_completed_successfully
op-geth-seq:
op-geth-sequencer:
condition: service_healthy
volumes:
- ./deployment/l2-config:/config
Expand All @@ -136,7 +136,7 @@ services:
- ./deployment/l2-config:/config
- ./deployment/deployer:/deployer:ro

op-geth-seq:
op-geth-sequencer:
extends:
file: docker-compose-op-geth.yml
service: op-geth
Expand Down Expand Up @@ -166,16 +166,17 @@ services:
depends_on:
l2-rollup:
condition: service_completed_successfully
op-geth-seq:
op-geth-sequencer:
condition: service_healthy
l1-validator:
condition: service_started
environment:
CAFF_L1_ETH_RPC: http://l1-geth:${L1_HTTP_PORT}
OP_NODE_L1_ETH_RPC: http://l1-geth:${L1_HTTP_PORT}
OP_NODE_L1_BEACON: http://l1-beacon:${L1_BEACON_PORT}
OP_NODE_L2_ENGINE_RPC: http://op-geth-seq:${OP_ENGINE_PORT}
OP_NODE_L2_ENGINE_RPC: http://op-geth-sequencer:${OP_ENGINE_PORT}
OP_NODE_RPC_PORT: ${ROLLUP_PORT}
ports:
- "${ROLLUP_PORT}:${ROLLUP_PORT}"
volumes:
- ./deployment/l2-config:/config:ro
- /etc/localtime:/etc/localtime:ro
Expand Down Expand Up @@ -208,12 +209,16 @@ services:
OP_NODE_L1_ETH_RPC: http://l1-geth:${L1_HTTP_PORT}
OP_NODE_L1_BEACON: http://l1-beacon:${L1_BEACON_PORT}
OP_NODE_L2_ENGINE_RPC: http://op-geth-verifier:${OP_ENGINE_PORT}
OP_NODE_RPC_PORT: ${VERIFIER_PORT}
ports:
- "${VERIFIER_PORT}:${VERIFIER_PORT}"
volumes:
- ./deployment/l2-config:/config:ro
command:
- op-node
- --l2.jwt-secret=/config/jwt.txt
- --rollup.config=/config/rollup.json
- --rpc.addr=0.0.0.0
- --l1.http-poll-interval=1s
- --l1.epoch-poll-interval=1s
- --p2p.disable=true
Expand All @@ -232,20 +237,24 @@ services:
l2-rollup:
condition: service_completed_successfully
environment:
CAFF_L1_ETH_RPC: http://l1-geth:${L1_HTTP_PORT}
OP_NODE_L1_ETH_RPC: http://l1-geth:${L1_HTTP_PORT}
OP_NODE_L1_BEACON: http://l1-beacon:${L1_BEACON_PORT}
OP_NODE_L2_ENGINE_RPC: http://op-geth-caff-node:${OP_ENGINE_PORT}
CAFF_ESPRESSO_LIGHT_CLIENT_ADDR: "0x703848f4c85f18e3acd8196c8ec91eb0b7bd0797"
CAFF_HOTSHOT_URLS: http://espresso-dev-node:${ESPRESSO_SEQUENCER_API_PORT},http://espresso-dev-node:${ESPRESSO_SEQUENCER_API_PORT}
OP_NODE_CAFF_L1_ETH_RPC: http://l1-geth:${L1_HTTP_PORT}
OP_NODE_CAFF_ESPRESSO_LIGHT_CLIENT_ADDR: "0x703848f4c85f18e3acd8196c8ec91eb0b7bd0797"
OP_NODE_CAFF_HOTSHOT_URLS: http://espresso-dev-node:${ESPRESSO_SEQUENCER_API_PORT},http://espresso-dev-node:${ESPRESSO_SEQUENCER_API_PORT}
OP_NODE_RPC_PORT: ${CAFF_PORT}
ports:
- "${CAFF_PORT}:${CAFF_PORT}"
volumes:
- ./deployment/l2-config:/config:ro
command:
- op-node
- --l2.jwt-secret=/config/jwt.txt
- --rollup.config=/config/rollup.json
- --caff.node=true
- --rpc.addr=0.0.0.0
- --sequencer.enabled=false
- --caff.node=true
- --verifier.l1-confs=0
- --rollup.load-protocol-versions=false
- --rollup.halt=none
Expand All @@ -269,7 +278,7 @@ services:
depends_on:
l1-geth:
condition: service_healthy
op-geth-seq:
op-geth-sequencer:
condition: service_started
op-node-sequencer:
condition: service_started
Expand All @@ -280,7 +289,7 @@ services:
environment:
L1_RPC: http://l1-geth:${L1_HTTP_PORT}
OP_BATCHER_L1_ETH_RPC: http://l1-geth:${L1_HTTP_PORT}
OP_BATCHER_L2_ETH_RPC: http://op-geth-seq:${OP_HTTP_PORT}
OP_BATCHER_L2_ETH_RPC: http://op-geth-sequencer:${OP_HTTP_PORT}
OP_BATCHER_ROLLUP_RPC: http://op-node-sequencer:${ROLLUP_PORT}
OP_BATCHER_ESPRESSO_URL: http://espresso-dev-node:${ESPRESSO_SEQUENCER_API_PORT},http://espresso-dev-node:${ESPRESSO_SEQUENCER_API_PORT}
volumes:
Expand Down
2 changes: 1 addition & 1 deletion espresso/docker/op-geth/op-geth-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if [ "$MODE" = "genesis" ]; then
--data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["finalized", false],"id":1}' \
"$L1_RPC" | jq -r '.result.number')

if [[ -z "$$finalized_block" || "$$finalized_block" == "null" ]]; then
if [[ -z "$finalized_block" || "$finalized_block" == "null" ]]; then
echo "No finalized block yet, waiting..."
sleep 3
continue
Expand Down
24 changes: 24 additions & 0 deletions espresso/scripts/demo_tmux_get_sync_status.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

OP_RPC_SEQUENCER=${OP_RPC_SEQUENCER:-http://localhost:9545}
OP_RPC_VERIFIER=${OP_RPC_VERIFIER:-http://localhost:9546}
OP_RPC_CAFF=${OP_RPC_CAFF:-http://localhost:9547}

set -euC pipefail

# Change the current directory to the script's directory
cd "$(dirname "$0")"

# If the tmux session already exists, we will attach to it.
if tmux has-session -t '=get_sync_status' 2>/dev/null; then
echo "Tmux session 'get_sync_status' already exists. Exiting."
tmux kill-session -t get_sync_status || true
fi

# Create a new tmux session, detached, named "get_sync_status"
tmux new-session -d -s get_sync_status \; \
send-keys "NODE_NAME=sequencer RPC_ADDRESS=$OP_RPC_SEQUENCER watch -p -n 1 -c -d ./get_sync_status.sh" ENTER \; \
split-window -h "NODE_NAME=verifier RPC_ADDRESS=$OP_RPC_VERIFIER watch -p -n 1 -c -d ./get_sync_status.sh" \; \
split-window -h "NODE_NAME=caff-node RPC_ADDRESS=$OP_RPC_CAFF watch -p -n 1 -c -d ./get_sync_status.sh" \; \
select-layout even-horizontal \; \
attach
36 changes: 36 additions & 0 deletions espresso/scripts/get_sync_status.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
# This is a convenience script to fetch data from the optimism node for
# "optimism_syncStatus" RPC method.

echo "NODE $NODE_NAME"
JSON_DATA=$(curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"optimism_syncStatus","params":[],"id":1}' $RPC_ADDRESS 2>/dev/null)

# Make sure the the RPC call was successful
if [ $? -ne 0 ]; then
echo "Failed to connect to $RPC_ADDRESS"
exit 1
fi


# Store the results for easier processing
RESULT=$(echo $JSON_DATA | jq .result)

# Extract and print some fields from the JSON response
output_block_details() {
BLOCK=$(echo $RESULT | jq -r .$1)
echo "$1: ($(echo $BLOCK | jq -r .number))"
echo " hash: $(echo $BLOCK | jq -r .hash)"
echo " parentHash: $(echo $BLOCK | jq -r .parentHash)"
echo " timestamp: $(echo $BLOCK | jq -r .timestamp)"
}

# Output the block details in a simple format
output_block_details "current_l1"
output_block_details "current_l1_finalized"
output_block_details "head_l1"
output_block_details "safe_l1"
output_block_details "finalized_l1"
echo
output_block_details "unsafe_l2"
output_block_details "safe_l2"
output_block_details "finalized_l2"
Loading
Loading