Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c750bda
feat: add Docker support for running upgrade scripts
yahgwai Feb 5, 2026
1f0f4f3
chore: add .DS_Store to gitignore
yahgwai Feb 5, 2026
eea7623
fix: use Yarn Classic (v1) in Dockerfile for lockfile compatibility
yahgwai Feb 5, 2026
c5948fa
fix: add submodule checkout for Docker build
yahgwai Feb 5, 2026
4c8edb8
fix: use forge install instead of git submodules for Docker build prereq
yahgwai Feb 5, 2026
9cb07c5
Update README.md
yahgwai Feb 5, 2026
c445d7d
feat: add browsable CLI for upgrade scripts
yahgwai Feb 6, 2026
15b87cf
feat: add Verify scripts for contract upgrades
yahgwai Feb 9, 2026
a8adfeb
ci: add Docker Hub publishing workflow
yahgwai Feb 9, 2026
4d391f9
refactor: rewrite CLI in TypeScript
yahgwai Feb 9, 2026
c5520f7
refactor: remove obvious comments and add named constants
yahgwai Feb 9, 2026
c93b86f
fix: update docker tests and eslint config for TS CLI
yahgwai Feb 9, 2026
92fbc31
test: add local smoke tests for CLI
yahgwai Feb 9, 2026
e3addac
docs: reorganize README with CLI and Docker sections
yahgwai Feb 9, 2026
596182b
refactor: simplify env loading to current directory only
yahgwai Feb 10, 2026
9dc0108
refactor: extract duplicate execute/verify logic in arbos-upgrade
yahgwai Feb 10, 2026
6dd231f
refactor: remove unused Commander subcommands
yahgwai Feb 10, 2026
aaa6eea
build: pin Foundry to specific nightly version
yahgwai Feb 10, 2026
ead0814
chore: remove obvious Dockerfile comments
yahgwai Feb 10, 2026
7977435
fix: correct Foundry version pin and lint issues
yahgwai Feb 10, 2026
2f30dde
revert: remove Foundry version pin that fails in Docker
yahgwai Feb 10, 2026
05c1282
Merge remote-tracking branch 'origin/main' into feat/380-dockerize
yahgwai Feb 10, 2026
80ab399
Update src/cli/commands/arbos-upgrade.ts
yahgwai Mar 4, 2026
f083a68
fix: add missing Interface import from ethers
yahgwai Mar 4, 2026
5a4ceca
refactor: pass env vars to runForgeScript instead of mutating process…
yahgwai Mar 4, 2026
2acea4e
fix: use try/catch for execa error handling instead of dead exitCode …
yahgwai Mar 4, 2026
a863cdb
refactor: constrain verbosity to valid forge range via union type
yahgwai Mar 4, 2026
4b4712e
fix: minor cleanups to Dockerfile, workflow, router, and arbos-upgrade
yahgwai Mar 9, 2026
94bef28
refactor: remove CLI auth args and combined command, use FOUNDRY_* en…
yahgwai Mar 10, 2026
3765422
fix: address PR review feedback on CLI UX and error handling
yahgwai Mar 10, 2026
54c190c
refactor: simplify env templates and remove command prefix from help …
yahgwai Mar 10, 2026
8344c39
chore: remove bin entry from package.json
yahgwai Mar 10, 2026
707cc07
refactor: remove log() wrapper, use console.log directly
yahgwai Mar 11, 2026
0efc403
Apply suggestion from @godzillaba
yahgwai Mar 11, 2026
657fd93
feat: auto-resolve action address from broadcast file for deploy && e…
yahgwai Mar 11, 2026
e7f8387
refactor: consolidate resolveActionAddress into forge utils
yahgwai Mar 11, 2026
7a6d9a6
fix: update docker tests for removed deploy-execute-verify command
yahgwai Mar 11, 2026
784b100
fix: update local test to use yarn cli instead of removed bin/router
yahgwai Mar 11, 2026
ede1c95
chore: fix prettier formatting in router.ts
yahgwai Mar 11, 2026
2853daa
fix: handle deploy simulation mode gracefully in CLI
yahgwai Mar 12, 2026
d336a84
refactor: use ethers for ABI encoding/decoding instead of cast
yahgwai Mar 12, 2026
a022a65
fix: inherit stderr in cast call utilities for visible error output
yahgwai Mar 12, 2026
1d77f3a
docs: document last-CREATE convention in deploy scripts and README
yahgwai Mar 12, 2026
cb1cbeb
fix: address PR review findings across CLI, Docker, and verify scripts
yahgwai Mar 12, 2026
e4fed49
fix: use --install flag for foundryup v1.5.0 CLI change
yahgwai Mar 12, 2026
72497e2
Update scripts/foundry/contract-upgrades/2.1.3/README.md
yahgwai Mar 24, 2026
38111b7
Merge branch 'main' into feat/380-dockerize
yahgwai Mar 24, 2026
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
30 changes: 30 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Dependencies (will be installed fresh in container)
node_modules/

# Build artifacts (will be built fresh in container)
out/
cache_forge/
cache/
artifacts/
typechain-types/

# Environment files (contain secrets)
.env
.env.*
!.env.example

# Git
.git/
.gitignore

# IDE
.vscode/
.idea/

# Test artifacts
broadcast/
coverage/

# Docker
Dockerfile
.dockerignore
38 changes: 38 additions & 0 deletions .github/workflows/test-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test Docker

on:
pull_request:
workflow_dispatch:

jobs:
test-docker:
name: Test Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Install forge dependencies
run: forge install

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: orbit-actions:test
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run Docker smoke tests
run: ./test/docker/test-docker.bash
env:
DOCKER_IMAGE: orbit-actions:test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
.env
.DS_Store

# Hardhat files
/cache
Expand Down
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM node:18-slim

# Install dependencies for Foundry and git
RUN apt-get update && apt-get install -y \
curl \
git \
&& rm -rf /var/lib/apt/lists/*

# Install Foundry
RUN curl -L https://foundry.paradigm.xyz | bash
ENV PATH="/root/.foundry/bin:${PATH}"
RUN foundryup
Comment thread
yahgwai marked this conversation as resolved.
Outdated

# Install Yarn Classic (v1) - matches the repo's yarn.lock format
RUN npm install -g --force yarn@1.22.22

# Set working directory
WORKDIR /app

# Copy package files first for better caching
COPY package.json yarn.lock ./

# Install dependencies (using --ignore-scripts like CI does, then forge install separately)
RUN yarn install --frozen-lockfile --ignore-scripts

# Copy the rest of the repository
COPY . .
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The Docker build relies on Forge dependencies being present, but the Dockerfile never runs forge install (and yarn install --ignore-scripts skips the repo's prepare hook that would normally do it). This makes docker build fail unless the build context already contains lib/ from a prior host-side forge install (as your CI currently does). Add an explicit RUN forge install inside the Dockerfile (after COPY . . and before forge build) so the image builds reliably from a clean checkout.

Suggested change
COPY . .
COPY . .
RUN forge install

Copilot uses AI. Check for mistakes.

# Build contracts
RUN forge build
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,73 @@ For token bridge related operations, these are the additional requirements:
yarn install
```

## Using Docker

The Orbit actions are also available via Docker.

### Build the image

First, ensure Foundry dependencies are installed:

```bash
forge install
```

Then build the image:

```bash
Comment thread
yahgwai marked this conversation as resolved.
Outdated
docker build -t orbit-actions .
```

### Run commands

Pass the command you want to run directly to Docker:

```bash
# Check contract versions
docker run --rm \
-e INBOX_ADDRESS=0xYourInboxAddress \
-e INFURA_KEY=your_infura_key \
orbit-actions \
yarn orbit:contracts:version --network arb1

# Run forge script
docker run --rm \
--env-file orbit.env \
-v $(pwd)/broadcast:/app/broadcast \
orbit-actions \
forge script --sender 0xYourAddress --rpc-url $PARENT_CHAIN_RPC --broadcast \
scripts/foundry/contract-upgrades/2.1.3/DeployNitroContracts2Point1Point3UpgradeAction.s.sol -vvv

# Run cast commands
docker run --rm \
orbit-actions \
cast call --rpc-url https://arb1.arbitrum.io/rpc 0xYourRollup "wasmModuleRoot()"
```

### Environment variables

Create an `orbit.env` file with your configuration and pass it using `--env-file`:

```bash
PARENT_CHAIN_RPC=https://arb1.arbitrum.io/rpc
INBOX_ADDRESS=0x...
PROXY_ADMIN_ADDRESS=0x...
PARENT_UPGRADE_EXECUTOR_ADDRESS=0x...
```

### Getting output artifacts

Mount a volume to retrieve broadcast artifacts:

```bash
docker run --rm \
--env-file orbit.env \
-v $(pwd)/broadcast:/app/broadcast \
orbit-actions \
forge script ...
```

## Check Version and Upgrade Path

Run the follow command to check the version of Nitro contracts deployed on the parent chain of your Orbit chain.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"test:gas-check": "forge snapshot --check --tolerance 1 --match-path \"test/unit/**/*.t.sol\"",
"test:sigs": "./test/signatures/test-sigs.bash",
"test:storage": "./test/storage/test-storage.bash",
"test:docker": "./test/docker/test-docker.bash",
"orbit:contracts:version": "hardhat run scripts/orbit-versioner/orbitVersioner.ts",
"gas-snapshot": "forge snapshot --match-path \"test/unit/**/*.t.sol\"",
"fix": "yarn format; yarn test:sigs; yarn test:storage; yarn gas-snapshot"
Expand Down
100 changes: 100 additions & 0 deletions test/docker/test-docker.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/bin/bash
Comment thread
yahgwai marked this conversation as resolved.
set -euo pipefail

# Docker smoke tests for orbit-actions
# Verifies that all required tools and scripts are accessible in the Docker image

IMAGE_NAME="${DOCKER_IMAGE:-orbit-actions:test}"

echo "=== Docker Smoke Tests ==="
echo "Image: $IMAGE_NAME"
echo ""

# Track failures
FAILURES=0

run_test() {
local name="$1"
shift
echo -n "Testing $name... "
if "$@" > /dev/null 2>&1; then
echo "OK"
else
echo "FAILED"
FAILURES=$((FAILURES + 1))
fi
}

# Test 1: Tools are installed
echo "--- Tool Availability ---"
run_test "forge" docker run --rm "$IMAGE_NAME" forge --version
run_test "cast" docker run --rm "$IMAGE_NAME" cast --version
run_test "yarn" docker run --rm "$IMAGE_NAME" yarn --version
run_test "node" docker run --rm "$IMAGE_NAME" node --version

# Test 2: Dependencies are installed
echo ""
echo "--- Dependencies ---"
run_test "node_modules exists" docker run --rm "$IMAGE_NAME" test -d node_modules
run_test "forge dependencies" docker run --rm "$IMAGE_NAME" test -d node_modules/@arbitrum

# Test 3: Contracts compile
echo ""
echo "--- Contract Compilation ---"
run_test "contracts built" docker run --rm "$IMAGE_NAME" test -d out

# Test 4: Scripts are accessible
echo ""
echo "--- Script Accessibility ---"

DEPLOY_SCRIPTS=(
"scripts/foundry/contract-upgrades/1.2.1/DeployNitroContracts1Point2Point1UpgradeAction.s.sol"
"scripts/foundry/contract-upgrades/2.1.0/DeployNitroContracts2Point1Point0UpgradeAction.s.sol"
"scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol"
"scripts/foundry/contract-upgrades/2.1.3/DeployNitroContracts2Point1Point3UpgradeAction.s.sol"
"scripts/foundry/arbos-upgrades/at-timestamp/DeployUpgradeArbOSVersionAtTimestampAction.s.sol"
)

for script in "${DEPLOY_SCRIPTS[@]}"; do
script_name=$(basename "$script")
run_test "$script_name exists" docker run --rm "$IMAGE_NAME" test -f "$script"
done

EXECUTE_SCRIPTS=(
"scripts/foundry/contract-upgrades/1.2.1/ExecuteNitroContracts1Point2Point1Upgrade.s.sol"
"scripts/foundry/contract-upgrades/2.1.0/ExecuteNitroContracts2Point1Point0Upgrade.s.sol"
"scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol"
"scripts/foundry/contract-upgrades/2.1.3/ExecuteNitroContracts2Point1Point3Upgrade.s.sol"
)

for script in "${EXECUTE_SCRIPTS[@]}"; do
script_name=$(basename "$script")
run_test "$script_name exists" docker run --rm "$IMAGE_NAME" test -f "$script"
done

# Test 5: Yarn scripts work
echo ""
echo "--- Yarn Scripts ---"
run_test "yarn orbit:contracts:version --help" docker run --rm "$IMAGE_NAME" yarn orbit:contracts:version --help
Comment thread
yahgwai marked this conversation as resolved.
Outdated

# Test 6: Unit tests pass
echo ""
echo "--- Unit Tests ---"
echo "Running unit tests inside container..."
if docker run --rm "$IMAGE_NAME" yarn test:unit; then
echo "Unit tests: OK"
else
echo "Unit tests: FAILED"
FAILURES=$((FAILURES + 1))
fi

# Summary
echo ""
echo "=== Summary ==="
if [ $FAILURES -eq 0 ]; then
echo "All tests passed!"
exit 0
else
echo "$FAILURES test(s) failed"
exit 1
fi
Loading