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
65 changes: 15 additions & 50 deletions .github/workflows/_build-binaries.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Reusable workflow for building all binaries
# This workflow is called by other workflows to build reth, geth, builder, op-program, and contracts
# This workflow is called by other workflows to build reth, geth, base-reth-node, base-builder, op-program, and contracts
name: Build Binaries

on:
Expand All @@ -15,11 +15,6 @@ on:
required: false
type: string
default: "6cbfcd5161083bcd4052edc3022d9f99c6fe40e0"
builder_version:
description: "Builder version to build"
required: false
type: string
default: "23f42c8e78ba3abb45a8840df7037a27e196e601"
base_reth_node_version:
description: "Base Reth Node version to build"
required: false
Expand Down Expand Up @@ -145,46 +140,6 @@ jobs:
path: ~/bin/geth
retention-days: 1

build-builder:
runs-on: ubuntu-latest
permissions:
contents: read
actions: write # Required for artifact upload
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
with:
egress-policy: audit

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0

- name: Cache builder binary
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3.4.3
id: cache-builder
with:
path: ~/bin/builder
key: ${{ runner.os }}-builder-${{ inputs.builder_version }}

- name: Build builder
if: steps.cache-builder.outputs.cache-hit != 'true'
run: |
unset CI
mkdir -p ~/bin
cd clients
BUILDER_VERSION=${{ inputs.builder_version }} OUTPUT_DIR=~/bin ./build-builder.sh
# Rename op-rbuilder to builder for consistency
[ -f ~/bin/op-rbuilder ] && mv ~/bin/op-rbuilder ~/bin/builder || true

- name: Upload builder artifact
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: builder
path: ~/bin/builder
retention-days: 1

build-base-reth-node:
runs-on: ubuntu-latest
permissions:
Expand All @@ -201,20 +156,23 @@ jobs:
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0

- name: Cache base-reth-node binary
- name: Cache base-reth-node binaries
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3.4.3
id: cache-base-reth-node
with:
path: ~/bin/base-reth-node
key: ${{ runner.os }}-base-reth-node-${{ inputs.base_reth_node_version }}
path: |
~/bin/base-reth-node
~/bin/builder
key: ${{ runner.os }}-base-reth-node-builder-${{ inputs.base_reth_node_version }}

- name: Build base-reth-node
- name: Build base-reth-node and base-builder
if: steps.cache-base-reth-node.outputs.cache-hit != 'true'
run: |
unset CI
mkdir -p ~/bin
cd clients
BASE_RETH_NODE_VERSION=${{ inputs.base_reth_node_version }} OUTPUT_DIR=~/bin ./build-base-reth-node.sh
[ -f ~/bin/base-builder ] && mv ~/bin/base-builder ~/bin/builder || true

- name: Upload base-reth-node artifact
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
Expand All @@ -223,6 +181,13 @@ jobs:
path: ~/bin/base-reth-node
retention-days: 1

- name: Upload builder artifact
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: builder
path: ~/bin/builder
retention-days: 1

build-op-program:
runs-on: ubuntu-latest
permissions:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ jobs:
with:
optimism_version: 3019251e80aa248e91743addd3e833190acb26f1
geth_version: 6cbfcd5161083bcd4052edc3022d9f99c6fe40e0
builder_version: 23f42c8e78ba3abb45a8840df7037a27e196e601
base_reth_node_version: main

basic-benchmarks:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
with:
optimism_version: 3019251e80aa248e91743addd3e833190acb26f1
geth_version: 6cbfcd5161083bcd4052edc3022d9f99c6fe40e0
builder_version: 23f42c8e78ba3abb45a8840df7037a27e196e601
base_reth_node_version: main

example-benchmarks:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/public-benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
optimism_version: 3019251e80aa248e91743addd3e833190acb26f1
geth_version: 6cbfcd5161083bcd4052edc3022d9f99c6fe40e0
builder_version: 23f42c8e78ba3abb45a8840df7037a27e196e601
base_reth_node_version: main

basic-benchmarks:
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ build-reth:
build-geth:
cd clients && ./build-geth.sh

.PHONY: build-builder
build-builder:
cd clients && ./build-builder.sh
.PHONY: build-base-reth-node
build-base-reth-node:
cd clients && ./build-base-reth-node.sh

.PHONY: build-binaries
build-binaries: build-reth build-geth build-builder
build-binaries: build-reth build-geth build-base-reth-node

.PHONY: build-frontend
build-frontend:
Expand Down
31 changes: 16 additions & 15 deletions clients/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Builds the op-geth binary from the Ethereum Optimism op-geth repository using ju
- Version: `optimism`
- Build tool: `go run build/ci.go install`

### build-builder.sh
Builds the builder binary from the op-rbuilder repository using Cargo.
### build-base-reth-node.sh
Builds the base-reth-node and base-builder binaries from the base repository using Cargo.

**Default Configuration:**
- Repository: `https://github.com/base/op-rbuilder`
- Repository: `https://github.com/base/base`
- Version: `main`
- Build tool: `cargo`

Expand All @@ -42,8 +42,8 @@ make build-reth
# Build only geth
make build-geth

# Build only builder
make build-builder
# Build base-reth-node and base-builder
make build-base-reth-node
```

### Direct Script Execution
Expand All @@ -56,8 +56,8 @@ cd clients
# Build geth with defaults
./build-geth.sh

# Build builder with defaults
./build-builder.sh
# Build base-reth-node and base-builder with defaults
./build-base-reth-node.sh
```

## Version Management
Expand All @@ -75,7 +75,7 @@ Modify the `versions.env` file to change defaults for all builds:
# Edit versions.env to update default versions
OPTIMISM_VERSION="v0.2.0-beta.5"
GETH_VERSION="v1.13.0"
BUILDER_VERSION="your-commit-hash"
BASE_RETH_NODE_VERSION="your-commit-hash"
```

#### 2. Environment Variables
Expand All @@ -88,8 +88,8 @@ OPTIMISM_REPO="https://github.com/ethereum-optimism/optimism/" OPTIMISM_VERSION=
# Build geth from a fork
GETH_REPO="https://github.com/your-fork/op-geth/" GETH_VERSION="your-branch" ./build-geth.sh

# Build builder from a different commit
BUILDER_VERSION="main" ./build-builder.sh
# Build base-reth-node and base-builder from a different commit
BASE_RETH_NODE_VERSION="your-commit-hash" ./build-base-reth-node.sh
```

### Available Environment Variables
Expand All @@ -106,9 +106,9 @@ BUILDER_VERSION="main" ./build-builder.sh
- `BUILD_DIR`: Directory for source code (default: ./build)
- `OUTPUT_DIR`: Directory for built binaries (default: ../bin)

#### For builder (build-builder.sh):
- `BUILDER_REPO`: Git repository URL (default: https://github.com/base/op-rbuilder)
- `BUILDER_VERSION`: Git branch, tag, or commit hash (default: main)
#### For base-reth-node (build-base-reth-node.sh):
- `BASE_RETH_NODE_REPO`: Git repository URL (default: https://github.com/base/base)
- `BASE_RETH_NODE_VERSION`: Git branch, tag, or commit hash (default: main)
- `BUILD_DIR`: Directory for source code (default: ./build)
- `OUTPUT_DIR`: Directory for built binaries (default: ../bin)

Expand All @@ -122,7 +122,7 @@ BUILDER_VERSION="main" ./build-builder.sh
- Go toolchain
- Git

### For builder:
### For base-reth-node:
- Rust and Cargo installed
- Git

Expand All @@ -131,4 +131,5 @@ BUILDER_VERSION="main" ./build-builder.sh
Built binaries will be placed in the `bin/` directory at the project root:
- `bin/reth` - The reth binary
- `bin/geth` - The op-geth binary
- `bin/op-rbuilder` - The builder binary
- `bin/base-reth-node` - The base reth node binary
- `bin/base-builder` - The builder binary
23 changes: 15 additions & 8 deletions clients/build-base-reth-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ BASE_RETH_NODE_VERSION="${BASE_RETH_NODE_VERSION:-main}"
BUILD_DIR="${BUILD_DIR:-./build}"
OUTPUT_DIR="${OUTPUT_DIR:-../bin}"

echo "Building base-reth-node binary..."
echo "Building base-reth-node and base-builder binaries..."
echo "Repository: $BASE_RETH_NODE_REPO"
echo "Version/Commit: $BASE_RETH_NODE_VERSION"
echo "Build directory: $BUILD_DIR"
Expand Down Expand Up @@ -42,13 +42,13 @@ fi
echo "Checking out version: $BASE_RETH_NODE_VERSION"
git checkout -f "$BASE_RETH_NODE_VERSION"

# Build the binary using cargo
echo "Building base-reth-node with cargo..."
# Build the binaries using cargo
echo "Building base-reth-node and base-builder with cargo..."
# Build with maxperf profile
cargo build --bin base-reth-node --profile maxperf
cargo build --bin base-reth-node --bin base-builder --profile maxperf

# Copy binary to output directory
echo "Copying binary to output directory..."
# Copy binaries to output directory
echo "Copying binaries to output directory..."
# Handle absolute paths correctly
if [[ "$OUTPUT_DIR" == /* ]]; then
# Absolute path - use directly
Expand All @@ -59,12 +59,19 @@ else
fi
mkdir -p "$FINAL_OUTPUT_DIR"

# Find the built binary and copy it
# Find the built binaries and copy them
if [ -f "target/maxperf/base-reth-node" ]; then
cp target/maxperf/base-reth-node "$FINAL_OUTPUT_DIR/"
else
echo "No base-reth-node binary found"
exit 1
fi

echo "base-reth-node binary built successfully and placed in $FINAL_OUTPUT_DIR/base-reth-node"
if [ -f "target/maxperf/base-builder" ]; then
cp target/maxperf/base-builder "$FINAL_OUTPUT_DIR/"
else
echo "No base-builder binary found"
exit 1
fi

echo "base-reth-node and base-builder binaries built successfully and placed in $FINAL_OUTPUT_DIR/"
70 changes: 0 additions & 70 deletions clients/build-builder.sh

This file was deleted.

4 changes: 0 additions & 4 deletions clients/versions.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ OPTIMISM_VERSION="3019251e80aa248e91743addd3e833190acb26f1"
GETH_REPO="https://github.com/ethereum-optimism/op-geth/"
GETH_VERSION="v1.101604.0"

# Builder Configuration
BUILDER_REPO="https://github.com/base/op-rbuilder"
BUILDER_VERSION="main"

# Base Reth Node Configuration
BASE_RETH_NODE_REPO="https://github.com/base/base"
BASE_RETH_NODE_VERSION="main"
Expand Down
1 change: 1 addition & 0 deletions runner/clients/baserethnode/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func (r *BaseRethNodeClient) Run(ctx context.Context, cfg *types.RuntimeConfig)
// increase mempool size
args = append(args, "--txpool.pending-max-count", "100000000")
args = append(args, "--txpool.queued-max-count", "100000000")
args = append(args, "--txpool.max-account-slots", "100000000")
args = append(args, "--txpool.pending-max-size", "100")
args = append(args, "--txpool.queued-max-size", "100")

Expand Down
1 change: 0 additions & 1 deletion runner/clients/builder/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func (r *BuilderClient) Run(ctx context.Context, cfg *types.RuntimeConfig) error

cfg2 := *cfg
cfg2.Args = append(cfg2.Args, "--flashblocks.port", fmt.Sprintf("%d", r.websocketPort))
cfg2.Args = append(cfg2.Args, "--flashblocks.fixed")
err := r.elClient.Run(ctx, &cfg2)
if err != nil {
return err
Expand Down